Hi Everyone,
I have been following a few great threads by fellow folks here. I am trying understand if someone here could kindly explain why using.
samtools view -b -f 0x2 accepted_hits.bam > mappedPairs.bam
is better than using
samtools view -b -F 4 accepted_hits.bam > mappedPairs.bam
I have always used the later command when extracting mapped reads in a bam file.
Extracting mapped reads based on a chromosomal region of interest:
samtools view -b -F 4 accepted_hits.bam Chr:position_x-position_y > mappedPairs.bam
samtools sort -n mappedPairs.bam sorted_mappedPairs.bam
bamToFastq -i sorted_mappedPairs.bam -fq forward.fastq -fq2 reverse.fastq
Going to run tests on the extracted fastq reads to see the region of interest.
Many thanks in advance.
I think this post will help: What Does The "Proper Pair" Bitwise Flag Mean In A Sam File?