Skip to content

Commit

Permalink
Merge pull request #90 from Edinburgh-Genome-Foundry/zulko/fix-missin…
Browse files Browse the repository at this point in the history
…g-bio

Zulko/fix missing bio
  • Loading branch information
veghp authored Nov 6, 2024
2 parents e368695 + e0ff89f commit 7ad6d72
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions dnachisel/SequencePattern/MotifPssmPattern.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from Bio.Seq import Seq
from Bio import motifs
from Bio.Align.AlignInfo import PSSM
from .SequencePattern import SequencePattern
import numpy as np

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

def __init__(
self, pssm, threshold=None, relative_threshold=None,
):
if not isinstance(pssm, Bio.motifs.Motif):
def __init__(self, pssm, threshold=None, relative_threshold=None):
if not isinstance(pssm, motifs.Motif):
raise ValueError(
f"Expected PSSM type of `Bio.motifs.Motif`, but {type(pssm)} was passed"
)
Expand Down Expand Up @@ -70,7 +67,7 @@ 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 +112,7 @@ 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 +161,7 @@ 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 7ad6d72

Please sign in to comment.