-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Feat/hash algs #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
This is still WIP, but I have decided to upgrade on this incrementally to keep PRs reviewable ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Draft for hash algorithms
This PR adds different hash algorithms to the
sketch
command. This includes:xxhash
,ahash
and legacymurmur3
.Ahash
uses the ahash fallback algorithm and is only suitable for k < 32 since it internaly relies on au64
bit-kmer representation. The raw hashing performance of ahash is 10-30x faster compared to existing hashing algorithms [0.3ns vs 3-8ns per iteration!]The PR will be merged as soon as all new methods are sufficiently tested (and documented).
Caveat: This currently needs rust nightly to build properly, the final release will try to remove this constraint.Changes
sketch
Kolmogorov–Smirnov
test to test against equal distributionSourmash outputs
You can use jam-rs to create sourmash compatible outputs, a basic example looks like this:
$ jam sketch <INPUT> -o <OUTPUT> -k 50 --fscale <SCALE> --format sourmash --algorithm [default, ahash, xxhash, murmur3]
Please be aware that this will produce differing results for k < 32 if you compare the output to sourmash generated outputs, since this internally uses a bit-kmer encoding before hashing instead of regular ASCII encoding.
default
algorithms meansahash
for k < 32 andxxhash
for larger kmersfscale
is the compatible parameter to sourmashsscale
So:
$ sourmash sketch dna -p k=50,scaled=1000 <INPUT> -o <OUTPUT>
and
$ jam sketch <INPUT> --fscale 1000 -k 50 --format sourmash --algorithm murmur3 -o <OUTPUT>
will produce similar results.
Feedback
Please feel free to give feedback for additional updates / changes. This is only the first step to improve sketching functionality the improvement of search especially for smaller fragmented sequences in larger sets will come next.