From 47e2b4f32611e1d13bbbe117b676ad3a008a74d0 Mon Sep 17 00:00:00 2001 From: Valentin Zulkower Date: Wed, 6 Nov 2024 17:32:28 -0500 Subject: [PATCH] fix missing "Bio" import --- dnachisel/SequencePattern/MotifPssmPattern.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dnachisel/SequencePattern/MotifPssmPattern.py b/dnachisel/SequencePattern/MotifPssmPattern.py index c603538..9916b9b 100644 --- a/dnachisel/SequencePattern/MotifPssmPattern.py +++ b/dnachisel/SequencePattern/MotifPssmPattern.py @@ -1,3 +1,4 @@ +import Bio from Bio.Seq import Seq from Bio import motifs from Bio.Align.AlignInfo import PSSM @@ -30,7 +31,10 @@ class MotifPssmPattern(SequencePattern): """ def __init__( - self, pssm, threshold=None, relative_threshold=None, + self, + pssm, + threshold=None, + relative_threshold=None, ): if not isinstance(pssm, Bio.motifs.Motif): raise ValueError( @@ -70,7 +74,9 @@ 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] @@ -115,7 +121,9 @@ 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 @@ -164,7 +172,9 @@ 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 ]