Skip to main content

Module name_matching

Module name_matching 

Source

Structs§

GeneIndex
Pre-built index over a gene-name vocabulary for fast marker→row matching. Resolves a query gene in tiers, returning the first matching row:
RowTypeFilter
Comma-separated case-insensitive substring filter, parsed once and matched many times. Used by --select-row-type / --remove-row-type / --hto-row-type so callers can pass e.g. "gene,peak" to match either “Gene Expression” or “Peaks”.

Functions§

compose_id_name
Combine feature IDs and names into composite id_name strings. If a name is empty or already equals the ID (e.g. 10x ATAC peaks where both features/id and features/name are chr1:1000-2000), the ID is used as-is to avoid chr1:1000-2000_chr1:1000-2000 duplication.
contains_ignore_ascii_case
Bytewise case-insensitive substring search. ASCII only; non-ASCII bytes compare verbatim. Allocation-free.
filter_row_indices_by_type
Return indices of rows whose type passes select/remove filtering.
flexible_name_match
Flexible gene name matching (case-insensitive, underscore-delimited) Returns true if query matches target with these rules:
idf_weight
Inverse-document-frequency marker weight ln(C / df): a gene claimed by all C types gets weight 0 (removed from scoring), a type-exclusive gene the maximum ln(C).
make_names_unique
Make duplicate names unique by appending -1, -2, etc. to repeated entries. Similar to scanpy’s var_names_make_unique().
match_by_substring
Match names by substring queries and return matched indices and names
split_id_name
Inverse of compose_id_name: split a composite id{ROW_SEP}name display name back into (id, name) on the first ROW_SEP. When there is no separator (a bare symbol, or an id-only composite where name was empty or equalled id) both parts are the whole string, so a 10x features.tsv still gets a non-empty gene name.