This is a test version of Biostars. For the public version, visit https://www.biostars.org.
unmapped reads

How to remove unmapped reads from bam file?

unmapped reads

1 answer

samtools view -b -F 4 in.bam > out.bam

The -b outputs in bam format, and the -F 4 excludes all reads with the "read unmapped" flag set.

Log in to answer this question.