pysam-developers / pysam

Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
https://pysam.readthedocs.io/en/latest/
MIT License
773 stars 274 forks source link

Feature skip softclip #1293

Open DrYak opened 2 months ago

DrYak commented 2 months ago

This pull request addresses issue #1292.

It introduces a new option to pysam.AlignedSegment.get_aligned_pairs: skip_soft_clipping Soft clipping are discarded (similarly to what happens to them with the matches_only), but keeps all other features (matches, inserts, deletions, skip and padding).

I've expanded the test to cover the modified line 2052, making sure that soft-clippings are discarded, whereas inserts and padding remain unaffected by the new option.