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 penalty weights for pick_hyb_probe task #28

Merged
merged 0 commits into from
Sep 26, 2024

Conversation

emmcauley
Copy link
Collaborator

@emmcauley emmcauley commented Sep 18, 2024

Part of #11 . This PR adds PRIMER_INTERNAL_WT_* fields to a ProbeWeights dataclass that now exists alongside a PrimerAndAmpliconWeights class. Similar to the PRIMER_ weights, the size, melting temperature, GC content, and complementarity of the probe are penalized. Defaults for the dataclass were chosen to heavily weight against probe complementarity and out-of-range melting temperature and apply a smaller penalty to out-of-spec GC content and probe size.

ProbeWeights is separate from PrimerAndAmpliconWeights to maintain separation of tasks and clarity.

@emmcauley emmcauley force-pushed the em_add_hyb_probe_weights branch 4 times, most recently from a47953e to 9dd4ebb Compare September 23, 2024 01:09
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.39%. Comparing base (70f6840) to head (8275f3d).

Additional details and impacted files
@@                    Coverage Diff                     @@
##           em_feat_pick_hyb_probe      #28      +/-   ##
==========================================================
+ Coverage                   97.37%   97.39%   +0.02%     
==========================================================
  Files                          25       25              
  Lines                        1597     1614      +17     
  Branches                      302      303       +1     
==========================================================
+ Hits                         1555     1572      +17     
  Misses                         23       23              
  Partials                       19       19              

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

@emmcauley emmcauley changed the base branch from em_feat_pick_hyb_probe to main September 23, 2024 01:17
@emmcauley emmcauley changed the base branch from main to em_feat_pick_hyb_probe September 23, 2024 01:23
@emmcauley emmcauley marked this pull request as ready for review September 23, 2024 20:04
@@ -116,6 +121,7 @@ def to_input_tags(self, design_region: Span) -> dict[Primer3InputTag, Any]:
assembled_tags = {
**primer3_task_params,
**self.params.to_input_tags(),
**self.weights.to_input_tags(),
**self.primer_weights.to_input_tags(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue Check that this is not None just like with probe_weights

Copy link
Collaborator

Choose a reason for hiding this comment

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

(I am surprised that mypy does not catch this!)

Comment on lines 103 to 104
primer_weights: Optional[PrimerAndAmpliconWeights] = PrimerAndAmpliconWeights()
probe_weights: Optional[ProbeWeights] = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

note Per discussion, #48 adds validation of the presence of required weights, based on the specified task.

"""Holds the weights that Primer3 uses to adjust penalties
that originate from the designed primer(s).

The weights that Primer3 uses when a parameter is less than optimal are labeled with "_lt".
"_gt" weights are penalties applied when a parameter is greater than optimal.

Some of these settings depart from the default settings enumerated in the Primer3 manual.
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
Some of these settings depart from the default settings enumerated in the Primer3 manual.
Most of these settings depart from the default settings enumerated in the Primer3 manual.

suggestion Open an issue, to enumerate the differences (and possibly the rationale?)

Comment on lines 90 to 91
"""Holds the weights that Primer3 uses to adjust penalties
that originate from the designed internal probe(s)."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

doc Make the summary line one line, and add an Attributes block

https://google.github.io/styleguide/pyguide.html#384-classes

@emmcauley emmcauley merged commit 8275f3d into em_feat_pick_hyb_probe Sep 26, 2024
10 checks passed
@emmcauley emmcauley deleted the em_add_hyb_probe_weights branch September 26, 2024 18:07
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