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
              The Factors Reshaping Genome Assembly
              by SEQadmin2



              When the Human Genome Project declared the human genome finished in 2003, portions of the sequence were still missing, including many of its most repetitive and structurally complex regions.1 Still, for the next two decades, researchers analyzed their sequencing data against the single linear reference that came out of this effort. Released in 2013 as GRCh38, that reference has powered countless discoveries, but it has gaps and cannot capture the genetic diversity of the world’s...
              Today, 07:04 AM
            • SEQadmin2
              16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
              by SEQadmin2





              NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
              10-30-2026, 06:46 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, Yesterday, 11:11 AM
            0 responses
            14 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-17-2026, 06:27 AM
            0 responses
            39 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-12-2026, 07:59 AM
            0 responses
            55 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-05-2026, 09:25 AM
            0 responses
            62 views
            0 reactions
            Last Post SEQadmin2  
            Working...