Skip to content

Commit 3df750b

Browse files
committed
Added self-match/trivial-match notes
1 parent 7f047b4 commit 3df750b

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

stumpy/aamp_motifs.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,23 @@ def _aamp_motifs(
6161
6262
max_matches : int
6363
The maximum number of similar matches to be returned. The resulting
64-
matches are sorted by distance (starting with the most similar).
64+
matches are sorted by distance (starting with the most similar). Note that the
65+
first match is always the self-match/trivial-match for each motif.
6566
6667
max_motifs : int
6768
The maximum number of motifs to return.
6869
6970
Return
7071
------
7172
motif_distances : ndarray
72-
The distances corresponding to a set of subsequence matches for each motif
73+
The distances corresponding to a set of subsequence matches for each motif.
74+
Note that the first column always corresponds to the distance for the
75+
self-match/trivial-match for each motif.
7376
7477
motif_indices : ndarray
7578
The indices corresponding to a set of subsequences matches for each motif
79+
Note that the first column always corresponds to the index for the
80+
self-match/trivial-match for each motif
7681
"""
7782
n = T.shape[1]
7883
l = P.shape[1]
@@ -172,18 +177,23 @@ def aamp_motifs(
172177
returned. The resulting matches are sorted by distance, so a value of `10`
173178
means that the indices of the most similar `10` subsequences is returned.
174179
If `None`, all matches within `max_distance` of the motif representative
175-
will be returned.
180+
will be returned. Note that the first match is always the
181+
self-match/trivial-match for each motif.
176182
177183
max_motifs : int, default 1
178184
The maximum number of motifs to return.
179185
180186
Return
181187
------
182188
motif_distances : ndarray
183-
The distances corresponding to a set of subsequence matches for each motif
189+
The distances corresponding to a set of subsequence matches for each motif.
190+
Note that the first column always corresponds to the distance for the
191+
self-match/trivial-match for each motif.
184192
185193
motif_indices : ndarray
186194
The indices corresponding to a set of subsequences matches for each motif
195+
Note that the first column always corresponds to the index for the
196+
self-match/trivial-match for each motif.
187197
188198
"""
189199
if max_motifs < 1: # pragma: no cover
@@ -274,7 +284,7 @@ def aamp_match(
274284
out : ndarray
275285
The first column consists of distances of subsequences of `T` whose distances
276286
to `Q` are smaller than `max_distance`, sorted by distance (lowest to highest).
277-
The second column consist of the corresponding indices in `T`.
287+
The second column consists of the corresponding indices in `T`.
278288
"""
279289
if len(Q.shape) == 1:
280290
Q = Q[np.newaxis, :]

stumpy/motifs.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def _motifs(
6060
6161
max_matches : int
6262
The maximum number of similar matches to be returned. The resulting
63-
matches are sorted by distance (starting with the most similar).
63+
matches are sorted by distance (starting with the most similar). Note that
64+
the first match is always the self-match/trivial-match for each motif.
6465
6566
max_motifs : int
6667
The maximum number of motifs to return.
@@ -73,10 +74,14 @@ def _motifs(
7374
Return
7475
------
7576
motif_distances : ndarray
76-
The distances corresponding to a set of subsequence matches for each motif
77+
The distances corresponding to a set of subsequence matches for each motif.
78+
Note that the first column always corresponds to the distance for the
79+
self-match/trivial-match for each motif.
7780
7881
motif_indices : ndarray
79-
The indices corresponding to a set of subsequences matches for each motif
82+
The indices corresponding to a set of subsequences matches for each motif.
83+
Note that the first column always corresponds to the index for the
84+
self-match/trivial-match for each motif.
8085
"""
8186
n = T.shape[1]
8287
l = P.shape[1]
@@ -178,7 +183,8 @@ def motifs(
178183
The resulting matches are sorted by distance, so a value of `10` means that the
179184
indices of the most similar `10` subsequences is returned.
180185
If `None`, all matches within `max_distance` of the motif representative
181-
will be returned.
186+
will be returned. Note that the first match is always the
187+
self-match/trivial-match for each motif.
182188
183189
max_motifs : int, default 1
184190
The maximum number of motifs to return
@@ -191,10 +197,14 @@ def motifs(
191197
Return
192198
------
193199
motif_distances : ndarray
194-
The distances corresponding to a set of subsequence matches for each motif
200+
The distances corresponding to a set of subsequence matches for each motif.
201+
Note that the first column always corresponds to the distance for the
202+
self-match/trivial-match for each motif.
195203
196204
motif_indices : ndarray
197-
The indices corresponding to a set of subsequences matches for each motif
205+
The indices corresponding to a set of subsequences matches for each motif.
206+
Note that the first column always corresponds to the index for the
207+
self-match/trivial-match for each motif.
198208
"""
199209
if max_motifs < 1: # pragma: no cover
200210
logger.warn(
@@ -300,7 +310,7 @@ def match(
300310
out : ndarray
301311
The first column consists of distances of subsequences of `T` whose distances
302312
to `Q` are smaller than `max_distance`, sorted by distance (lowest to highest).
303-
The second column consist of the corresponding indices in `T`.
313+
The second column consists of the corresponding indices in `T`.
304314
"""
305315
if len(Q.shape) == 1:
306316
Q = Q[np.newaxis, :]

0 commit comments

Comments
 (0)