Installation¶
pip install -e ".[dev,fast]"
devinstallspytest(needed for the test suite) plusruffandpre-commitfor linting and formatting.fastinstallsnumba, which JIT-compiles the CRT sampler's cell-grouping step (a counting sort). Without it,pysceptrefalls back to a slower pure-numpyargsort-based version automatically, and everything exceptrun_trans_analysisstill works, just slower at real dataset scale. The fallback lists a resample's cells in another order, so a CRT result can differ in its last bits from one made with numba;run_trans_analysis, which must reproduce a reference run bit for bit, needs numba and raisesRuntimeErrorwithout it.ioinstallsmudata,anndata,pyarrowandmatplotlib. These are needed only by the dataset-export and benchmarking scripts underscripts/, not by the package:run_discovery_analysistakes in-memory arrays, so calling it does not require them.
Requires Python >= 3.10. Core dependencies: numpy, scipy, pandas,
threadpoolctl.
Datasets¶
The analysis functions take plain arrays, so any route that produces them
works. The scripts/ directory also carries one out of R end to end:
export_sceptre_dataset.R extracts a post-QC sceptre_object, and
make_h5mu.py converts that to a MuData .h5mu with two assays --
rna (cells x genes counts) and grna (cells x assignment units, whose
var marks each unit as a per-target union or an individual non-targeting
gRNA). scripts/sceptre_io.load_export reads one back, and with
backed=True serves genes from disk on demand rather than holding the whole
matrix. A backed read of the cells in use needs a file holding only those
cells, which scripts/write_in_use_h5mu.py writes from an export that kept
every cell (the export's default). load_export_compact instead holds only
the genes a run needs, restricted to the cells in use. Read from a .h5mu,
the covariate matrix comes back row-major whatever the file: BLAS rounds a
row-major and a column-major matrix differently, and one layout gives every
such file the same bits.