Header Leaderboard Ad

Collapse

how to get reads with "mate mapped to a different chr"

Collapse

Announcement

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

  • how to get reads with "mate mapped to a different chr"

    In the output of
    Code:
    samtools flagstat input.bam
    There is these last two lines:

    HTML Code:
    xxx +0 with mate mapped to a different chr
    xxx +0 with mate mapped to a different chr (mapQ>=5)
    I'm wondering what's the FLAG for "mate mapped to a different chr"?

  • #2
    There is no flag; you compare "rname" with "rnext". If they are the same, or "rnext" is "=", and they are both mapped (0x1 set, 0x4 and 0x8 not set) then they are on the same sequence. They are mapped to different sequences if both are mapped but rnext is not "=" and not equal to rname.

    Comment


    • #3
      Originally posted by Brian Bushnell View Post
      There is no flag; you compare "rname" with "rnext". If they are the same, or "rnext" is "=", and they are both mapped (0x1 set, 0x4 and 0x8 not set) then they are on the same sequence.
      oh, i see. Thanks!

      Comment


      • #4
        Good question.

        Consult the Sam format documentation.

        https://samtools.github.io/hts-specs/SAMv1.pdf

        Section 1.4 contains the bitwise flag descriptions.

        Note that not all software properly sets these flags.

        I guess you'd check the 0x4 and 0x8 flags ( 0x4=segment unmapped, 0x8=segment unmapped). If both unmapped then check if field 3 (RNAME) is not same as field 7 (RNEXT) [and 8 field is not '*' and not '='] .

        There are various "FIXMATE" programs running around; you may wish to use.

        I'm not sure about 0x800 flag (not same as 0x8). "Chimeric" I'm guessing doesn't always mean same chromosome.
        Last edited by Richard Finney; 01-12-2015, 12:24 PM.

        Comment


        • #5
          Originally posted by Richard Finney View Post
          I'm not sure about 0x800 flag (not same as 0x8). "Chimeric" i'm guessing doesn't always mean same chromosome.
          I don't think the answer is fully defined for either chimeric or secondary alignments.

          Comment


          • #6
            Originally posted by Brian Bushnell View Post
            I don't think the answer is fully defined for either chimeric or secondary alignments.
            I'm actually pretty confused about what is "secondary alignment".. can you clarify it a little bit?

            Also, in the attached image, I don't understand how the entry in the second column equals to that in the first column? For example, 0x0001 and p are supposed to represent the same thing I guess? what's the encoding conversion rules here? And where is the string representation used? In BAM files?
            Attached Files

            Comment


            • #7
              I have not seen that string notation before ("p", "P", etc) and it's not part of the SAM specification as far as I know. Reads are supposed to have at most one primary alignment; if a read maps to multiple locations, it can have multiple secondary alignments (0x100 flag bit). But reads can also have multiple 0x800 "supplementary" alignments, a new feature of the sam format which is rather confusing.

              Comment


              • #8
                Originally posted by Brian Bushnell View Post
                I have not seen that string notation before ("p", "P", etc) and it's not part of the SAM specification as far as I know. Reads are supposed to have at most one primary alignment; if a read maps to multiple locations, it can have multiple secondary alignments (0x100 flag bit). But reads can also have multiple 0x800 "supplementary" alignments, a new feature of the sam format which is rather confusing.
                Yeah, the documentation is very limited and confusing. I have to search online for a few tutorials to get an OK understanding of bitwise FLAG..

                I'm confused.. what does supplementary alignment mean?

                Comment


                • #9
                  In practice, if you run bwa, it means a chimeric alignment, in which there are multiple local alignments that are not very close to each other. I am not aware of any other aligners that generate it.

                  Comment


                  • #10
                    Originally posted by Brian Bushnell View Post
                    In practice, if you run bwa, it means a chimeric alignment, in which there are multiple local alignments that are not very close to each other. I am not aware of any other aligners that generate it.
                    I see. Thanks.

                    Comment


                    • #11
                      Originally posted by Brian Bushnell View Post
                      I have not seen that string notation before ("p", "P", etc) and it's not part of the SAM specification as far as I know.
                      It's been deprecated. Back in the day, there was a multicharacter version of the FLAG field available from samtools. That was done away with after the conversion to htslib (I'm pretty sure it was still there in 0.1.19). The only thing I've ever seen use those is BS-Seeker2, in fact.

                      Comment


                      • #12
                        Originally posted by dpryan View Post
                        It's been deprecated. Back in the day, there was a multicharacter version of the FLAG field available from samtools. That was done away with after the conversion to htslib (I'm pretty sure it was still there in 0.1.19). The only thing I've ever seen use those is BS-Seeker2, in fact.
                        I see. Good to know!

                        Comment


                        • #13
                          one way to get it

                          see https://www.biostars.org/p/17575/#327644
                          http://www.bits.vib.be/index.php

                          Comment

                          Latest Articles

                          Collapse

                          • seqadmin
                            Targeted Sequencing: Choosing Between Hybridization Capture and Amplicon Sequencing
                            by seqadmin




                            Targeted sequencing is an effective way to sequence and analyze specific genomic regions of interest. This method enables researchers to focus their efforts on their desired targets, as opposed to other methods like whole genome sequencing that involve the sequencing of total DNA. Utilizing targeted sequencing is an attractive option for many researchers because it is often faster, more cost-effective, and only generates applicable data. While there are many approaches...
                            03-10-2023, 05:31 AM
                          • seqadmin
                            Expert Advice on Automating Your Library Preparations
                            by seqadmin



                            Using automation to prepare sequencing libraries isn’t a new concept, and most researchers are aware that there are numerous benefits to automating this process. However, many labs are still hesitant to switch to automation and often believe that it’s not suitable for their lab. To combat these concerns, we’ll cover some of the key advantages, review the most important considerations, and get real-world advice from automation experts to remove any lingering anxieties....
                            02-21-2023, 02:14 PM

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by seqadmin, 03-17-2023, 12:32 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 03-15-2023, 12:42 PM
                          0 responses
                          17 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 03-09-2023, 10:17 AM
                          0 responses
                          66 views
                          1 like
                          Last Post seqadmin  
                          Started by seqadmin, 03-03-2023, 12:03 PM
                          0 responses
                          64 views
                          0 likes
                          Last Post seqadmin  
                          Working...
                          X