jguhlin / minimap2-rs

Rust bindings to minimap2 library
Other
60 stars 13 forks source link

Bug: "S" missing in softclipped CIGAR strings #73

Closed Sam-Sims closed 3 weeks ago

Sam-Sims commented 3 weeks ago

I have some cases where it seems like the CIGAR string is missing an "S" after the number of bases that are softclipped.

For example using this crate I have the following string: cigar_str: Some("311232M9D10468M6D220M3D200M3D811M3D5351M9D1363M26D105MS2S")

Using minimap2 I get the following: 3S11232M9D10468M6D220M3D200M3D811M3D5351M9D1363M26D105M2S

It seems to me that the first occurrence of S in the CIGAR isnt included, which ends up concatenating into the next so what should be 3S11232M becomes 311232M.

My aligner:

let aligner = Aligner::builder()
        .asm20()
        .with_cigar()
        .with_sam_hit_only()
        .with_index(&args.reference, None)

I am using version 0.1.20+minimap2.2.28

Let me know if more info is needed Thanks