Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • samtools view -f 4 inconsistency

    Hi,

    I want to select unmapped reads in my bam file generated by bwa. When I use samtools view -f 4, it also selects some reads with flag 141 which does not contain 4. I can see that those reads are not mapped, but isn't -f 4 option supposed to pick up only those reads that have 4 bit set?

  • #2
    4 in binary is 100, so '-f 4' will filter for any reads with the 3rd bit set to 1
    141 in binary is 10001101, whose 3rd bit *is* set to 1, so seeing it is the expected behaviour

    For more info on SAM flags, consider checking out these links and maybe a refresher on binary numerals.

    Comment


    • #3
      141=128+8+4+1

      So yes, that read was unmapped. Specifically, it was the second read of its pair, it was unmapped, and its mate was unmapped too, and it is in the .bam file in its forward direction.

      Comment


      • #4
        jujubix and swbarnes2,

        thanks for the explanation. It makes sense. For some reason I was doing the calculation in decimal.

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Recent Advances in Sequencing Analysis Tools
          by seqadmin


          The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
          05-06-2024, 07:48 AM
        • 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

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 05-14-2024, 07:03 AM
        0 responses
        20 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-10-2024, 06:35 AM
        0 responses
        44 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-09-2024, 02:46 PM
        0 responses
        54 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-07-2024, 06:57 AM
        0 responses
        42 views
        0 likes
        Last Post seqadmin  
        Working...
        X