Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Filtering a BAM by chastity flag using samtools

    Dear all

    I have a BAM file from Illumina whole genome data and I would like to filter out all the reads that fail Illumina's chastity filtering. From my understanding that is the flag 0x0200 (please correct me if you know differently). So to remove those reads and retain all other information in the BAM file can I just use samtools like this:
    Code:
    samtools view -h -b -F 0x0200 input.bam > output.bam
    Many thanks

  • #2
    The flag will only be thrown if the software that made the sam knows somehow that the read is poor quality. For Illumina reads, the data on passing filters is in the name of the read in the original fastqs (separated by a space from the rest of the name). If you just take those reads, and align them with, say, bwa, bwa won't read the name and figure out that the read didn't pass filters. (in fact, it might truncate after the space, which will erase the information from the name).

    So don't blindly trust the flag. You have to understand how the flagging was made, and if the software that made the flag is even paying attention to that particular characteristic. So if you try the above command, and nothing gets filtered out, you can't assume from that that 100% of your reads passed filters, beucase its more blikely that you sam-making software wasn't trying to track that at all.

    Comment


    • #3
      Many thanks for the reply. There are definitely reads that have the flag 0x200. I have contacted Illumina (they generated the data) to ensure that I have got the right flag etc.
      Thanks

      Comment


      • #4
        Question about samtools view -r

        Hi,
        I met a problem when using samtools command view -r.
        -r STR Only output reads in read group STR [null]

        Could any one tell me how to use -r in samtools view? I think it would be better have an example to illustrate that.

        Thanks a lot!

        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...
          Yesterday, 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-11-2024, 12:08 PM
        0 responses
        58 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        53 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        45 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-04-2024, 09:00 AM
        0 responses
        55 views
        0 likes
        Last Post seqadmin  
        Working...
        X