Header Leaderboard Ad

Collapse

Error: number of labels must match number of conditions in cuffdiff

Collapse

Announcement

Collapse

SEQanswers June Challenge Has Begun!

The competition has begun! We're giving away a $50 Amazon gift card to the member who answers the most questions on our site during the month. We want to encourage our community members to share their knowledge and help each other out by answering questions related to sequencing technologies, genomics, and bioinformatics. The competition is open to all members of the site, and the winner will be announced at the beginning of July. Best of luck!

For a list of the official rules, visit (https://www.seqanswers.com/forum/sit...wledge-and-win)
See more
See less
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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"])

    Comment


    • #3
      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?

      Comment


      • #4
        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.

        Comment


        • #5
          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

          Comment


          • #6
            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.

            Comment


            • #7
              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 !!

              Comment


              • #8
                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.

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      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.

                      Comment


                      • #12
                        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'

                        Comment


                        • #13
                          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

                          Comment

                          Latest Articles

                          Collapse

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by seqadmin, 06-01-2023, 08:56 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 06-01-2023, 07:33 AM
                          0 responses
                          8 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 05-31-2023, 07:50 AM
                          0 responses
                          4 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 05-26-2023, 09:22 AM
                          0 responses
                          10 views
                          0 likes
                          Last Post seqadmin  
                          Working...
                          X