Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Scarf

PyPI Python 3.12, 3.13, and 3.14 Docs Tests Coverage

Scarf is a Python framework for analysing single-cell RNA, ATAC, protein, and multi-omic data, from a few thousand cells to tens of millions.

Problem How Scarf solves it What you get
Your dataset is larger than RAM Out-of-core algorithms , and neighbour search streams from cell-major and gene-major layouts, inside a memory budget you set No subsampling, so rare populations survive, benchmarked to 10M cells
The data is stored remotely and requires downloading Fetches only the chunks an operation touches, and writes results to a store you own Start analysing immediately, with one authoritative copy
A single parameter change costs hours of computation Each step is fingerprinted by its settings and inputs, so reuse is by content, not by layer name Only what changed recomputes, and the old version stays for comparison
Sub-population analysis leaves scattered copies that nobody can trace back Subsets are masks in one file, and every result carries the cells and parameters behind it A year later, a result still explains itself

Install

Python 3.12+.

uv venv --python 3.12
uv pip install --python .venv "scarf[extra]"

Detailed installation instructions here

Quick start

import scarf

reader = scarf.CrH5Reader("filtered_feature_bc_matrix.h5")
scarf.CrToZarr(reader, zarr_loc="data.zarr").dump()

ds = scarf.DataStore("data.zarr", nthreads=4)
ds.pipeline.run()

ds.plots.embedding(
    layout_key="RNA_UMAP",
    color_by="RNA_clusters",
)

Read the scRNA-seq tutorial for granular analysis workflow.

Scarf's capabilities

Compressed count chunks feed incremental algorithms and a neighbourhood graph that serves embedding, clustering, mapping, imputation, downsampling, and pseudotime

Area Methods
Modalities scRNA-seq, scATAC-seq, CITE-seq, matched multi-omics
Core workflow Quality control, feature selection, normalization, PCA and LSI, KNN graph, UMAP, densMAP, t-SNE, Leiden, Paris, marker search
Integration Harmony, partial PCA, shared and weighted nearest neighbours, integration metrics
Mapping Symphony-style reference mapping, label transfer, projection diagnostics
Trajectory Population Balance Analysis pseudotime, expression dynamics and modules, multi-sink fate probabilities
Also included Cell-cycle scoring, gene-set activity, graph-diffusion imputation, doublet scores, HTO demultiplexing, TopACeDo downsampling, pseudobulk export

Documentation

Read workflow vignettes and API references on Read The Docs 📖

AI-assisted and autonomous workflows should start with Analysis with AI agents.

Citation

Dhapola et al. Scarf enables a highly memory-efficient analysis of large-scale single-cell genomics data. Nature Communications 13, 4616 (2022).

Support

GitHub issues

Scarf is open source with BSD 3-Clause License and maintained by Nygen.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scarf-1.0.0rc1.tar.gz (714.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scarf-1.0.0rc1-py3-none-any.whl (808.2 kB view details)

Uploaded Python 3

File details

Details for the file scarf-1.0.0rc1.tar.gz.

File metadata

  • Download URL: scarf-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 714.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scarf-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 91b23a8cf3508e2f3c20201960af7916ecfc88110be18f91fd58a6b790992929
MD5 0543c8361a8dba190616e40e6bef139e
BLAKE2b-256 92847932c1cf8e63252753de5566ee3ba158359c6f94f47f70fe7f3a39628237

See more details on using hashes here.

Provenance

The following attestation bundles were made for scarf-1.0.0rc1.tar.gz:

Publisher: publish.yml on NygenAnalytics/scarf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scarf-1.0.0rc1-py3-none-any.whl.

File metadata

  • Download URL: scarf-1.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 808.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scarf-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 16aa64fc7abce74b5c537d763985d931d4a9ac04c5b2325086df9c35077e5f70
MD5 8b9458a5a698820a07bee85f8b32dba7
BLAKE2b-256 985eef48e414dd54715bf7cc1cc32459a6fcf9289541f2353266e2fb6d624491

See more details on using hashes here.

Provenance

The following attestation bundles were made for scarf-1.0.0rc1-py3-none-any.whl:

Publisher: publish.yml on NygenAnalytics/scarf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page