-
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
Add ability to find canonical substitution of DNA #48
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple small things
src/canonical.rs
Outdated
|
||
impl<I: ExactSizeIterator<Item = Nucleotide>> ExactSizeIterator for ForwardCanonical<I> {} | ||
|
||
// Like an allocation-free variant of: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could maybe use some illustrative example code here? Took me a moment to realize what this meant.
@@ -338,6 +339,16 @@ impl<T: NucleotideLike> FromStr for DnaSequence<T> { | |||
} | |||
} | |||
|
|||
impl DnaSequence<Nucleotide> { | |||
/// Return canonical isomorphic DNA sequence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also maybe use some example code here as well, again just to illustrate. I tend to prefer having the docs on the method over the iterator type, since the method is mostly what library users interact with.
let canonical2 = canonical.canonical(); | ||
canonical2 == canonical | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to quickcheck LexicalMin
as well? Could compare it to the allocation version with Vec
as a sanity check.
Intent
Computes canonical substitution of DNA to support combinatorial hashing.
Changes
DnaSequenceStrict::canonical
convenience method.quickdna::canonical::{Canonical, ForwardCanonical}
iterators.canonical
benchmarks.