SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
DESeq2 - COLUMN and ROWS number don't match KYR RNA Sequencing 1 07-16-2014 02:21 PM
MISO output - mismatch between number of transcripts and number of assigned counts MikeStubbington Bioinformatics 1 01-29-2014 08:44 AM
huge number of DEGs from cuffdiff jamal RNA Sequencing 5 12-15-2013 06:08 PM
Error: number of labels must match number of conditions shpyang Bioinformatics 2 08-15-2013 02:45 PM
Varscan header doesn't match the number of columns in the data rdeborja Bioinformatics 3 01-30-2013 09:52 AM

Reply
 
Thread Tools
Old 05-20-2015, 01:15 AM   #1
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default Error: number of labels must match number of conditions in cuffdiff

In a python script I gave a call in this way:

do.call([cfg.tool_cmd("cuffdiff"),
"-p", str(cfg.project["analysis"]["threads"]),
"-b", str(cfg.project["genome"]["fasta"]),
"-u", cfg.project["experiment"]["merged"],
"-L", str(cfg.project["phenotype"][0])[2:8],str(cfg.project["phenotype"][1])[2:7],
"-o", output_folder] + [cfg.project["samples"][0]["files"]["bam"] + ' ' + cfg.project["samples"][1]["files"]["bam"]], cfg.project["analysis"]["log_file"])

And this gives an Error: number of labels must match number of conditions

subprocess.CalledProcessError: Command '['/usr/local/bin/cuffdiff', '-p', '5', '-b', '/scratchsan/venkatesh/TuxedoProject/data/genome/ce10.fa', '-u', 'pipeline/merging/merged.gtf', '-L', 'embryo', 'larva', '-o', 'pipeline/degenes', 'pipeline/SAMN00990702-1/mappings/accepted_hits.bam pipeline/SAMN00990702-2/mappings/accepted_hits.bam']' returned non-zero exit status 1
bvk is offline   Reply With Quote
Old 05-20-2015, 01:44 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,479
Default

When it's actually constructing the command, it's separating the labels by a space rather than a comma. You probably want something like:

Code:
do.call([cfg.tool_cmd("cuffdiff"),
"-p", str(cfg.project["analysis"]["threads"]),
"-b", str(cfg.project["genome"]["fasta"]),
"-u", cfg.project["experiment"]["merged"],
"-L", "%s,%s" % (str(cfg.project["phenotype"][0])[2:8],str(cfg.project["phenotype"][1])[2:7]),
"-o", output_folder] + [cfg.project["samples"][0]["files"]["bam"] + ' ' + cfg.project["samples"][1]["files"]["bam"]], cfg.project["analysis"]["log_file"])
dpryan is offline   Reply With Quote
Old 05-20-2015, 01:52 AM   #3
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
When it's actually constructing the command, it's separating the labels by a space rather than a comma. You probably want something like:

Code:
do.call([cfg.tool_cmd("cuffdiff"),
"-p", str(cfg.project["analysis"]["threads"]),
"-b", str(cfg.project["genome"]["fasta"]),
"-u", cfg.project["experiment"]["merged"],
"-L", "%s,%s" % (str(cfg.project["phenotype"][0])[2:8],str(cfg.project["phenotype"][1])[2:7]),
"-o", output_folder] + [cfg.project["samples"][0]["files"]["bam"] + ' ' + cfg.project["samples"][1]["files"]["bam"]], cfg.project["analysis"]["log_file"])
Thank you !! Can you please tell what does "%s,%s" % this do?
bvk is offline   Reply With Quote
Old 05-20-2015, 01:55 AM   #4
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,479
Default

It's a formatted print (I have no clue what the python terminology for this is). "%s" means a string (%i is an integer, %f is a floating point value, etc.). There's probably a more "pythonic" way of doing that, but what I showed is simple enough.
dpryan is offline   Reply With Quote
Old 05-20-2015, 02:04 AM   #5
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
It's a formatted print (I have no clue what the python terminology for this is). "%s" means a string (%i is an integer, %f is a floating point value, etc.). There's probably a more "pythonic" way of doing that, but what I showed is simple enough.
Thanks again It worked but now the error is:

Error: cuffdiff requires at least 2 SAM files
bvk is offline   Reply With Quote
Old 05-20-2015, 02:10 AM   #6
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,479
Default

You forgot the GTF file, so it's assuming the first BAM file is the GTF file.

Edit: I take that back, it's there, but try putting it before the BAM files in the command.
dpryan is offline   Reply With Quote
Old 05-20-2015, 02:11 AM   #7
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
You forgot the GTF file, so it's assuming the first BAM file is the GTF file.
Nope. Here, merged is the merged.gtf file !!
bvk is offline   Reply With Quote
Old 05-20-2015, 02:21 AM   #8
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,479
Default

See the update to my previous reply it's possible that the command simply isn't being parsed correctly. In general, run the command manually from the command line and then fix it as needed to get it to work. Then make the python script construct that command.
dpryan is offline   Reply With Quote
Old 05-20-2015, 02:29 AM   #9
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
See the update to my previous reply it's possible that the command simply isn't being parsed correctly. In general, run the command manually from the command line and then fix it as needed to get it to work. Then make the python script construct that command.
Yes, as you said I tried to run on command line and this gave:

.../usr/local/bin/cuffdiff -p 5 -b /scratchsan/venkatesh/TuxedoProject/data/genome/ce10.fa -u pipeline/merging/merged.gtf -L embryo,larva -o pipeline/degenes pipeline/SAMN00990702-1/mappings/accepted_hits.bam pipeline/SAMN00990702-2/mappings/accepted_hits.bam

Here there is a space between bam files but bothe the bam files are taken as one string.
bvk is offline   Reply With Quote
Old 05-20-2015, 02:35 AM   #10
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by bvk View Post
Yes, as you said I tried to run on command line and this gave:

.../usr/local/bin/cuffdiff -p 5 -b /scratchsan/venkatesh/TuxedoProject/data/genome/ce10.fa -u pipeline/merging/merged.gtf -L embryo,larva -o pipeline/degenes pipeline/SAMN00990702-1/mappings/accepted_hits.bam pipeline/SAMN00990702-2/mappings/accepted_hits.bam

Here there is a space between bam files but bothe the bam files are taken as one string.
It is treating both the bam files as one bam file. this is the problem
bvk is offline   Reply With Quote
Old 05-20-2015, 02:37 AM   #11
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,479
Default

You can always just construct that exact command in python and then pass it as a string to subprocess.call(). That's often a bit easier to debug, since you can use a print() command first to be certain what the command that's being run is.
dpryan is offline   Reply With Quote
Old 05-20-2015, 02:53 AM   #12
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
You can always just construct that exact command in python and then pass it as a string to subprocess.call(). That's often a bit easier to debug, since you can use a print() command first to be certain what the command that's being run is.
I tried with the print() command:

In that it gave 'pipeline/SAMN00990702-1/mappings/accepted_hits.bam pipeline/SAMN00990702-2/mappings/accepted_hits.bam'. so eventhough there is a space between bam files both are taken as one file. (represented with single code)

I guess it should give like this:

'pipeline/SAMN00990702-1/mappings/accepted_hits.bam' 'pipeline/SAMN00990702-2/mappings/accepted_hits.bam'
bvk is offline   Reply With Quote
Old 05-20-2015, 12:41 PM   #13
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
You can always just construct that exact command in python and then pass it as a string to subprocess.call(). That's often a bit easier to debug, since you can use a print() command first to be certain what the command that's being run is.
Atlast it worked !! Thank you
bvk is offline   Reply With Quote
Reply

Tags
cuffdiff, python, rnaseq

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 02:25 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO