Skip to content

Commit

Permalink
added p8634 variant of M13
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-doty committed Mar 31, 2023
1 parent 387a053 commit 0fe3a32
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
19 changes: 15 additions & 4 deletions nuad/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ class M13Variant(enum.Enum):
https://www.tilibit.com/collections/scaffold-dna/products/single-stranded-scaffold-dna-type-p8064
"""

p8634 = "p8634"
"""Variant of M13mp18 that is 8634 bases long. At the time of this writing, not listed as available
from any biotech vender, but Tilibit will make it for you if you ask.
(https://www.tilibit.com/pages/contact-us)
"""


def length(self) -> int:
"""
:return: length of this variant of M13 (e.g., 7249 for variant :data:`M13Variant.p7249`)
Expand All @@ -150,6 +157,8 @@ def length(self) -> int:
return 7560
if self is M13Variant.p8064:
return 8064
if self is M13Variant.p8634:
return 8634
raise AssertionError('should be unreachable')

def scadnano_variant(self) -> sc.M13Variant:
Expand All @@ -159,6 +168,8 @@ def scadnano_variant(self) -> sc.M13Variant:
return sc.M13Variant.p7560
if self is M13Variant.p8064:
return sc.M13Variant.p8064
if self is M13Variant.p8634:
return sc.M13Variant.p8634
raise AssertionError('should be unreachable')


Expand Down Expand Up @@ -5763,15 +5774,15 @@ def longest_complementary_subsequences_two_loops(arr1: np.ndarray, arr2: np.ndar
the sequences in `arr1` are assumed to be oriented 5' --> 3', and the sequences in `arr2`
are assumed to be oriented 3' --> 5'.
Args
Args:
arr1: 2D array of DNA sequences, with each sequence represented as a 1D array of 0, 1, 2, 3
corresponding to A, C, G, T, respectively, with each row being a single DNA sequence
oriented 5' --> 3'.
arr2: 2D array of DNA sequences, with each row being a single DNA sequence
oriented 3' --> 5'.
gc_double: Whether to double the score for G-C base pairs.
Returns
Returns:
list `ret` of ints, where `ret[i]` is the length of the longest complementary subsequence
between `arr1[i]` and `arr2[i]`.
"""
Expand Down Expand Up @@ -5821,15 +5832,15 @@ def longest_complementary_subsequences(arr1: np.ndarray, arr2: np.ndarray, gc_do
the sequences in `arr1` are assumed to be oriented 5' --> 3', and the sequences in `arr2`
are assumed to be oriented 3' --> 5'.
Args
Args:
arr1: 2D array of DNA sequences, with each sequence represented as a 1D array of 0, 1, 2, 3
corresponding to A, C, G, T, respectively, with each row being a single DNA sequence
oriented 5' --> 3'.
arr2: 2D array of DNA sequences, with each row being a single DNA sequence
oriented 3' --> 5'.
gc_double: Whether to double the score for G-C base pairs.
Returns
Returns:
list `ret` of ints, where `ret[i]` is the length of the longest complementary subsequence
between `arr1[i]` and `arr2[i]`.
"""
Expand Down
11 changes: 5 additions & 6 deletions nuad/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1813,9 +1813,8 @@ def replace_with_new(self) -> None:
_assert_violations_are_accurate(self.evaluations, self.violations)

def update_scores_and_counts(self) -> None:
"""
:return: Total score of all evaluations.
"""
# return: Total score of all evaluations.

self.total_score = self.total_score_fixed = self.total_score_nonfixed = 0.0
self.num_evaluations = self.num_evaluations_nonfixed = self.num_evaluations_fixed = 0
self.num_violations = self.num_violations_nonfixed = self.num_violations_fixed = 0
Expand Down Expand Up @@ -1949,11 +1948,11 @@ class Evaluation(Generic[DesignPart]):

def __init__(self, constraint: Constraint, violated: bool, part: DesignPart, domains: Iterable[Domain],
score: float, summary: str, result: nc.Result) -> None:
# :param constraint:
# constraint:
# :any:`Constraint` that was violated to result in this
# :param domains:
# domains:
# :any:`Domain`'s that were involved in violating :py:data:`Evaluation.constraint`
# :param score:
# score:
# total "score" of this violation, typically something like an excess energy over a
# threshold, squared, multiplied by the :data:`Constraint.weight`
self.constraint = constraint
Expand Down

0 comments on commit 0fe3a32

Please sign in to comment.