-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merge Primer*Weights into Primer3Parameters, remove Primer3Input #112
Conversation
prymer/primer3/primer3.py
Outdated
): # if the right primer has too many dinucleotide bases, fail it | ||
dinuc_pair_failures.append(primer_pair.right_primer) | ||
valid = False | ||
if valid: # if neither failed, append the pair to a list of valid designs | ||
valid_primer_pair_designs.append(primer_pair) | ||
return valid_primer_pair_designs, dinuc_pair_failures | ||
|
||
def design(self, design_input: Primer3Input) -> Primer3Result: # noqa: C901 | ||
def design(self, design_input: Primer3Parameters) -> Primer3Result: # noqa: C901 |
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.
I think this would need to take:
amplicon_parameters: AmpliconParameters | None, probe_parameter: ProbeParameters | None
What you have works for the current set of use cases, but one primer3 task we haven't implemented yet supports designing primer pairs and probes concurrently, and then you need both sets of parameters.
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.
I leave it for now, and we can decide later if we want to have two parameters to design
, or to create a third parameters class:
class AmpliconAndProbeParameters(Primer3Parameters):
amplicon_params: AmpliconParams
probe_params: ProbeParams
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #112 +/- ##
==========================================
- Coverage 97.37% 96.95% -0.42%
==========================================
Files 20 18 -2
Lines 1635 1575 -60
Branches 188 184 -4
==========================================
- Hits 1592 1527 -65
- Misses 24 27 +3
- Partials 19 21 +2 ☔ View full report in Codecov by Sentry. |
@@ -731,29 +754,3 @@ def _check_design_results(design_input: Primer3Input, design_results: dict[str, | |||
count: int = int(maybe_count) | |||
|
|||
return count | |||
|
|||
|
|||
def _has_acceptable_dinuc_run(design_input: Primer3Input, oligo_design: Oligo) -> bool: |
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.
I inlined this
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.
Some nit-picking on naming but happy to merge once that's addressed!
Primer*Weights
classes into their corresponding amplicon and probe parameter classes (reduces 4 classes to two). The attributes have the_wt
suffix in their name. Theprimer3.primer3.primer3_weights
module is gone.Primer3Input
functionality intoPrimer3
directly.primer3.primer3.primer3_input
is now gone.WeightRange
for the weights when a value is out of range (either less than, or greater than). Could use a better name?Primer3.design
now explicitly takes in the design task and target, in addition to the params. It checks to make sure that the task (e.g. design left primers) matches the params (e.g. amplicons).Primer3Task
(remove methods no longer used)