|
1 | 1 | from Bio.Seq import Seq
|
2 | 2 | from Bio import motifs
|
3 |
| -from Bio.Align.AlignInfo import PSSM |
4 | 3 | from .SequencePattern import SequencePattern
|
5 | 4 | import numpy as np
|
6 | 5 |
|
@@ -29,10 +28,8 @@ class MotifPssmPattern(SequencePattern):
|
29 | 28 | sequence(s) with the absolute highest possible score".
|
30 | 29 | """
|
31 | 30 |
|
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): |
36 | 33 | raise ValueError(
|
37 | 34 | f"Expected PSSM type of `Bio.motifs.Motif`, but {type(pssm)} was passed"
|
38 | 35 | )
|
@@ -70,7 +67,7 @@ def find_matches_in_string(self, sequence):
|
70 | 67 | # sequence, threshold=self.threshold, both=False
|
71 | 68 | # )
|
72 | 69 | 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 |
74 | 71 | )
|
75 | 72 | return [(i, i + self.size, 1) for i in indices]
|
76 | 73 |
|
@@ -115,7 +112,7 @@ def from_sequences(
|
115 | 112 | motif.name = name
|
116 | 113 | pssm = motif
|
117 | 114 | return MotifPssmPattern(
|
118 |
| - pssm=pssm, threshold=threshold, relative_threshold=relative_threshold, |
| 115 | + pssm=pssm, threshold=threshold, relative_threshold=relative_threshold |
119 | 116 | )
|
120 | 117 |
|
121 | 118 | @classmethod
|
@@ -164,7 +161,7 @@ def list_from_file(
|
164 | 161 |
|
165 | 162 | return [
|
166 | 163 | MotifPssmPattern(
|
167 |
| - pssm, threshold=threshold, relative_threshold=relative_threshold, |
| 164 | + pssm, threshold=threshold, relative_threshold=relative_threshold |
168 | 165 | )
|
169 | 166 | for pssm in motifs_list
|
170 | 167 | ]
|
|
0 commit comments