Skip to content

Commit 7ad6d72

Browse files
authored
Merge pull request #90 from Edinburgh-Genome-Foundry/zulko/fix-missing-bio
Zulko/fix missing bio
2 parents e368695 + e0ff89f commit 7ad6d72

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

dnachisel/SequencePattern/MotifPssmPattern.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from Bio.Seq import Seq
22
from Bio import motifs
3-
from Bio.Align.AlignInfo import PSSM
43
from .SequencePattern import SequencePattern
54
import numpy as np
65

@@ -29,10 +28,8 @@ class MotifPssmPattern(SequencePattern):
2928
sequence(s) with the absolute highest possible score".
3029
"""
3130

32-
def __init__(
33-
self, pssm, threshold=None, relative_threshold=None,
34-
):
35-
if not isinstance(pssm, Bio.motifs.Motif):
31+
def __init__(self, pssm, threshold=None, relative_threshold=None):
32+
if not isinstance(pssm, motifs.Motif):
3633
raise ValueError(
3734
f"Expected PSSM type of `Bio.motifs.Motif`, but {type(pssm)} was passed"
3835
)
@@ -70,7 +67,7 @@ def find_matches_in_string(self, sequence):
7067
# sequence, threshold=self.threshold, both=False
7168
# )
7269
indices = find_pssm_matches_with_numpy(
73-
pssm_matrix=self.pssm_matrix, sequence=sequence, threshold=self.threshold,
70+
pssm_matrix=self.pssm_matrix, sequence=sequence, threshold=self.threshold
7471
)
7572
return [(i, i + self.size, 1) for i in indices]
7673

@@ -115,7 +112,7 @@ def from_sequences(
115112
motif.name = name
116113
pssm = motif
117114
return MotifPssmPattern(
118-
pssm=pssm, threshold=threshold, relative_threshold=relative_threshold,
115+
pssm=pssm, threshold=threshold, relative_threshold=relative_threshold
119116
)
120117

121118
@classmethod
@@ -164,7 +161,7 @@ def list_from_file(
164161

165162
return [
166163
MotifPssmPattern(
167-
pssm, threshold=threshold, relative_threshold=relative_threshold,
164+
pssm, threshold=threshold, relative_threshold=relative_threshold
168165
)
169166
for pssm in motifs_list
170167
]

0 commit comments

Comments
 (0)