Identifying discordantly mapped reads
How can I use samtools to identify discordantly paired reads or is it even possible? I can use awk to simply output reads which are mapped on different chromosomes, and also reads where the distance between the pairs is significantly larger than expected but is there a way to do this via samtools?
• 8,361 views
•
link
2 answers
There are different options:
- You can use
samtoolsand give as argument the following flag-F 1294. In this way you'll discard all reads having which are: read mapped in proper pair, read unmapped,mate unmapped,not primary alignment,read is PCR or optical duplicate. - As you've mentioned, you can use
awkto extract mates mapped on different chr. You should convert your bam to sam, and thenawk '($3!=$7 && $7!="=")'.
I would vote for the first approach, because it includes the distance between pairs issue.
• 0 views
•
link
using samjdk: http://lindenb.github.io/jvarkit/SamJdk.html
$ java -jar dist/samjdk.jar -e 'return record.getReadPairedFlag() && !record.getReadUnmappedFlag() && !record.getMateUnmappedFlag() && !record.getReferenceName().equals(record.getMateReferenceName());' in.bam
• 1 views
•
link
Log in to answer this question.
just filter out flags 3854 ( http://broadinstitute.github.io/picard/explain-flags.html ) ? (
)