Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
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

                          • seqadmin
                            Strategies for Sequencing Challenging Samples
                            by seqadmin


                            Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                            03-22-2024, 06:39 AM
                          • seqadmin
                            Techniques and Challenges in Conservation Genomics
                            by seqadmin



                            The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                            Avian Conservation
                            Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                            03-08-2024, 10:41 AM

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by seqadmin, Yesterday, 06:37 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, Yesterday, 06:07 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 03-22-2024, 10:03 AM
                          0 responses
                          49 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 03-21-2024, 07:32 AM
                          0 responses
                          66 views
                          0 likes
                          Last Post seqadmin  
                          Working...
                          X