jguhlin / minimap2-rs

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

Feature Request: Provide access to alignment score #69

Closed rob-p closed 2 weeks ago

rob-p commented 4 weeks ago

If the user is building an Aligner with the cigar option, it will be very useful to have access to the computed alignment score (what would arise as the AS tag if we were producing a SAM file with minimap2). Would it be easy to add support for accessing this information? I believe it is computed and stored in the ksw result which is exposed in the sys crate.

jguhlin commented 4 weeks ago

And I see this just now. Its in the new branch.

On Fri, 16 Aug 2024, 1:33 pm Rob Patro, @.***> wrote:

If the user is building an Aligner with the cigar option, it will be very useful to have access to the computed alignment score (what would arise as the AS tag if we were producing a SAM file with minimap2). Would it be easy to add support for accessing this information? I believe it is computed and stored in the ksw result which is exposed in the sys crate.

— Reply to this email directly, view it on GitHub https://github.com/jguhlin/minimap2-rs/issues/69, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOA2CEVYHCYN62SGILMG5TZRVJGPAVCNFSM6AAAAABMTGGNPCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3DSMRVG42DMMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rob-p commented 4 weeks ago

Ok, dumb question --- what invocation should I make in my Cargo.toml if I want to have both this branch of minimap2-rs as well as minimap2-sys in my project. Right now I have:

minimap2 = { version = "0.1.20", features = [
  "simde",
], git = "https://github.com/jguhlin/minimap2-rs.git", branch = "alignment-score" }
minimap2-sys = { version = "0.1.19", features = ["simde"] }

but I get the error:

error: failed to select a version for `minimap2-sys`.
    ... required by package `minimap2 v0.1.20+minimap2.2.28 (https://github.com/jguhlin/minimap2-rs.git?branch=alignment-score#ab0680c0)`
    ... which satisfies git dependency `minimap2` of package `oarfish v0.5.1 (/mnt/scratch1/rob/lrquant/oarfish)`
versions that meet the requirements `*` are: 0.1.19+minimap2.2.28

the package `minimap2-sys` links to the native library `libminimap2`, but it conflicts with a previous package which links to `libminimap2` as well:
package `minimap2-sys v0.1.19+minimap2.2.28`
    ... which satisfies dependency `minimap2-sys = "^0.1.19"` of package `oarfish v0.5.1 (/mnt/scratch1/rob/lrquant/oarfish)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies
 so that only one package uses the `links = "libminimap2"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `minimap2-sys` which could resolve this conflict
jguhlin commented 4 weeks ago

@rob-p I've just set the Cargo.toml to be a specific version, run cargo update and you should be good to go.

rob-p commented 4 weeks ago

Bravo! Thanks :).

jguhlin commented 3 weeks ago

This is merged into the main branch. Won't push a release out until we've added all the new features and handled the bugs you dig up though!

rob-p commented 3 weeks ago

Thanks @jguhlin; it seems to be working great for our purposes!

rob-p commented 2 weeks ago

This is working great and we can replicate the precise results of command-line minimap2 on non-trivial datasets now, so I’m closing this issue.