Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • How to filter a SAM/BAM file by bp

    Hi community,

    I want to filter my SAM/BAM files to just keep my transcripts above 1000bp. What I am doing now is to convert my SAM/BAM files into fasta and then filter them but then I have problems to run RSEM due to the input file is a SAM file and I couldn't find how to convert fasta into SAM.

    Anyone???

    Thanks.

  • #2
    It is not clear how do you filter your SAM file. If one record in your SAM file is a transcript, then you can filter by the length of the 10th column.

    Comment


    • #3
      SAM files contain more information than fasta files, so you can't convert back.

      I don't quite understand what you are trying to do. Are you trying to get rid of reads that align to shorter transcripts?

      Comment


      • #4
        Originally posted by swbarnes2 View Post
        SAM files contain more information than fasta files, so you can't convert back.

        I don't quite understand what you are trying to do. Are you trying to get rid of reads that align to shorter transcripts?
        Hi swbarnes2,

        What I am trying to do is to perform some differential gene expression analyses with DESeq2 just using those transcripts above 1000bp. In order to do that I need to filter the SAM/BAM files that I got as an output file from Bowtie. They look like that:

        Code:
        @SQ	SN:comp59_c0_seq1	LN:324
        @SQ	SN:comp77_c0_seq1	LN:318
        @SQ	SN:comp113_c1_seq1	LN:327
        @SQ	SN:comp135_c0_seq1	LN:312
        @SQ	SN:comp142_c0_seq1	LN:350
        @SQ	SN:comp142_c0_seq2	LN:411
        @SQ	SN:comp145_c0_seq1	LN:302
        @SQ	SN:comp168_c0_seq2	LN:301
        @SQ	SN:comp191_c0_seq3	LN:639
        @SQ	SN:comp197_c0_seq1	LN:412
        My next step is going to be to filter them by length and just keep the transcripts with more than 1000bp in length. Then use this filetered files as an input for RSEM and continue with DESeq2.

        My problem is that I don't know how to filter a SAM/BAM file by length.

        Maybe a better/easier approach would be to repeat my Bowtie alignments but this time using as a reference transcriptome a filtered fasta file just containing transcripts above 1000bp and then continue with RSEM and DESeq2 as before???

        Thanks.
        Last edited by alisrpp; 01-16-2014, 03:41 PM. Reason: I wanted to add more information.

        Comment


        • #5
          What you paste here is the references of the alignment. You do not need to convert the SAM file to Fasta. What you need is remove short transcripts before the Bowtie alignment.

          Comment


          • #6
            Originally posted by TiborNagy View Post
            What you paste here is the references of the alignment. You do not need to convert the SAM file to Fasta. What you need is remove short transcripts before the Bowtie alignment.
            And how can I do that?

            Comment

            Latest Articles

            Collapse

            • 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
            • seqadmin
              Techniques and Challenges in Conservation Genomics
              by seqadmin



              The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

              Avian Conservation
              Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
              03-08-2024, 10:41 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Yesterday, 06:37 PM
            0 responses
            7 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Yesterday, 06:07 PM
            0 responses
            7 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 03-22-2024, 10:03 AM
            0 responses
            49 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 03-21-2024, 07:32 AM
            0 responses
            66 views
            0 likes
            Last Post seqadmin  
            Working...
            X