Hello,
I’m trying to split BAM files with paired-end reads into forward and reverse strands. I know samtools view -F 16
and samtools view -f 16
separates into forward and reverse strands, but I’ve read in some forums that it doesn’t deal well with paired-end reads. What other methods would people recommend for paired-end reads?
Thank you for your help!
Have a look at this great tutorial: How To Separate Illumina Based Strand Specific Rna-Seq Alignments By Strand
Thank you! I will look into his approach.
I've read the tutorial you sent me and I have a question that you might know the answer to. I'm trying to understand how the SAM flags work in the script from the tutorial. My original SAM file has flags: 99, 147, 163, and 83, but this script uses flags: 128, 80, 144, and 64. Do you know the difference between these flags? Would the split.sh script still separate my BAM file into forward and reverse strands with the flags it lists or should I edit the script to reflect my flags (99, 147, 163, 83)? Thank you for your help!!
to see how flag works: https://broadinstitute.github.io/picard/explain-flags.html
Basically, you do not need to change the flags because they are not exclusive. For instance, if you ask for flag 64, it will also includes flag 83.
Thank you for the explanation!! I appreciate it!