Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alisrpp
    Member
    • Dec 2010
    • 40

    #1

    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.
  • TiborNagy
    Senior Member
    • Mar 2010
    • 329

    #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

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #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

      • alisrpp
        Member
        • Dec 2010
        • 40

        #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

        • TiborNagy
          Senior Member
          • Mar 2010
          • 329

          #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

          • alisrpp
            Member
            • Dec 2010
            • 40

            #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

            • SEQadmin2
              Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
              by SEQadmin2



              Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

              Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
              ...
              10-14-2026, 09:55 AM
            • 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

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 10-22-2026, 11:13 AM
            0 responses
            23 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-22-2026, 10:48 AM
            0 responses
            20 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-15-2026, 10:52 AM
            0 responses
            36 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-14-2026, 05:39 AM
            0 responses
            42 views
            0 reactions
            Last Post SEQadmin2  
            Working...