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
                            Recent Advances in Sequencing Analysis Tools
                            by seqadmin


                            The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                            Yesterday, 07:48 AM
                          • seqadmin
                            Essential Discoveries and Tools in Epitranscriptomics
                            by seqadmin




                            The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                            04-22-2024, 07:01 AM

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by seqadmin, Today, 06:57 AM
                          0 responses
                          9 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, Yesterday, 07:17 AM
                          0 responses
                          13 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 05-02-2024, 08:06 AM
                          0 responses
                          19 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 04-30-2024, 12:17 PM
                          0 responses
                          22 views
                          0 likes
                          Last Post seqadmin  
                          Working...
                          X