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

feat: add ProbeParameters() to encapsulate settings for PickHybProbeOnly Primer3Task #35

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

emmcauley
Copy link
Collaborator

@emmcauley emmcauley commented Sep 22, 2024

  • Refactor original Primer3Parameters to now be called PrimerAndAmpliconParameters
  • Add DeprecationWarning to Primer3Parameters for backwards compatibility
  • Add ProbeParameters to encapsulate settings for PickHybProbeOnly Primer3Task, as well as a post_init() and to_input_tags() that maps each of the user-specified arguments to the corresponding Primer3InputTag
  • Make *_params and *_weights both optional input to Primer3Input, use the __post_init()__ to assign default weights when given the corresponding params

@emmcauley emmcauley force-pushed the em_add_hyb_probe_weights branch 5 times, most recently from 54b30a3 to 8275f3d Compare September 23, 2024 01:20
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 97.05%. Comparing base (8275f3d) to head (3a416d6).
Report is 2 commits behind head on em_feat_pick_hyb_probe.

Files with missing lines Patch % Lines
prymer/primer3/primer3_input.py 73.68% 2 Missing and 3 partials ⚠️
prymer/primer3/primer3_parameters.py 94.59% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           em_feat_pick_hyb_probe      #35      +/-   ##
==========================================================
- Coverage                   97.39%   97.05%   -0.35%     
==========================================================
  Files                          25       25              
  Lines                        1614     1664      +50     
  Branches                      303      317      +14     
==========================================================
+ Hits                         1572     1615      +43     
- Misses                         23       26       +3     
- Partials                       19       23       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@emmcauley emmcauley marked this pull request as ready for review September 23, 2024 20:04
Comment on lines +107 to +108
"""Assembles necessary inputs for Primer3 to orchestrate primer, primer pair, and/or internal
probe design."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

doc same comment as on #28 - make the summary one line, and add Attributes

Comment on lines +126 to +130
if self.primer_and_amplicon_params is not None and self.primer_weights is None:
object.__setattr__(self, "primer_weights", PrimerAndAmpliconWeights())

if self.probe_params is not None and self.probe_weights is None:
object.__setattr__(self, "probe_weights", ProbeWeights())
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion I think it'd be appropriate to make each of these the default value for the attribute, and change the type of the attributes to not be Optional

optional_attributes = {
field.name: getattr(self, field.name)
for field in fields(self)
if field.default is not MISSING
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion and if you make the above change, you can remove this check

probe_tms: the min, optimal, and max probe melting temperatures
probe_gcs: the min and max GC content for individual probes
number_probes_return: the number of probes to return
probe_max_dinuc_bases: the max number of bases in a dinucleotide run in a probe
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
probe_max_dinuc_bases: the max number of bases in a dinucleotide run in a probe
probe_max_dinuc_bases: the max number of bases in a dinucleotide run in a probe

Comment on lines +226 to +227
isinstance(self.probe_excluded_region, tuple)
and all(isinstance(param, int) for param in self.probe_excluded_region)
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue Also check that the length of the tuple is 2

# we use `type: ignore` here to bypass mypy
replace(
valid_probe_params,
probe_sizes=MinOptMax(min=18.1, opt=22.1, max=30.1), # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue Add the ignore code, and a comment that the the mypy errors are deliberate in the context of this test - we are deliberately passing the wrong type to test our runtime checks

Base automatically changed from em_add_hyb_probe_weights to em_feat_pick_hyb_probe September 26, 2024 18:07
@emmcauley emmcauley merged commit 014e7bc into em_feat_pick_hyb_probe Sep 26, 2024
4 of 6 checks passed
@emmcauley emmcauley deleted the em_add_probe_params branch September 26, 2024 18:08
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