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
              Essential Discoveries and Tools in Epitranscriptomics
              by seqadmin




              The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
              04-22-2024, 07:01 AM
            • seqadmin
              Current Approaches to Protein Sequencing
              by seqadmin


              Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
              04-04-2024, 04:25 PM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, 04-25-2024, 11:49 AM
            0 responses
            15 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-24-2024, 08:47 AM
            0 responses
            16 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-11-2024, 12:08 PM
            0 responses
            62 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-10-2024, 10:19 PM
            0 responses
            60 views
            0 likes
            Last Post seqadmin  
            Working...
            X