Filter Reads Where Both A Read And Its Pair Is Unmapped.
1
0
Entering edit mode
13.0 years ago
Linda ▴ 160

I have a bam file with all reads. I would like to filter out reads where both the read and its mate are unaligned. If either of them is aligned, I would like to keep both. Would

samtools view -F 12 file.bam

work?

Thanks,

samtools next-gen sequencing mapping • 2.6k views
ADD COMMENT
3
Entering edit mode
13.0 years ago
Leszek 4.2k

yes,

[?]

will throw away only those reads that are unmapped and their pair is unmapped as well.

ADD COMMENT
0
Entering edit mode

I wonder of how the assumption of a mate's existence work - say if a read unmapped but the mate is missing - Is that considered as unmapped?

ADD REPLY
0
Entering edit mode

To be honest, I don't know. you could specify -f 1 to take into account only paired reads. have a look here.

ADD REPLY
0
Entering edit mode

mate missing? it might not be possible unless paired reads are unequal?

ADD REPLY

Login before adding your answer.

Traffic: 2473 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