Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • bvk
    Member
    • May 2015
    • 65

    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
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #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

    • bvk
      Member
      • May 2015
      • 65

      #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

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #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

        • bvk
          Member
          • May 2015
          • 65

          #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

          • dpryan
            Devon Ryan
            • Jul 2011
            • 3478

            #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

            • bvk
              Member
              • May 2015
              • 65

              #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

              • dpryan
                Devon Ryan
                • Jul 2011
                • 3478

                #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

                • bvk
                  Member
                  • May 2015
                  • 65

                  #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

                  • bvk
                    Member
                    • May 2015
                    • 65

                    #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

                    • dpryan
                      Devon Ryan
                      • Jul 2011
                      • 3478

                      #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

                      • bvk
                        Member
                        • May 2015
                        • 65

                        #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

                        • bvk
                          Member
                          • May 2015
                          • 65

                          #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

                          • SEQadmin2
                            Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                            by SEQadmin2



                            Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                            ...
                            07-09-2026, 11:10 AM
                          • SEQadmin2
                            Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                            by SEQadmin2



                            Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                            There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                            07-08-2026, 05:17 AM
                          • GATTACAT
                            Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                            by GATTACAT
                            Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                            07-01-2026, 11:43 AM

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by SEQadmin2, Today, 10:26 AM
                          0 responses
                          9 views
                          0 reactions
                          Last Post SEQadmin2  
                          Started by SEQadmin2, 07-09-2026, 10:04 AM
                          0 responses
                          24 views
                          0 reactions
                          Last Post SEQadmin2  
                          Started by SEQadmin2, 07-08-2026, 10:08 AM
                          0 responses
                          16 views
                          0 reactions
                          Last Post SEQadmin2  
                          Started by SEQadmin2, 07-07-2026, 11:05 AM
                          0 responses
                          33 views
                          0 reactions
                          Last Post SEQadmin2  
                          Working...