I'm currently using Bowtie2 to map my reads to a small region of a genome to find what region it's in by collecting the unmapped pairs of the reads which have mapped.
I'm currently using samtools flags to get the reads I want:
---a--- ......... -------------
|------------------------gene----------------|
-------..............----b-----
What we want is
a: retain unmapped reads whose mate is on reverse strand (-f 36)
b: retain unmapped reads (-f 4) excluding reads whose mate is on reverse strand or unmapped (-F 40)
samtools view -Sb -f 36 sam > NtermBam
samtools view -Sb -f 4 -F 40 sam > CtermBam
Previously when mapping with BWA both of these commands would work and I would get an N terminus bam and a C terminus bam. However, when I map with Bowtie2 (because the mapping itself is better), I get no reads in the N terminus bam and all the reads go to the C terminus bam.
Does anyone know why this might be? I'm pretty sure the samtools commands are right because it works with BWA. I'm thinking it has something to do with Bowtie2, maybe not recording flags correctly?
I'm currently using samtools flags to get the reads I want:
---a--- ......... -------------
|------------------------gene----------------|
-------..............----b-----
What we want is
a: retain unmapped reads whose mate is on reverse strand (-f 36)
b: retain unmapped reads (-f 4) excluding reads whose mate is on reverse strand or unmapped (-F 40)
samtools view -Sb -f 36 sam > NtermBam
samtools view -Sb -f 4 -F 40 sam > CtermBam
Previously when mapping with BWA both of these commands would work and I would get an N terminus bam and a C terminus bam. However, when I map with Bowtie2 (because the mapping itself is better), I get no reads in the N terminus bam and all the reads go to the C terminus bam.
Does anyone know why this might be? I'm pretty sure the samtools commands are right because it works with BWA. I'm thinking it has something to do with Bowtie2, maybe not recording flags correctly?
Comment