Closed wdecoster closed 1 year ago
Hey! Thanks for your interest ))
This looks very interesting. It appears a step is missing in the instructions to get started, probably cloning the repository?
Right, let me explicitly add that.
Additionally, I was wondering if it is possible to describe some examples of how to use the library within other rust projects, rather than as a standalone aligner.
Currently this is more of a research project than an end-user tool, but it's great you want to try it out. I don't expose a proper library interface currently, but it shouldn't be hard to make a small wrapper around the most important functions. I'll get back to you somewhere next week.
The plan is to make the API look like this:
let params = Params {
algorithm: AlgorithmsArgs,
heuristic: HeuristicArgs,
}
let a = b"ACTG";
let b = b"ACGT";
let (cost, cigar) = align(a, b, params);
I'd simply reuse the algorithm and heuristic arguments from the command line interface here, and mark those structs as repr(C)
. (Or actually that may not be possible given the Option
s, but I can make equivalent C types.)
I could also add the visualizer arguments so that you can directly visualize things from the C-code, in case you're building with the sdl2
flag.
Is it common to have both a Rust and C api existing next to each other? I need to figure out how to do that cleanly. Either by using separate sub-libraries rust::
and c::
, or by pre/suffixing all the c
functions.
I don't know about API design, and even less about C :)
Allright, this is finally done :tada:
The main Rust entrypoint is astarpa::astarpa
.
I've added a C-wrapper based on block aligner at astarpa-c
Hi,
This looks very interesting. It appears a step is missing in the instructions to get started, probably cloning the repository?
Additionally, I was wondering if it is possible to describe some examples of how to use the library within other rust projects, rather than as a standalone aligner.
Thanks, Wouter