navis.nbl.extract_matches¶
- navis.nbl.extract_matches(scores, N=None, threshold=None, percentage=None, axis=0, distances='auto')[source]¶
Extract top matches from score matrix.
See N, threshold or percentage for the criterion.
- Parameters:
scores (pd.DataFrame) – Score matrix (e.g. from
navis.nblast()
).N (int) – Number of matches to extract.
threshold (float) – Extract all matches above a given threshold.
percentage (float [0-1]) – Extract all matches within a given range of the top match. E.g. percentage=0.05 will return all matches within 5% of the top match.
single_cols (bool) – If True will return single columns with comma-separated strings for match ID and match score, respectively.
axis (0 | 1) – For which axis to produce matches.
distances ("auto" | bool) – Whether scores is distances or similarities (i.e. whether we need to look for the lowest instead of the highest values). “auto” (default) will infer based on the diagonal of the scores matrix. Use boolean to override.
- Returns:
Note that the format is slightly different depending on the criterion.
- Return type:
pd.DataFrame