Skip to main content

pyscry

PyPI version

Python implementation of binomial deviance feature selection for single-cell count data (non-negative integer matrices), following the multinomial-model view in Townes et al. (2019) and the scry R package. Typical uses include scRNA-seq UMIs and scATAC-seq (or similar) peak or bin counts in AnnData; the method ranks features (adata.var) by deviance under a common null proportion.

Installation

pip install pyscry

Usage

import pyscry

pyscry.highly_deviant_features(adata, n_top_features=2000)

Expects raw (or raw-like) non-negative integer counts in adata.X or a named layer (e.g. UMIs, or ATAC fragments per peak).

Parameters

Parameter Type Description
adata AnnData Count matrix (cells × features; e.g. genes or peaks)
n_top_features int Number of top features to select
layer str | None Layer to use instead of adata.X
subset bool Subset adata to selected features (default False)
inplace bool Write results into adata.var (default True)
batch_key str | None Obs key for batch; deviance is summed across batches
check_values bool Warn if data are not non-negative integers (default True)

Outputs

When inplace=True:

  • adata.var['binomial_deviance'] -- deviance score per feature
  • adata.var['highly_variable'] -- boolean selection mask

Citation

If you use pyscry, cite the original method paper (written in the scRNA-seq setting; the deviance feature-screening idea applies to other multinomial-style count tables as well):

Townes FW, Hicks SC, Aryee MJ, Irizarry RA (2019). Feature selection and dimension reduction for single-cell RNA-Seq based on a multinomial model. Genome Biology 20:295. https://doi.org/10.1186/s13059-019-1861-6

If citing this Python implementation specifically:

pyscry: Binomial deviance feature selection for AnnData (2026).

Release files for pyscry 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyscry 0.1.0
File Size Uploaded
pyscry-0.1.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyscry 0.1.0
File Interpreter ABI Platform
pyscry-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / pyscry-0.1.0.tar.gz

Download URL pyscry-0.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c2d6259141d26bda9233e1decd317b6569aa0bd15b5a355d828b6ecf4aaeb746
BLAKE2b-256 checksum
How to use checksums
c8e9c6b5b9c285e287450b00adfc9759097bff3b41f276533f2f7c99c689a46a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.

Transparency log

Release files / pyscry-0.1.0-py3-none-any.whl

Download URL pyscry-0.1.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e4d14f4b4670efca09966dae2a81252fdbc483dd4a57b7368fab061d9acc515
BLAKE2b-256 checksum
How to use checksums
1f579a6dee7576c2161736a2c80d5854a864e0c6556a50dbdc86e3ee865459ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page