Fair highly variable gene selection for single-cell RNA-seq
Project description
scFair
scFair selects highly variable genes (HVGs) for single-cell RNA-seq while giving small cell populations a fairer chance at the gene list.
Standard HVG ranking is driven by the largest populations. Markers that matter for rare types can fall just below the cutoff even when they are exactly what you need later for clustering or annotation. scFair keeps a familiar global ranking as the backbone and, by default, appends a small extension from the same ranking so near-miss genes are not discarded.
Docs: Read the Docs.
What you need
- Python 3.10+ (tested 3.10–3.12)
- An AnnData object with raw integer counts in
.Xorlayers["counts"]
Install
pip install scfair
First run
import scfair as scf
# raw integer counts in .X or layers["counts"]
scf.pp.highly_variable_genes(adata)
adata = adata[:, adata.var["highly_variable"]].copy()
That is the default path: one global HVG pass, then a small append of the next
genes in the same ranking. Runtime is on the same order as
scanpy.pp.highly_variable_genes.
To let the data suggest how many genes to keep:
scf.pp.highly_variable_genes(adata, n_top_genes="auto")
To match scanpy with no extension:
scf.pp.highly_variable_genes(adata, balance_method="none")
Status
0.6.0 (Beta). Import as import scfair as scf and use names in
scfair.__all__ and scf.pp. See the
API reference.
Next steps
- Installation
- Quickstart
- Tutorial: PBMC 10k misclustered cells vs standard HVG
- FAQ if something looks off
License
Software: Apache License 2.0.
Author
Zhao Li (李钊)
Email: leelieber@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scfair-0.6.0.tar.gz.
File metadata
- Download URL: scfair-0.6.0.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c82d55fe7de1dd8be92f59c19891159e1ea8d27795a74e241e9ad3f70c21bfad
|
|
| MD5 |
b5aeacc36d1078df6df7a228884fc0dd
|
|
| BLAKE2b-256 |
27e9e352329fcc0741583d39a8432923c8216f12c48465e6418c4bc71f6553ef
|
Provenance
The following attestation bundles were made for scfair-0.6.0.tar.gz:
Publisher:
publish.yml on leelieber2025/scFair
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scfair-0.6.0.tar.gz -
Subject digest:
c82d55fe7de1dd8be92f59c19891159e1ea8d27795a74e241e9ad3f70c21bfad - Sigstore transparency entry: 2327047899
- Sigstore integration time:
-
Permalink:
leelieber2025/scFair@e826f1cfdf9b13b7dc647ca73eb60bdf20b8a72b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/leelieber2025
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e826f1cfdf9b13b7dc647ca73eb60bdf20b8a72b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scfair-0.6.0-py3-none-any.whl.
File metadata
- Download URL: scfair-0.6.0-py3-none-any.whl
- Upload date:
- Size: 121.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1fa147b286aeb9022fd901d1c32116c339620650726f9697ab3d8bd40b5e352
|
|
| MD5 |
e858e4174e5d8a512c79da4dc209a2d4
|
|
| BLAKE2b-256 |
c27199535cf345ace86fee67cfb2d761d02cc71d75c70b3183a247d3ec3842d6
|
Provenance
The following attestation bundles were made for scfair-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on leelieber2025/scFair
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scfair-0.6.0-py3-none-any.whl -
Subject digest:
d1fa147b286aeb9022fd901d1c32116c339620650726f9697ab3d8bd40b5e352 - Sigstore transparency entry: 2327047995
- Sigstore integration time:
-
Permalink:
leelieber2025/scFair@e826f1cfdf9b13b7dc647ca73eb60bdf20b8a72b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/leelieber2025
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e826f1cfdf9b13b7dc647ca73eb60bdf20b8a72b -
Trigger Event:
workflow_dispatch
-
Statement type: