Skip to main content

Binomial deviance feature selection for single-cell count data (AnnData)

Project description

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).

Project details


Download files

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

Source Distribution

pyscry-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

pyscry-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pyscry-0.1.0.tar.gz.

File metadata

  • Download URL: pyscry-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyscry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2d6259141d26bda9233e1decd317b6569aa0bd15b5a355d828b6ecf4aaeb746
MD5 3bb36ebf8f9f8cb19904d2177245556b
BLAKE2b-256 c8e9c6b5b9c285e287450b00adfc9759097bff3b41f276533f2f7c99c689a46a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyscry-0.1.0.tar.gz:

Publisher: publish.yml on shahrozeabbas/pyscry

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

File details

Details for the file pyscry-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyscry-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyscry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e4d14f4b4670efca09966dae2a81252fdbc483dd4a57b7368fab061d9acc515
MD5 74ece9b753bcfd62c113c38c93f7879c
BLAKE2b-256 1f579a6dee7576c2161736a2c80d5854a864e0c6556a50dbdc86e3ee865459ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyscry-0.1.0-py3-none-any.whl:

Publisher: publish.yml on shahrozeabbas/pyscry

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 Pingdom Monitoring Sentry Error logging StatusPage Status page