|
| 1 | +import Bio |
1 | 2 | from Bio.Seq import Seq
|
2 | 3 | from Bio import motifs
|
3 | 4 | from Bio.Align.AlignInfo import PSSM
|
@@ -30,7 +31,10 @@ class MotifPssmPattern(SequencePattern):
|
30 | 31 | """
|
31 | 32 |
|
32 | 33 | def __init__(
|
33 |
| - self, pssm, threshold=None, relative_threshold=None, |
| 34 | + self, |
| 35 | + pssm, |
| 36 | + threshold=None, |
| 37 | + relative_threshold=None, |
34 | 38 | ):
|
35 | 39 | if not isinstance(pssm, Bio.motifs.Motif):
|
36 | 40 | raise ValueError(
|
@@ -70,7 +74,9 @@ def find_matches_in_string(self, sequence):
|
70 | 74 | # sequence, threshold=self.threshold, both=False
|
71 | 75 | # )
|
72 | 76 | 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, |
74 | 80 | )
|
75 | 81 | return [(i, i + self.size, 1) for i in indices]
|
76 | 82 |
|
@@ -115,7 +121,9 @@ def from_sequences(
|
115 | 121 | motif.name = name
|
116 | 122 | pssm = motif
|
117 | 123 | return MotifPssmPattern(
|
118 |
| - pssm=pssm, threshold=threshold, relative_threshold=relative_threshold, |
| 124 | + pssm=pssm, |
| 125 | + threshold=threshold, |
| 126 | + relative_threshold=relative_threshold, |
119 | 127 | )
|
120 | 128 |
|
121 | 129 | @classmethod
|
@@ -164,7 +172,9 @@ def list_from_file(
|
164 | 172 |
|
165 | 173 | return [
|
166 | 174 | MotifPssmPattern(
|
167 |
| - pssm, threshold=threshold, relative_threshold=relative_threshold, |
| 175 | + pssm, |
| 176 | + threshold=threshold, |
| 177 | + relative_threshold=relative_threshold, |
168 | 178 | )
|
169 | 179 | for pssm in motifs_list
|
170 | 180 | ]
|
|
0 commit comments