Skip to content

Installation

pip install -e ".[dev,fast]"
  • dev installs pytest (needed for the test suite) plus ruff and pre-commit for linting and formatting.
  • fast installs numba, which JIT-compiles the CRT sampler's cell-grouping step (a counting sort). Without it, pysceptre falls back to a slower pure-numpy argsort-based version automatically, and everything except run_trans_analysis still 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 raises RuntimeError without it.
  • io installs mudata, anndata, pyarrow and matplotlib. These are needed only by the dataset-export and benchmarking scripts under scripts/, not by the package: run_discovery_analysis takes 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.