This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Identify dovetail read-pairs from a bam/sam file

Hi, Is there a way to identify read pairs which are aligned as "dove-tail" by bowtie2? I've used the flag --dovetail while mapping with bowtie2.

alignment

1 answer

Using samjs: https://github.com/lindenb/jvarkit/wiki/SamJS

java -jar dist/samjs.jar -e 'record.getReadPairedFlag() && !record.getReadUnmappedFlag() && !record.getMateUnmappedFlag() && record.getReferenceName().equals(record.getMateReferenceName()) && record.getAlignmentStart()<= record.getMateAlignmentStart() && record.getMateAlignmentStart()<=record.getAlignmentEnd()'  input.bam

you might consider the strand of the read/mate too.

Log in to answer this question.