Skip to content

Commit c4d3ec1

Browse files
authored
Merge pull request #82 from ondrej-sladky-eligo/master
All builtin specifications now correctly recognize `boost` parameter.
2 parents 61b35a5 + df26628 commit c4d3ec1

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

dnachisel/builtin_specifications/AllowPrimer.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,20 @@ def __init__(
6262
avoid_heterodim_with=None,
6363
max_heterodim_tm=5,
6464
avoided_repeats=((2, 5), (3, 4), (4, 3)),
65+
boost=1.0,
6566
):
6667
location = Location.from_data(location)
6768
specs = {
6869
"unique_sequence": UniquifyAllKmers(
69-
k=max_homology_length, location=location
70+
k=max_homology_length, location=location, boost=boost
7071
),
7172
"melting_temperature": EnforceMeltingTemperature(
72-
mini=tmin, maxi=tmax, location=location
73+
mini=tmin, maxi=tmax, location=location, boost=boost
7374
),
7475
**{
7576
"repeats_%d_%d"
7677
% (k, n): AvoidPattern(
77-
RepeatedKmerPattern(k, n), location=location
78+
RepeatedKmerPattern(k, n), location=location, boost=boost
7879
)
7980
for (k, n) in avoided_repeats
8081
},
@@ -84,5 +85,7 @@ def __init__(
8485
other_primers_sequences=avoid_heterodim_with,
8586
tmax=max_heterodim_tm,
8687
location=location,
88+
boost=boost,
8789
)
8890
self.register_specifications(specs)
91+
self.boost = boost

dnachisel/builtin_specifications/AvoidBlastMatches.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def __init__(
5555
e_value=1e80,
5656
culling_limit=1,
5757
location=None,
58+
boost=1.0,
5859
):
5960
"""Initialize."""
6061
self.blast_db = blast_db
@@ -68,6 +69,7 @@ def __init__(
6869
self.e_value = e_value
6970
self.ungapped = ungapped
7071
self.culling_limit = culling_limit
72+
self.boost = boost
7173

7274
def initialized_on_problem(self, problem, role=None):
7375
return self._copy_with_full_span_if_no_location(problem)

dnachisel/builtin_specifications/AvoidHeterodimerization.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(
3636
self.other_primers_sequences = other_primers_sequences
3737
self.tmax = tmax
3838
self.location = location
39+
self.boost = boost
3940

4041
def initialized_on_problem(self, problem, role=None):
4142
return self._copy_with_full_span_if_no_location(problem)

dnachisel/builtin_specifications/SequenceLengthBounds.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ class SequenceLengthBounds(Specification):
2020
"""
2121
best_possible_score = 0
2222

23-
def __init__(self, min_length=0, max_length=None):
23+
def __init__(self, min_length=0, max_length=None, boost=1.0):
2424
self.min_length = min_length
2525
self.max_length = max_length
26+
self.boost = boost
2627

2728
def evaluate(self, problem):
2829
"""Return 0 if the sequence length is between the bounds, else -1"""

dnachisel/builtin_specifications/UniquifyAllKmers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(
137137
reference = Location.from_tuple(reference)
138138
self.reference = reference
139139
self.include_reverse_complement = include_reverse_complement
140-
self.boost = 1.0
140+
self.boost = boost
141141
self.localization_data = localization_data
142142

143143
def initialized_on_problem(self, problem, role="constraint"):

0 commit comments

Comments
 (0)