This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to selectively turn soft-clipped bases to hard-clipped bases based on part of the sequence?

Hey,

Is there an easy way to convert soft-clipped bases to hard-clipped bases, based on a small barcode sequence that precedes the clipped bases..?

i.e. if the barcode would be: ACGTA, we'd like this,

ACAGTACA ACGTA ACCAGTAAACAGTAGACATGA with CIGAR 8S26M to be converted to 8H26M

but this:

ACAGTACA TCGTA ACCAGTAAACAGTAGACATGA with CIGAR 8S26M to remain unchanged.

Could this be done with a script that just opens a BAM, searches the CIGAR + SEQ columns for the requirements and make the change? Would just changing the CIGAR be enough, or do I need to delete the hard-clipped bases fromt he SEQ as well (For visualization in IGV, where I don't want to see the hard-clipped bases)?

Or is there already a tool out there that could really make my life a lot easier?

Cheers!

sequencing bam clipping

0 answers

No answers yet.

Log in to answer this question.