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

PhredNtHash class #108

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

PhredNtHash class #108

wants to merge 6 commits into from

Conversation

jwcodee
Copy link
Member

@jwcodee jwcodee commented Jul 14, 2023

Added a new PhredNtHash that skip k-mers with any base with a lower quality than a user-specified Phred quality score.

Once the code change is approved, I will generate the docs, wrappers and python tests.

* @param seq_len Length of `seq`.
* @param hash_num Number of hashes to compute.
* @param k Length of k-mer.
* @param phred_min Minimum Phred score for a base to be included in the hash.
Copy link
Member

Choose a reason for hiding this comment

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

I think the explanation for phred_min needs clarification. I thought that if the Phred score for a base is less than this threshold, the k-mer will be ignored, not that specific base (unlike spaced seeds where bases are ignored).

/**
* NtHash with Phred score filtering.
*/
class PhredNtHash : private NtHash
Copy link
Member

Choose a reason for hiding this comment

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

An alternative would be to use : public NtHash and hide unused methods with using, e.g.

private:
  using NtHash::peek;

This way, there'll be no need to reimplement NtHash's public methods like get_pos etc.

Source: https://www.learncpp.com/cpp-tutorial/hiding-inherited-functionality/

uint64_t get_reverse_hash() const { return NtHash::get_reverse_hash(); }

private:
const char* qual_seq;
Copy link
Member

Choose a reason for hiding this comment

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

Let's prefer to use a shared_ptr or an std::string_view for qual_seq here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants