As I understand it, FLAG 0 means a read is mapped to the forward strand and FLAG 16 for reverse strand.
If I have single-end reads and I want to get all the uniquely mapped reads. Could I just do something like this:
samtools view bamfile.bam | awk '$2 == 0 || $2 == 16'
I have two additional questions that I'm a bit confused about:
Does FLAG 0 and 16 or any other FLAG values imply uniqueness of mapping?
Can I use samtools only with -F or -f to get alignment records with FLAG of either 0 or 16?