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

Speed up from O(n^2) iteration over all left/right primer hits in OffTargetDetector._to_amplicons #94

Open
ameynert opened this issue Nov 18, 2024 · 0 comments

Comments

@ameynert
Copy link

OffTargetDetector._to_amplicons uses itertools.product over the left and right primer hits and evaluates each of them in a loop to identify valid left/right hit combinations for the pair.

Suggestion:

  1. Get hits by primer sequence from mappings_of
  2. Split into left and right hits
  3. Group hits by refname
  4. For each refname, split into left +, right -, left -, right+ hits
  5. Build amplicons from left + and right - (amplicon strand +), left - and right + (amplicon strand -)

Building amplicons - dealing with only positive & negative in correct orientation and known to be on the same reference, with known amplicon strand

  1. itertools.product over positive & negative primer hits
  2. Check product size against min/max amplicon size range
  3. If in range, return the product hit as positive start to negative end with the known reference name and amplicon strand
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

No branches or pull requests

1 participant