-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
At max_homology_length = 5 no solution is found sometimes.
- Loading branch information
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
"""Example of use of the AvoidChanges as an objective to minimize modifications | ||
of a sequence.""" | ||
|
||
import numpy | ||
|
||
from dnachisel import AllowPrimer, DnaOptimizationProblem | ||
|
||
|
||
def test_AllowPrimer(): | ||
numpy.random.seed(123) | ||
primers = ["ATTGCGCCAAACT", "TAATCCACCCTAAT", "ATTCACACTTCAA"] | ||
problem = DnaOptimizationProblem( | ||
sequence=40 * "A", | ||
constraints=[ | ||
AllowPrimer( | ||
tmin=50, | ||
tmax=60, | ||
max_homology_length=5, | ||
max_homology_length=7, | ||
location=(10, 30), | ||
avoid_heterodim_with=primers, | ||
) | ||
], | ||
logger=None | ||
logger=None, | ||
) | ||
problem.resolve_constraints() | ||
assert problem.all_constraints_pass() |