Repository navigation
xcell 0.3.0
-
CNV inference and clone calling (Analyze → Cells → CNV inference). An inferCNV-style analysis for tumor data: log expression relative to reference (normal) cells you tick from a categorical column, clipped at ±3, averaged in windows of 100 genes every 10 along each chromosome, centred per cell, with inferCNV's dynamic noise threshold. Clones come from Leiden on the CNV profile or Ward linkage cut into a fixed number, named by rising CNV burden (
clone_1is the quietest); the result table shows each clone's size, burden, share of the reference cells and dominant input group. Gene positions come from shipped GENCODE tables (human GRCh38, mouse GRCm39,backend/xcell/data/gene_positions_*.tsv.gz, built bybuild_gene_positions.py) matched by Ensembl ID or symbol, or from two.varcolumns. Writesobsm['X_<key>'], a registered per-chromosome score matrixX_<key>_chrom,<key>_scoreand<key>_clone(unassignedoutside the cell mask), anduns['xcell_cnv'][key]. With several reference categories a gene within the range of their means counts as normal (infercnvpy's bounds rule); X and Y are excluded by default. Hierarchical clustering is refused above 20,000 cells.- CNV heatmap figure (new figure kind
cnv_heatmap): cells binned within each group, or one mean row per group, × genome windows with chromosome separators, diverging colours, PNG export. Heatmap figure… in the modal saves one grouped by clone. - Pure
xcell/cnv.py(no new dependencies);prepare_cnvbackground task;GET /api/cnv/status,POST /api/cnv,GET /api/cnv/results;codegenentry so the notebook export replays it. - Benchmarked against copy-number truth (
docs/measurements/2026-10-13-cnv-benchmark.md, harness inbackend/benchmarks/cnv/): the SNU601 and NUGC4 gastric lines with scWGS, the MM199 myeloma and BCC06 carcinoma samples with WES, a four-patient BCC mix for clone recovery and a PBMC diploid control, from Schmid et al. 2025 (Nat Commun). Four changes came out of it: clones are called on the un-thresholded window matrix (patient ARI 0.40 → 0.98), the expression floor drops from 0.1 to 0.02 mean log expression (max F1 up on every dataset), the Leiden resolution default is 0.5 (1.0 cut 9k cells into 24 clones), a reference category needs 50 cells to set the multi-reference bounds (a 44-cell doublet cluster erased every per-cell event in MM199: tumor-vs-normal AUROC 0.46 → 0.92), and immunoglobulin / TCR / MHC genes are excluded by default. Profile accuracy matches or beats infercnvpy on all four truth sets.
- CNV heatmap figure (new figure kind
-
A developmental GO slim, shipped as curated bundles (Genes → Sets → Import). Four new bundles beside the signaling pathways: Developmental GO slim, coarse and fine, each for mouse and human. The coarse bundle is 32 sets, one per major developmental process or organ system on two axes — mechanism (pattern specification, cell fate commitment, stem cell maintenance, gastrulation, blastocyst, epithelial morphogenesis, mesenchyme, migration, proliferation, growth, developmental apoptosis, the signaling pathways, ECM, adhesion, chromatin) and anatomy (nervous, neural crest, circulatory, hemopoiesis, skeletal, muscle, renal, respiratory, digestive, gland, epidermis, sensory, craniofacial, reproductive, limb, placenta, connective tissue) — sized for enrichment (30 to 2,296 mouse genes). The fine bundle nests 200 narrower terms under those as folders (chondrocyte differentiation under skeletal; left/right pattern formation under pattern specification; canonical and non-canonical Wnt, BMP, TGF-β, activin, nodal, Notch, FGF, Hedgehog, retinoic acid, Hippo, ephrin, EGF, PDGF, VEGF and IGF under signaling), sized for scoring cells (1 to 694 genes; 25 terms have fewer than 20 mouse genes and are kept for enrichment). A set is the GO term's annotated genes with descendants included, the same closure as the GO library; by GO's convention regulation of annotations do not propagate, so Ptch1 and Hhip are absent from the Hedgehog set and Dkk1 from Wnt unless annotated to the pathway itself. Human sets come from goa_human directly, not by ortholog mapping. The table is
backend/xcell/data/dev_goslim.tsv(cross=xmarks a fine term placed under a coarse term it does not descend from in GO: osteoblast differentiation under skeletal, liver under digestive) andbuild_dev_goslim.pyregenerates the bundles from it, refusing a wrong, obsolete or misnamed id, an unflagged cross-link, or a duplicate, and printing every size and each sibling pair with Jaccard above 0.5 (somitogenesis ~ somite development 0.82, mesonephros ~ ureteric bud 0.93 are the closest). Built from GO releases/2026-07-26 and the 2026-01-05 GAFs.docs/dev-goslim.mdrecords the derivation for users of the lists: source files and versions, the closure rule and what it excludes, the carve parameters (carve_dev_goslim_candidates.py, 40–350 mouse genes, Jaccard < 0.5, 14 per root), every curation decision, the 32 coarse terms with their sizes, the known redundancies and gaps, and how to regenerate. Design note:docs/superpowers/specs/2026-10-08-dev-goslim-design.md; 30 backend tests. -
GO slims as importable libraries (Genes → Sets → Library → Gene Ontology). The Gene Ontology source now lists, beside GO annotations, three slim libraries: the GO Consortium's generic slim (140 terms), the Alliance of Genome Resources AGR slim (53 terms) for human and mouse, and MGI's mouse slim (45 terms) for mouse. A slim is a
subset:tag on terms inside go-basic.obo, so each library is built from the ontology and GAF already on disk — one set per slim term with ancestors included and no size cap (the ~2,000-gene terms are the point of a slim) — and only downloads the two files if they are not there; refetching GO annotations is still what refreshes them. MGI's own GO-slim page defines its categories with OR/EXCLUDING combinations that, as the page says, standard tools cannot apply, so the mouse slim here is the one MGI distributes through GO. On mouse the generic slim gives 133 sets (7 of its terms have no annotated mouse gene). Catalogues that are code rather than a download (GO, MGI GXD, OmniPath) are no longer served from the cached catalogue file, which would have hidden a library added in a newer build for up to the 7-day TTL.go_semantic.slim_sets; 7 backend tests.