feat: allow passing query name to map #85
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to pass a query name to the map function.
This has been discussed/proposed in #80 but that PR seems to have grown quite large and tries to multiple things.
For the sake of keeping pieces of work smaller, easier to review, and easier to determine where issues may be introduced, I thought I would put in this small one.
It does take a slightly different approach to #80 where Rob creates a new function
map_with_name
. My reasoning for altering the existingmap
function is that it mirrors the minimap2mm_map
function, which takes a query name.This will obviously require a minor version bump as it won't be backwards compatible, but as the project is still in the major version 0 phase that is valid semver.
Happy to discuss further.
PS. (as an aside) I think a future alteration to the
Mapping
API might also be to use&[u8]
(orVec<u8>
) for the target and query names. This avoids the heavy conversion to strings for every mapping call. It is also quite conventional with other bioinfo Rust libraries such as noodles and needletail which work in byte space and leave it to the user to convert to Strings if required.