diff --git a/dnachisel/builtin_specifications/AllowPrimer.py b/dnachisel/builtin_specifications/AllowPrimer.py index 1d427ff..fdbe0b2 100644 --- a/dnachisel/builtin_specifications/AllowPrimer.py +++ b/dnachisel/builtin_specifications/AllowPrimer.py @@ -62,19 +62,20 @@ def __init__( avoid_heterodim_with=None, max_heterodim_tm=5, avoided_repeats=((2, 5), (3, 4), (4, 3)), + boost=1.0, ): location = Location.from_data(location) specs = { "unique_sequence": UniquifyAllKmers( - k=max_homology_length, location=location + k=max_homology_length, location=location, boost=boost ), "melting_temperature": EnforceMeltingTemperature( - mini=tmin, maxi=tmax, location=location + mini=tmin, maxi=tmax, location=location, boost=boost ), **{ "repeats_%d_%d" % (k, n): AvoidPattern( - RepeatedKmerPattern(k, n), location=location + RepeatedKmerPattern(k, n), location=location, boost=boost ) for (k, n) in avoided_repeats }, @@ -84,5 +85,7 @@ def __init__( other_primers_sequences=avoid_heterodim_with, tmax=max_heterodim_tm, location=location, + boost=boost, ) self.register_specifications(specs) + self.boost = boost diff --git a/dnachisel/builtin_specifications/AvoidBlastMatches.py b/dnachisel/builtin_specifications/AvoidBlastMatches.py index 3069d01..26a5994 100644 --- a/dnachisel/builtin_specifications/AvoidBlastMatches.py +++ b/dnachisel/builtin_specifications/AvoidBlastMatches.py @@ -55,6 +55,7 @@ def __init__( e_value=1e80, culling_limit=1, location=None, + boost=1.0, ): """Initialize.""" self.blast_db = blast_db @@ -68,6 +69,7 @@ def __init__( self.e_value = e_value self.ungapped = ungapped self.culling_limit = culling_limit + self.boost = boost def initialized_on_problem(self, problem, role=None): return self._copy_with_full_span_if_no_location(problem) diff --git a/dnachisel/builtin_specifications/AvoidHeterodimerization.py b/dnachisel/builtin_specifications/AvoidHeterodimerization.py index 7ea154a..4046e12 100644 --- a/dnachisel/builtin_specifications/AvoidHeterodimerization.py +++ b/dnachisel/builtin_specifications/AvoidHeterodimerization.py @@ -36,6 +36,7 @@ def __init__( self.other_primers_sequences = other_primers_sequences self.tmax = tmax self.location = location + self.boost = boost def initialized_on_problem(self, problem, role=None): return self._copy_with_full_span_if_no_location(problem) diff --git a/dnachisel/builtin_specifications/SequenceLengthBounds.py b/dnachisel/builtin_specifications/SequenceLengthBounds.py index 4024e2c..0899f23 100644 --- a/dnachisel/builtin_specifications/SequenceLengthBounds.py +++ b/dnachisel/builtin_specifications/SequenceLengthBounds.py @@ -20,9 +20,10 @@ class SequenceLengthBounds(Specification): """ best_possible_score = 0 - def __init__(self, min_length=0, max_length=None): + def __init__(self, min_length=0, max_length=None, boost=1.0): self.min_length = min_length self.max_length = max_length + self.boost = boost def evaluate(self, problem): """Return 0 if the sequence length is between the bounds, else -1""" diff --git a/dnachisel/builtin_specifications/UniquifyAllKmers.py b/dnachisel/builtin_specifications/UniquifyAllKmers.py index 2357098..040bc01 100644 --- a/dnachisel/builtin_specifications/UniquifyAllKmers.py +++ b/dnachisel/builtin_specifications/UniquifyAllKmers.py @@ -137,7 +137,7 @@ def __init__( reference = Location.from_tuple(reference) self.reference = reference self.include_reverse_complement = include_reverse_complement - self.boost = 1.0 + self.boost = boost self.localization_data = localization_data def initialized_on_problem(self, problem, role="constraint"):