|
15 | 15 |
|
16 | 16 |
|
17 | 17 | ```python
|
18 |
| ->>> Primer3Weights(product_size_lt=1, product_size_gt=1) |
| 18 | +>>> PrimerAndAmpliconWeights(product_size_lt=1, product_size_gt=1) |
19 | 19 | Primer3Weights(product_size_lt=1, product_size_gt=1, ...)
|
20 |
| ->>> Primer3Weights(product_size_lt=5, product_size_gt=1) |
| 20 | +>>> PrimerAndAmpliconWeights(product_size_lt=5, product_size_gt=1) |
21 | 21 | Primer3Weights(product_size_lt=5, product_size_gt=1, ...)
|
22 | 22 |
|
23 | 23 | ```
|
|
30 | 30 |
|
31 | 31 |
|
32 | 32 | @dataclass(frozen=True, init=True, slots=True)
|
33 |
| -class Primer3Weights: |
| 33 | +class PrimerAndAmpliconWeights: |
34 | 34 | """Holds the weights that Primer3 uses to adjust penalties
|
35 | 35 | that originate from the designed primer(s).
|
36 | 36 |
|
37 | 37 | The weights that Primer3 uses when a parameter is less than optimal are labeled with "_lt".
|
38 | 38 | "_gt" weights are penalties applied when a parameter is greater than optimal.
|
39 | 39 |
|
| 40 | + Some of these settings depart from the default settings enumerated in the Primer3 manual. |
40 | 41 | Please see the Primer3 manual for additional details:
|
41 | 42 | https://primer3.org/manual.html#globalTags
|
42 | 43 |
|
43 | 44 | Example:
|
44 |
| - >>> Primer3Weights() #default implementation |
45 |
| - Primer3Weights(product_size_lt=1, product_size_gt=1, product_tm_lt=0.0, product_tm_gt=0.0, primer_end_stability=0.25, primer_gc_lt=0.25, primer_gc_gt=0.25, primer_self_any=0.1, primer_self_end=0.1, primer_size_lt=0.5, primer_size_gt=0.1, primer_tm_lt=1.0, primer_tm_gt=1.0) |
| 45 | + >>> PrimerAndAmpliconWeights() #default implementation |
| 46 | + PrimerAndAmpliconWeights(product_size_lt=1, product_size_gt=1, product_tm_lt=0.0, product_tm_gt=0.0, primer_end_stability=0.25, primer_gc_lt=0.25, primer_gc_gt=0.25, primer_self_any=0.1, primer_self_end=0.1, primer_size_lt=0.5, primer_size_gt=0.1, primer_tm_lt=1.0, primer_tm_gt=1.0, probe_size_lt=0.25, probe_size_gt=0.25, probe_tm_lt=1.0, probe_tm_gt=1.0, probe_gc_lt=0.5, probe_gc_gt=0.5, probe_self_any=1.0, probe_self_end=1.0) |
46 | 47 |
|
47 |
| - >>> Primer3Weights(product_size_lt=5) |
48 |
| - Primer3Weights(product_size_lt=5, product_size_gt=1, product_tm_lt=0.0, product_tm_gt=0.0, primer_end_stability=0.25, primer_gc_lt=0.25, primer_gc_gt=0.25, primer_self_any=0.1, primer_self_end=0.1, primer_size_lt=0.5, primer_size_gt=0.1, primer_tm_lt=1.0, primer_tm_gt=1.0) |
| 48 | + >>> PrimerAndAmpliconWeights(product_size_lt=5) |
| 49 | + PrimerAndAmpliconWeights(product_size_lt=5, product_size_gt=1, product_tm_lt=0.0, product_tm_gt=0.0, primer_end_stability=0.25, primer_gc_lt=0.25, primer_gc_gt=0.25, primer_self_any=0.1, primer_self_end=0.1, primer_size_lt=0.5, primer_size_gt=0.1, primer_tm_lt=1.0, primer_tm_gt=1.0, probe_size_lt=0.25, probe_size_gt=0.25, probe_tm_lt=1.0, probe_tm_gt=1.0, probe_gc_lt=0.5, probe_gc_gt=0.5, probe_self_any=1.0, probe_self_end=1.0) |
49 | 50 | """ # noqa: E501
|
50 | 51 |
|
51 | 52 | product_size_lt: int = 1
|
@@ -80,3 +81,34 @@ def to_input_tags(self) -> dict[Primer3InputTag, Any]:
|
80 | 81 | Primer3InputTag.PRIMER_WT_TM_GT: self.primer_tm_gt,
|
81 | 82 | }
|
82 | 83 | return mapped_dict
|
| 84 | + |
| 85 | + |
| 86 | +@dataclass(frozen=True, init=True, slots=True) |
| 87 | +class ProbeWeights: |
| 88 | + """Holds the weights that Primer3 uses to adjust penalties |
| 89 | + that originate from the designed internal probe(s).""" |
| 90 | + |
| 91 | + probe_size_lt: float = 0.25 |
| 92 | + probe_size_gt: float = 0.25 |
| 93 | + probe_tm_lt: float = 1.0 |
| 94 | + probe_tm_gt: float = 1.0 |
| 95 | + probe_gc_lt: float = 0.5 |
| 96 | + probe_gc_gt: float = 0.5 |
| 97 | + probe_self_any: float = 1.0 |
| 98 | + probe_self_end: float = 1.0 |
| 99 | + probe_hairpin_th: float = 1.0 |
| 100 | + |
| 101 | + def to_input_tags(self) -> dict[Primer3InputTag, Any]: |
| 102 | + """Maps weights to Primer3InputTag to feed directly into Primer3.""" |
| 103 | + mapped_dict = { |
| 104 | + Primer3InputTag.PRIMER_INTERNAL_WT_SIZE_LT: self.probe_size_lt, |
| 105 | + Primer3InputTag.PRIMER_INTERNAL_WT_SIZE_GT: self.probe_size_gt, |
| 106 | + Primer3InputTag.PRIMER_INTERNAL_WT_TM_LT: self.probe_tm_lt, |
| 107 | + Primer3InputTag.PRIMER_INTERNAL_WT_TM_GT: self.probe_tm_gt, |
| 108 | + Primer3InputTag.PRIMER_INTERNAL_WT_GC_PERCENT_LT: self.probe_gc_lt, |
| 109 | + Primer3InputTag.PRIMER_INTERNAL_WT_GC_PERCENT_GT: self.probe_gc_gt, |
| 110 | + Primer3InputTag.PRIMER_INTERNAL_WT_SELF_ANY: self.probe_self_any, |
| 111 | + Primer3InputTag.PRIMER_INTERNAL_WT_SELF_END: self.probe_self_end, |
| 112 | + Primer3InputTag.PRIMER_INTERNAL_WT_HAIRPIN_TH: self.probe_hairpin_th, |
| 113 | + } |
| 114 | + return mapped_dict |
0 commit comments