Skip to content

Commit c21f8de

Browse files
committed
Updated docstrings for motifs function
1 parent d15460e commit c21f8de

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

stumpy/aamp_motifs.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,26 @@ def aamp_motifs(
150150
number of other subsequence matches in `T` (outside the exclusion zone) with a
151151
distance less or equal to `max_distance`.
152152
153+
Note that, in the best case scenario, the returned arrays would have shape
154+
`(max_motifs, max_matches)` and contain all finite values. However, in reality,
155+
many conditions (see below) need to be satisfied in order for this to be true. Any
156+
truncation in the number of rows (i.e., motifs) may be the result of insufficient
157+
candidate motifs with matches greater than or equal to `min_neighbors` or that the
158+
matrix profile value for the candidate motif was larger than `cutoff`. Similarly,
159+
any truncationin in the number of columns (i.e., matches) may be the result of
160+
insufficient matches being found with distances (to their corresponding candidate
161+
motif) that are equal to or less than `max_distance`. Only motifs and matches that
162+
satisfy all of these constraints will be returned.
163+
164+
If you must return a shape of `(max_motifs, max_matches)`, then you may consider
165+
specifying a smaller `min_neighors`, a larger `max_distance`, and/or a larger
166+
`cutoff`. For example, while it is ill advised, setting `min_neighbors=1`,
167+
`max_distance=np.inf`, and `cutoff=np.inf` will ensure that the shape of the output
168+
arrays will be `(max_motifs, max_matches)`. However, given the lack of constraints,
169+
the quality of each motif and the quality of each match may be drastically
170+
different. Setting appropriate conditions will help ensure appropriately
171+
constrained results that may be easier to interpret.
172+
153173
Parameters
154174
----------
155175
T : numpy.ndarray

stumpy/motifs.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,26 @@ def motifs(
157157
number of other subsequence matches in `T` (outside the exclusion zone) with a
158158
distance less or equal to `max_distance`.
159159
160+
Note that, in the best case scenario, the returned arrays would have shape
161+
`(max_motifs, max_matches)` and contain all finite values. However, in reality,
162+
many conditions (see below) need to be satisfied in order for this to be true. Any
163+
truncation in the number of rows (i.e., motifs) may be the result of insufficient
164+
candidate motifs with matches greater than or equal to `min_neighbors` or that the
165+
matrix profile value for the candidate motif was larger than `cutoff`. Similarly,
166+
any truncationin in the number of columns (i.e., matches) may be the result of
167+
insufficient matches being found with distances (to their corresponding candidate
168+
motif) that are equal to or less than `max_distance`. Only motifs and matches that
169+
satisfy all of these constraints will be returned.
170+
171+
If you must return a shape of `(max_motifs, max_matches)`, then you may consider
172+
specifying a smaller `min_neighors`, a larger `max_distance`, and/or a larger
173+
`cutoff`. For example, while it is ill advised, setting `min_neighbors=1`,
174+
`max_distance=np.inf`, and `cutoff=np.inf` will ensure that the shape of the output
175+
arrays will be `(max_motifs, max_matches)`. However, given the lack of constraints,
176+
the quality of each motif and the quality of each match may be drastically
177+
different. Setting appropriate conditions will help ensure appropriately
178+
constrained results that may be easier to interpret.
179+
160180
Parameters
161181
----------
162182
T : numpy.ndarray

0 commit comments

Comments
 (0)