Skip to content
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

Removing kmer records #28

Merged
merged 4 commits into from
Sep 18, 2024
Merged

Removing kmer records #28

merged 4 commits into from
Sep 18, 2024

Conversation

Adamtaranto
Copy link
Collaborator

Add methods for removing specific kmers and for thresholding on counts.

  • drop(): Remove record from count table by kmer.
  • drop_hash(): Remove record from table by hash.
  • mincut(): Remove all records with counts less than x.
  • maxcut(): Remove all records with counts greater than x.

Closes #18
Closes #19

@Adamtaranto Adamtaranto requested a review from ctb September 14, 2024 15:47
@Adamtaranto Adamtaranto added the enhancement New feature or request label Sep 14, 2024
src/lib.rs Outdated
))
} else {
// Compute the hash of the k-mer using the same method used for counting
let hashval = self.hash_kmer(kmer).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can replace the if/else with just

let hashval = self.hash_kmer(kmer)?;

which will forward the Err up the call stack. (I know I didn't do that elsewhere, not sure why ;)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Done.

Copy link
Contributor

@ctb ctb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@Adamtaranto Adamtaranto merged commit 75e6951 into main Sep 18, 2024
13 checks passed
@Adamtaranto Adamtaranto deleted the dev_remove_kmers branch September 18, 2024 02:10
@ctb ctb mentioned this pull request Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove records by kmer or hash Add Count Thresholding
2 participants