Hi,
On sam flags explained, the flag 1028 corresponds to "read unmapped" and "read is PCR or optical duplicate". https://broadinstitute.github.io/picard/explain-flags.html
If I run samtools view -F 1028 input.bam > output.bam
Will output.bam contain reads which are only "read unmapped" and "read is PCR or optical duplicate" or no reads that are "read unmapped" and "read is PCR or optical duplicate"?
Thanks!
Hi, @Junnna!
As @Najoshi has already answered this command won't output what you asked.
Be carefull with words "not"/"any"/"all" in -f and -F descriptions.
Check also -G option as it may be of interest.
-F INT Do not output alignments with any bits set in INT present in the FLAG field.
So this means that any read that has the bit set (i.e. has a check in explain flags) will NOT be output. Therefore, your command will not output any of the unmapped or duplicate marked reads, and will output everything else.
Hi, @Junnna! As @Najoshi has already answered this command won't output what you asked. Be carefull with words "not"/"any"/"all" in -f and -F descriptions. Check also -G option as it may be of interest.
Good luck!