Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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!

  • #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


    • #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


      • #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


        • #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


          • #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


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

              Comment


              • #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


                • #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


                  • #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


                    • #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


                      • #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


                        • #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


                          • #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

                            • seqadmin
                              Current Approaches to Protein Sequencing
                              by seqadmin


                              Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                              04-04-2024, 04:25 PM
                            • 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

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by seqadmin, 04-11-2024, 12:08 PM
                            0 responses
                            30 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 04-10-2024, 10:19 PM
                            0 responses
                            32 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 04-10-2024, 09:21 AM
                            0 responses
                            28 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 04-04-2024, 09:00 AM
                            0 responses
                            53 views
                            0 likes
                            Last Post seqadmin  
                            Working...
                            X