Skip to content

Commit

Permalink
correct pssm parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
MaozGelbart committed Oct 27, 2024
1 parent 2360186 commit 6e0950c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dnachisel/SequencePattern/MotifPssmPattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MotifPssmPattern(SequencePattern):
----------
pssm
A Bio.Align.AlignInfo.PSSM object.
A `Bio.motifs.Motif` object.
threshold
locations of the sequence with a PSSM score above this value will be
Expand All @@ -32,6 +32,10 @@ class MotifPssmPattern(SequencePattern):
def __init__(
self, pssm, threshold=None, relative_threshold=None,
):
if not isinstance(pssm, Bio.motifs.Motif):
raise ValueError(
f"Expected PSSM type of `Bio.motifs.Motif`, but {type(pssm)} was passed"
)
self.name = pssm.name
self.pssm = pssm.pssm
if relative_threshold is not None:
Expand Down Expand Up @@ -108,8 +112,8 @@ def from_sequences(
sequences = [Seq(s) for s in sequences]
motif = motifs.create(sequences)
cls.apply_pseudocounts(motif, pseudocounts)
pssm = PSSM(motif.pssm)
pssm.name = name
motif.name = name
pssm = motif
return MotifPssmPattern(
pssm=pssm, threshold=threshold, relative_threshold=relative_threshold,
)
Expand Down

0 comments on commit 6e0950c

Please sign in to comment.