Skip to content

Commit

Permalink
fix missing "Bio" import
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Zulkower committed Nov 6, 2024
1 parent e368695 commit 47e2b4f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dnachisel/SequencePattern/MotifPssmPattern.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Bio
from Bio.Seq import Seq
from Bio import motifs
from Bio.Align.AlignInfo import PSSM
Expand Down Expand Up @@ -30,7 +31,10 @@ class MotifPssmPattern(SequencePattern):
"""

def __init__(
self, pssm, threshold=None, relative_threshold=None,
self,
pssm,
threshold=None,
relative_threshold=None,
):
if not isinstance(pssm, Bio.motifs.Motif):
raise ValueError(
Expand Down Expand Up @@ -70,7 +74,9 @@ def find_matches_in_string(self, sequence):
# sequence, threshold=self.threshold, both=False
# )
indices = find_pssm_matches_with_numpy(
pssm_matrix=self.pssm_matrix, sequence=sequence, threshold=self.threshold,
pssm_matrix=self.pssm_matrix,
sequence=sequence,
threshold=self.threshold,
)
return [(i, i + self.size, 1) for i in indices]

Expand Down Expand Up @@ -115,7 +121,9 @@ def from_sequences(
motif.name = name
pssm = motif
return MotifPssmPattern(
pssm=pssm, threshold=threshold, relative_threshold=relative_threshold,
pssm=pssm,
threshold=threshold,
relative_threshold=relative_threshold,
)

@classmethod
Expand Down Expand Up @@ -164,7 +172,9 @@ def list_from_file(

return [
MotifPssmPattern(
pssm, threshold=threshold, relative_threshold=relative_threshold,
pssm,
threshold=threshold,
relative_threshold=relative_threshold,
)
for pssm in motifs_list
]
Expand Down

0 comments on commit 47e2b4f

Please sign in to comment.