scFair Documentation

Contents

scFair Documentation#

PyPI version PyPI downloads Bioconda Conda downloads Python versions CI License DOI bioRxiv

scFair selects highly variable genes for scRNA-seq. The default call estimates a base list size from multi-seed density structure, then keeps that global top-k and appends a short same-rank tail.

import scfair as scf

scf.pp.highly_variable_genes(adata)  # writes adata.var["highly_variable"]

Raw integer counts belong in .X or layers["counts"]. Leave the gene axis intact; sc.tl.pca reads the HVG mask.

If you need

Pass

A protocol-fixed length

n_top_genes=2000

Exact top-k (scanpy-sized)

n_top_genes=2000, balance_method="none"

A label-free population count

scfair.pp.estimate_n_populations() after sc.pp.neighbors

Auto builds extra neighbor graphs, so it is slower than a fixed k. Read How selection works for the estimator and the append rule.

Page

Contents

Installation · Quickstart

Install and a first call

PBMC 3k

PBMC 3k: QC → HVG → Leiden / UMAP

PBMC 10k: top-2000 vs top-2000 plus append

PBMC 10k: top-2000 vs top-2000 + append

User Guide

Method, parameters, outputs

API Reference

Signatures

FAQ / Troubleshooting

Troubleshooting

Citation

Preprint and software DOI

Citation#

Li, James & Li, 2026. bioRxiv 10.64898/2026.08.08.743679. BibTeX: Citation.

Author#

Zhao Li (李钊) leelieber@gmail.com