This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Soft Clipped read 3' end position

Note: clarifying my question.

How can I get the hard clipped 3' end of the read position where there is soft clip at either end of the read? The getUnclippedEnd() in htsjdk gives you the position of the 3' end of the read including the soft-clipped bases. Is there a function like this to get the 3' read end positions excluding soft clipped bases? I believe I can look a the CIGAR string and do the math, just asking if there is any function available.

----------------------------SSS>

Any htsjdk function can find the position at the start of the Softlips in the above example?

Thanks.

bam htsjdk java

1 answer

Is there a function like this to get the 3' read end positions excluding soft clipped bases?

record.getAlignmentEnd()

How can I get the hard clipped 3' end of the read position where there is soft clip at either end of the read?

I ended up writing a SAMRecordUtil class for SAMRecord operations I used frequently.

https://github.com/PapenfussLab/gridss/blob/36c5c218598071e07ca43fbf15ec50c088317373/src/main/java/au/edu/wehi/idsv/sam/SAMRecordUtil.java#L123

record.getAlignmentEnd() + SAMRecordUtil.getEndClipLength(record)

Log in to answer this question.