Saber reconstructs two non-negative, total-preserving expression channels from a single-cell gene-expression matrix. The two channels capture complementary cross-cell expression distributions for each gene. They are exchangeable by default: biological direction is assigned only when an external anchor or reference is supplied after reconstruction.
This repository contains the core implementation used in the accompanying manuscript, its software environment and a small executable example. It does not contain raw sequencing data, large processed matrices, or dataset-specific downstream analysis and visualisation code.
The tested environment can be created with Conda:
conda env create -f environment.yml
conda activate saberRun the included example from the repository root:
bash run_example.shThe script creates a small AnnData object, runs Saber on three genes and checks that the two returned matrices sum to the supplied expression matrix.
The input .h5ad file should contain cells in rows, genes in columns and a
finite, non-negative expression matrix in .X.
source config/example_run.env
python saber/run.py DATA_ROOT INPUT.h5ad OUTPUT_ROOT RUN_NAMEResults are written to
OUTPUT_ROOT/RUN_NAME/final/Pearson/. The primary channel matrices are
adata_F.h5ad and adata_M.h5ad; these filenames are retained for software
compatibility and correspond to Channel 1 and Channel 2 unless an external
orientation step is enabled. exp_combined.csv contains both channel values,
and gene_numerical_status.tsv records estimation status by gene.
By default Saber uses all available cores for gene-level fitting. Set
SABER_N_JOBS before execution to choose a different number. Other settings
and their defaults are listed in config/runtime_defaults.tsv.
Saber fitting uses total expression only. Optional marker-anchor and
reference-matrix orientation are disabled by default and are configured through
the environment variables documented in config/runtime_defaults.tsv.
Orientation selects a direct or swapped channel order; it does not refit or
rescale the reconstructed profiles.
saber/: mixture fitting, constrained reconstruction, readout and optional orientationconfig/: documented runtime settingstests/: the executable example and focused contract teststools/: the prespecified readout-profile selection helper
Quantitative figure values are provided separately as Source Data with the manuscript. Public dataset accessions and preprocessing choices are described in the Methods and Supplementary Information.