Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • DrD2009
    Member
    • Oct 2009
    • 88

    Sorting SAM output from Bowtie

    Hello everyone,

    I have an easy one for you today. I have SAM output created from Bowtie that I want to use with Cufflinks, but Cufflinks only accepts SAM files that have been sorted. I've tried using SAM tools to sort, but it seems like I have to convert the SAM into a BAM in order to be able to sort it. Is that correct? Then won't I have to convert it back to SAM in order for use with Cufflinks?


    Thanks again,
    Brandon
  • RockChalkJayhawk
    Senior Member
    • Mar 2009
    • 192

    #2
    The cufflinks manual suggests:

    sort -k 3,3 -k 4,4n hits.sam > hits.sam.sorted

    Will this work?

    Originally posted by DrD2009 View Post
    Hello everyone,

    I have an easy one for you today. I have SAM output created from Bowtie that I want to use with Cufflinks, but Cufflinks only accepts SAM files that have been sorted. I've tried using SAM tools to sort, but it seems like I have to convert the SAM into a BAM in order to be able to sort it. Is that correct? Then won't I have to convert it back to SAM in order for use with Cufflinks?


    Thanks again,
    Brandon

    Comment

    • genbio64
      Member
      • Dec 2009
      • 42

      #3
      You could also sort using samtools.

      Comment

      • DrD2009
        Member
        • Oct 2009
        • 88

        #4
        @RockChalkJayhawk
        Thanks. That seems to work although I have no idea what that code represents.

        @genbio64
        Do I have to convert the SAM into a BAM to sort? That's what samtools seems to want.

        Comment

        • RockChalkJayhawk
          Senior Member
          • Mar 2009
          • 192

          #5
          Originally posted by DrD2009 View Post
          @RockChalkJayhawk
          Thanks. That seems to work although I have no idea what that code represents.

          @genbio64
          Do I have to convert the SAM into a BAM to sort? That's what samtools seems to want.
          The code just means to sort on column 3, then by column 4(numerically) of the hits.sam file and print to hits.sam.sorted

          Comment

          • DrD2009
            Member
            • Oct 2009
            • 88

            #6
            Ah. Well it worked perfectly. I guess I don't have to deal with samtools for now afterall.

            Thanks again.

            Comment

            • shoncho
              Junior Member
              • Feb 2010
              • 4

              #7
              If I am not using tophat but want to use some other resource, such as Bowtie, is there a way to sort the sequences into useable size files without using SAM tools?

              - Shoncho

              Comment

              • rgregor
                Member
                • Jun 2010
                • 11

                #8
                Cufflinks
                Error: this SAM file doesn't appear to be correctly sorted!
                current hit is at scaffold_737:1311, last one was at scaffold_736:2605

                But "scaffold_736" is before "scaffold_737" and the sorting is correct? Is this a bug?

                best regards,
                Gregor

                Comment

                • krobison
                  Senior Member
                  • Nov 2007
                  • 734

                  #9
                  Yes, you must convert from sam to bam to sort. The current cufflinks can use BAM

                  To sort your sam

                  # will create myfile.sorted.bam
                  samtools view -uS myfile.sam | samtools sort - myfile.sorted

                  Comment

                  • adarob
                    Member
                    • Jul 2010
                    • 71

                    #10
                    @rgregor,

                    Are you using a reference GTF? If so, it must be sorted in the same order OR your SAM file must include a header that lists the scaffolds in the correct order.

                    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, 07-13-2026, 10:26 AM
                    0 responses
                    22 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-09-2026, 10:04 AM
                    0 responses
                    32 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-08-2026, 10:08 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-07-2026, 11:05 AM
                    0 responses
                    34 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...