Expand description
Gene-set sources for enrichment, reduced to one common term → gene-set
form regardless of origin:
- GAF (GO Consortium gene-association format): one annotation per row,
gene → GO id; propagated up the ontology (true-path rule) intoterm → genes. Readread_gafthenGafRaw::into_gene_sets. - GMT (MSigDB): one gene-set per row,
term <TAB> description <TAB> genes…; taken as-is, no propagation. Readread_gmt.
Each gene carries the identifier aliases the source provides (symbol /
accession / synonyms for GAF) so a downstream reconciler can match it against
an expression dictionary whether that uses HGNC, ENSG, or ENSG_HGNC.
Structs§
- GafOpts
- Options for
read_gaf. - GafRaw
- Raw GAF annotations before ontology propagation: gene key → direct GO ids, plus the per-gene identifier aliases harvested from the GAF.
- Gene
Sets - A collection of gene-sets keyed by term id — the common form all sources (GAF/GMT/markers) reduce to before scoring.
- Reconciled
- Gene-sets reconciled against an expression dictionary: term → matched row indices, plus coverage statistics. This is the sparse membership the enrichment scorer consumes (term → its rows in the gene profile).
Constants§
- COVERAGE_
WARN_ FRAC - Below this matched-gene fraction,
Reconciled::log_coveragewarns rather than logs at info — a thin overlap silently produces no enrichment.
Functions§
- read_
gaf - Parse a GAF (
.gafor.gaf.gz). Columns (1-based) used: 2 = object id / accession, 3 = symbol (the gene key), 4 = qualifier (rows withNOTare dropped), 5 = GO id, 7 = evidence code (forno_iea), 11 = synonyms, 12 = object type (only proteins and genes are kept). The symbol, accession, and pipe-split synonyms are kept as match aliases. - read_
gmt - Read an MSigDB-style GMT: each non-comment line is
term <TAB> description <TAB> gene1 <TAB> gene2 …. Terms are used verbatim (they become tree nodes only if they resolve against an--obo); genes are their own keys with no extra aliases; no propagation. - read_
membership_ pairs - Parse a two-column membership file —
gene <TAB> label(a marker panel, a TF→target list, any gene→category table) — into(gene, label)pairs via the shared, gz-aware line reader (tab or comma delimited). Takes the first two tokens per line; skips blank lines,#comments, agene/symbolheader row and rows missing a label. Labels are kept verbatim; genes are not case-folded.