Say I want to parse out all split reads. These are reads with a clipped position and a secondary mapping.
How do I identify these reads in samtools? Is there a flag to find reads that are split with a secondary mapping.
Once I have these reads, how I can I tell which chromosome they are mapped to?
Here's an example of what I'm looking for:
The blue read should have a clipped signal, I want to parse out these reads that have the alternate mapping position on the same chromosome.
Thanks!
It largely depends on the mapper. Most mappers won't produce such alignments.
That's true. We have bam files that were mapped using BWA-MEM to allow for split reads. We ran lumpy which requires these reads.
In that case: samtools view aln.bam|grep SA:Z:
That did not work
Then you are using a wrong version of bwa. Update to the latest.