Skip to content

Commit 47e2b4f

Browse files
author
Valentin Zulkower
committed
fix missing "Bio" import
1 parent e368695 commit 47e2b4f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

dnachisel/SequencePattern/MotifPssmPattern.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Bio
12
from Bio.Seq import Seq
23
from Bio import motifs
34
from Bio.Align.AlignInfo import PSSM
@@ -30,7 +31,10 @@ class MotifPssmPattern(SequencePattern):
3031
"""
3132

3233
def __init__(
33-
self, pssm, threshold=None, relative_threshold=None,
34+
self,
35+
pssm,
36+
threshold=None,
37+
relative_threshold=None,
3438
):
3539
if not isinstance(pssm, Bio.motifs.Motif):
3640
raise ValueError(
@@ -70,7 +74,9 @@ def find_matches_in_string(self, sequence):
7074
# sequence, threshold=self.threshold, both=False
7175
# )
7276
indices = find_pssm_matches_with_numpy(
73-
pssm_matrix=self.pssm_matrix, sequence=sequence, threshold=self.threshold,
77+
pssm_matrix=self.pssm_matrix,
78+
sequence=sequence,
79+
threshold=self.threshold,
7480
)
7581
return [(i, i + self.size, 1) for i in indices]
7682

@@ -115,7 +121,9 @@ def from_sequences(
115121
motif.name = name
116122
pssm = motif
117123
return MotifPssmPattern(
118-
pssm=pssm, threshold=threshold, relative_threshold=relative_threshold,
124+
pssm=pssm,
125+
threshold=threshold,
126+
relative_threshold=relative_threshold,
119127
)
120128

121129
@classmethod
@@ -164,7 +172,9 @@ def list_from_file(
164172

165173
return [
166174
MotifPssmPattern(
167-
pssm, threshold=threshold, relative_threshold=relative_threshold,
175+
pssm,
176+
threshold=threshold,
177+
relative_threshold=relative_threshold,
168178
)
169179
for pssm in motifs_list
170180
]

0 commit comments

Comments
 (0)