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

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, Today, 10:09 AM
                    0 responses
                    8 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, Yesterday, 08:59 AM
                    0 responses
                    14 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-02-2026, 12:03 PM
                    0 responses
                    22 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-02-2026, 11:40 AM
                    0 responses
                    19 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...