jguhlin / minimap2-rs

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

Add nm, cigar, cigar_str, cs, md fields to alignment #7

Closed eharr closed 1 year ago

eharr commented 1 year ago

Hi Joseph,

Thanks so much for creating this crate!

I was missing a few of the fields from the mappy interface so I thought I'd try to implement them. I'm a rust novice so any feedback would be appreciated.

I added the above fields based and also implemented the is_primary logic from mappy. Some notes:

  1. Mappy has a cigar which is a list of tuples which is then converted to a cigar_str. I've included both but that might not be necessary.
  2. For cigar_str, cs, md I've used the string without the SAM tag prefix as that's what mappy does, but I can add them back in if you think that's better.

I also added a test file from the minimap2 repo to test that the output was consistent, but that might be adding too much bloat.

Thanks again, Eoghan

jguhlin commented 1 year ago

Hey! This is great! May be a bit of time before I dig into it but really appreciate it!