This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bwa Bwasw: How To Print Only The Reads Aligned With The Reference Sequence

Hi,

BWA usually reports one line for each read even when the read don't mapped the reference sequence.

There are some way to print in the sam file only the alignment when the read are aligned with the reference sequence?

Thanks in advance

Cris

bwa alignment

1 answer

samtools view -F 4 your.bam

This is directly from the manual of Samtools. I recommend reading all the options. It tried to avoid it, but really knowing Samtools is worth the time!

Log in to answer this question.