Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dipsauce
    Junior Member
    • Jan 2014
    • 5

    #1

    Cuffdiff Error: "cuffdiff requires at least 2 SAM files"

    Hi all,
    I am new to NGS RNA analysis and am trying to analyze differential expression of genes using cuffdiff between 3 groups of cells (Heterozygous, Knock-out and wildtype).

    Completed steps by our NGS core:
    1. prepare samples from FQ files to BAM files.
    2. prepared transcripts.gtf for every sample

    Then, what I did:
    2. create a assemblies.txt that lists the location and assembly file (transcripts.gtf) for every sample.

    3. Ran cuffmerge which created a merged.gtf file

    Now, at step 4 of running CuffDiff I am getting an error called
    "Error: cuffdiff requires at least 2 SAM files"

    This was my command:

    cuffdiff -o diff_out -b genome.fa -p 8 -L HZ,KO,WT -u merged_asm/merged.gtf \
    ./HZ_1_unp/accepted_hits.bam,./HZ_2_unp/accepted_hits.bam,./HZ_3_unp/accepted_hits.bam\
    ./KO_1_unp/accepted_hits.bam,./KO_4_unp/accepted_hits.bam,./KO_5_unp/accepted_hits.bam\
    ./WT_1_unp/accepted_hits.bam,./WT_2_unp/accepted_hits.bam,./WT_3_unp/accepted_hits.bam,./WT_4_unp/accepted_hits.bam

    Then, I receive the error. I get the feeling that it is not able to find the BAM files? It seems incorrect that cuffdiff would like to have SAM files, since according to the Article of Trapnell at all. it states " 5) Run Cuffdiff by using the merged transcriptome assembly along with the BAM files from TopHat for each replicate"

    How can i make cuffdiff do it's thing after all?! Thanks!
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Try adding a space in front of the last two backslashes (i.e., change "\" to " \").

    Edit: I guess it'd be helpful to explain Cuffdiff is expecting at least two groups of files to compare against each other (here, a group can consist of one or more members). The groups should be separated from each other by spaces, e.g., "group1_1.bam,group1_2.bam group2_1.bam,group2_2.bam". What the "\" does is tell the shell that you're splitting a single command over more than one line, generally to make things easier to read (if you're basing everything off of the nature methods paper, their usage of "\" there ends up confusing a LOT of people new to the command line). So, your command is identical to:

    Code:
    cuffdiff -o diff_out -b genome.fa -p 8 -L HZ,KO,WT -u merged_asm/merged.gtf ./HZ_1_unp/accepted_hits.bam,./HZ_2_unp/accepted_hits.bam,./HZ_3_unp/accepted_hits.bam./KO_1_unp/accepted_hits.bam,./KO_4_unp/accepted_hits.bam,./KO_5_unp/accepted_hits.bam./WT_1_unp/accepted_hits.bam,./WT_2_unp/accepted_hits.bam,./WT_3_unp/accepted_hits.bam,./WT_4_unp/accepted_hits.bam
    What you actually want to type is either:
    Code:
    cuffdiff -o diff_out -b genome.fa -p 8 -L HZ,KO,WT -u merged_asm/merged.gtf \
    ./HZ_1_unp/accepted_hits.bam,./HZ_2_unp/accepted_hits.bam,./HZ_3_unp/accepted_hits.bam \
    ./KO_1_unp/accepted_hits.bam,./KO_4_unp/accepted_hits.bam,./KO_5_unp/accepted_hits.bam \
    ./WT_1_unp/accepted_hits.bam,./WT_2_unp/accepted_hits.bam,./WT_3_unp/accepted_hits.bam,./WT_4_unp/accepted_hits.bam
    or (as a single line):
    Code:
    cuffdiff -o diff_out -b genome.fa -p 8 -L HZ,KO,WT -u merged_asm/merged.gtf ./HZ_1_unp/accepted_hits.bam,./HZ_2_unp/accepted_hits.bam,./HZ_3_unp/accepted_hits.bam ./KO_1_unp/accepted_hits.bam,./KO_4_unp/accepted_hits.bam,./KO_5_unp/accepted_hits.bam ./WT_1_unp/accepted_hits.bam,./WT_2_unp/accepted_hits.bam,./WT_3_unp/accepted_hits.bam,./WT_4_unp/accepted_hits.bam
    Note the spaces prior to the continue-on-the-next-line designator ("\") in the first example and the groups in the second example (they're the same in the end).
    Last edited by dpryan; 01-22-2014, 11:18 AM.

    Comment

    • dipsauce
      Junior Member
      • Jan 2014
      • 5

      #3
      Hi Dpryan,

      Haha, your extra explanation was realy helpful indeed, I see where it went wrong.
      The analysis is working, thanks a lot!

      Comment

      • aditisk
        Member
        • Aug 2015
        • 12

        #4
        Hi everyone,

        I am also facing a similar issue. My command is as follows:

        cuffdiff -p 6 -o ./UM108_cuffdiff -u --compatible-hits-norm -M Homo_sapiens.GRCh37.75.gtf \
        61327_tophat.bam \
        61328_tophat.bam

        I also tried the same command as a single line and I still get this error - "Error: cuffdiff requires at least 2 SAM files"

        Could someone please help me out with this ?

        Thanks,
        Aditi

        Comment

        • fanli
          Senior Member
          • Jul 2014
          • 197

          #5
          Can you paste your one line command? Did you remove the backslashes? I really don't understand the use of backslashes in shell commands

          Comment

          • GenoMax
            Senior Member
            • Feb 2008
            • 7142

            #6
            Originally posted by fanli View Post
            I really don't understand the use of backslashes in shell commands
            To break long command lines up into readable chunks. \ basically says to the shell I am not done with my command yet.

            Comment

            • fanli
              Senior Member
              • Jul 2014
              • 197

              #7
              I know what they do, but why use them when every text editor and terminal has word wrap anyways..?

              Comment

              • GenoMax
                Senior Member
                • Feb 2008
                • 7142

                #8
                Originally posted by aditisk View Post
                Hi everyone,

                I am also facing a similar issue. My command is as follows:

                cuffdiff -p 6 -o ./UM108_cuffdiff -u --compatible-hits-norm -M Homo_sapiens.GRCh37.75.gtf \
                61327_tophat.bam \
                61328_tophat.bam

                I also tried the same command as a single line and I still get this error - "Error: cuffdiff requires at least 2 SAM files"

                Could someone please help me out with this ?

                Thanks,
                Aditi
                You need to provide -L Control,Mutant (basically what you are trying to compare) --library-type (stranded/non-stranded lib) etc. as well.

                Comment

                • GenoMax
                  Senior Member
                  • Feb 2008
                  • 7142

                  #9
                  Originally posted by fanli View Post
                  I know what they do, but why use them when every text editor and terminal has word wrap anyways..?
                  This is speculation. Seqanswers.com post edit window is rather small and the command must have looked strange on screen. So instead of using [ CODE] command_here[ /CODE] tags @Aditi must have split the command up on multiple lines.
                  Last edited by GenoMax; 09-29-2016, 11:02 AM.

                  Comment

                  • aditisk
                    Member
                    • Aug 2015
                    • 12

                    #10
                    @GenoMax,

                    Thanks for your suggestions. I have tried using the -L and --library type before and I tried it again right now. It still doesn't work. I am getting the exact same error again.

                    Last week I was able to use cuffdiff on another data set of mouse samples successfully. In that case we had 3 replicates per condition so I used a comma separated list for all BAMs of one condition and another list for BAMs of the other condition. And it worked just fine. In this case, I don't have any replicates and for some reason cuffdiff is not able to identify that the 2 sample files are actually 1 per condition and not a case where I have forgotten to delimit a list of files for 1 condition with a comma.

                    Comment

                    • aditisk
                      Member
                      • Aug 2015
                      • 12

                      #11
                      Originally posted by fanli View Post
                      Can you paste your one line command? Did you remove the backslashes? I really don't understand the use of backslashes in shell commands
                      Here is the one line command:

                      cuffdiff -p 6 -o ./UM108_cuffdiff -u -compatible-hits-norm -M Homo_sapiens.GRCh37.75.gtf 61327_tophat.bam 61328_tophat.bam

                      I initially started off with the one line command but I got an error so I found some blog post that mentioned trying to use the slash so I tried that as well.

                      Either way I am still getting the same error.

                      Comment

                      • fanli
                        Senior Member
                        • Jul 2014
                        • 197

                        #12
                        Originally posted by aditisk View Post
                        Here is the one line command:

                        cuffdiff -p 6 -o ./UM108_cuffdiff -u -compatible-hits-norm -M Homo_sapiens.GRCh37.75.gtf 61327_tophat.bam 61328_tophat.bam

                        I initially started off with the one line command but I got an error so I found some blog post that mentioned trying to use the slash so I tried that as well.

                        Either way I am still getting the same error.
                        From the help page:
                        Code:
                         -M/--mask-file               ignore all alignment within transcripts in this file  [ default:   NULL ]
                        Perhaps you don't mean to pass the -M option?

                        Comment

                        • aditisk
                          Member
                          • Aug 2015
                          • 12

                          #13
                          Originally posted by fanli View Post
                          From the help page:
                          Code:
                           -M/--mask-file               ignore all alignment within transcripts in this file  [ default:   NULL ]
                          Perhaps you don't mean to pass the -M option?
                          I have tried using the command both with and without -M since I am interested to see the results either way. With or without the -M, I still get the same error

                          Comment

                          • dpryan
                            Devon Ryan
                            • Jul 2011
                            • 3478

                            #14
                            Code:
                             cuffdiff -p 6 -o UM108_cuffdiff -u -compatible-hits-norm Homo_sapiens.GRCh37.75.gtf 61327_tophat.bam 61328_tophat.bam

                            Comment

                            Latest Articles

                            Collapse

                            • SEQadmin2
                              New Genomics Technologies Take Aim at Long-Standing Limits
                              by SEQadmin2


                              Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                              We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                              ...
                              09-28-2026, 10:25 AM
                            • SEQadmin2
                              How Immunogenomics Decodes Immunity’s Genetic Blueprint
                              by SEQadmin2




                              The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.

                              This convergence of genetics, immunology, and computation...
                              09-01-2026, 05:41 AM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by SEQadmin2, Yesterday, 09:51 AM
                            0 responses
                            11 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 09-25-2026, 09:06 AM
                            0 responses
                            34 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 09-23-2026, 11:05 AM
                            0 responses
                            28 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 09-18-2026, 11:37 AM
                            1 response
                            48 views
                            0 reactions
                            Last Post pekgio
                            by pekgio
                             
                            Working...