Get all unmapped read and mate in bam
1
0
Entering edit mode
3.1 years ago
vinaykusuma ▴ 10

Hello,

I have a .bam file and i am trying to extract all combinations of unmapped read and its mate from it.

One type is unmapped read and its unmapped mate which i extract using,

samtools view -bh -f 12

where, read is unmapped and mate is unmapped

samtools view -bh -f 8 -F 4

where, read is mapped and mate is unmapped

samtools view -bh -f 4 -F 8

I would like to know if i'm doing it right? or am i missing something.

Thank you.

aligner genomics dna • 1.1k views
ADD COMMENT
3
Entering edit mode
3.1 years ago

All looks good, and you can check that with samtools flags:

samtools flags 12
0xc     12      UNMAP,MUNMAP

samtools flags 8
0x8     8       MUNMAP

samtools flags 4
0x4     4       UNMAP

then as you show for flags:

  -f INT   only include reads with all  of the FLAGs in INT present [0]
  -F INT   only include reads with none of the FLAGS in INT present [0]

the only comment I have is that when you produce BAM files the -h flag is not needed.

ADD COMMENT

Login before adding your answer.

Traffic: 1661 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6