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
                            Latest Developments in Precision Medicine
                            by seqadmin



                            Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

                            Somatic Genomics
                            “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
                            05-24-2024, 01:16 PM
                          • 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...
                            05-06-2024, 07:48 AM

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by seqadmin, 05-24-2024, 07:15 AM
                          0 responses
                          15 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 05-23-2024, 10:28 AM
                          0 responses
                          18 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 05-23-2024, 07:35 AM
                          0 responses
                          21 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 05-22-2024, 02:06 PM
                          0 responses
                          10 views
                          0 likes
                          Last Post seqadmin  
                          Working...
                          X