Skip to main content

Awesome gene regulatory network enhanced anndata

Project description

GRnnData

codecov CI PyPI version Downloads Downloads Downloads GitHub issues Code style: black DOI

GRnnData works similarly to anndata. The goal was to use the .varm/.varp of anndata to store the GRN data associated with a dataset and have a formal way to work with GRNs.

GRnnData is a subclass of anndata.AnnData, it enforces only that a .varp exists for the anndata

GRnnData also contains multiple helper functions to work with GRNs in scRNAseq like compute_connectivities, get_centrality, compute_cluster, enrichment, metrics, etc. but also accessing the grn with .grn, .targets, .regulators,...

The package has been designed together with the scPRINT paper and model, and the GRN benchmarking tool BenGRN

Install it from PyPI

pip install grnndata

Install it locally and run the notebooks:

git clone https://github.com/cantinilab/GRnnData.git
pip install -e GRnnData

Usage

from grnndata import GRNAnnData, read_h5ad
from grnndata import utils

grn = np.random.rand(10,10)
adata = anndata.AnnData(X=np.random.rand(10,10))

grn = GRNAnnData(adata, grn=grn)

print(grn) #shows the number of elements
grn.varp['GRN'] or grn.grn #shows the GRN
subgrn = grn.get(['gene1', 'gene2']) #only gets some elements from the GRN
subgrn.targets #shows the target connections
subgrn.plot() # displays the network

subgrn.write_h5ad('grn.h5ad') #writes it
read_h5ad('grn.h5ad') #reads it

# or use some utils functions like:
# compute_connectivities
# get_centrality
# compute_cluster
# enrichment
# metrics
# see more in the documentation

utils.some_function(grn)

GRnnData works similarly to anndata. Learn more about usages in the documentation and its notebooks in the docs.

usage examples can be seen in the example notebooks of:

How do I do if I generate a GRN per cell type?

In this context, we recommend creating a grnndata per cell type. This will allow you to store the GRN data in the .varm of the grnndata and have a formal way to work with GRNs.

How do I do if I generate a GRN per cell?

In this context, we recommend trying to merge them across a similar group of cells in some way and storing uncertainty or variance in the GRN and then creating a grnndata across this group of cells

Development

Read the CONTRIBUTING.md file.

Awesome gene regulatory network enhanced anndata created by @jkobject and @r-trimbour

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

grnndata-1.3.1.tar.gz (13.1 MB view details)

Uploaded Source

Built Distribution

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

grnndata-1.3.1-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file grnndata-1.3.1.tar.gz.

File metadata

  • Download URL: grnndata-1.3.1.tar.gz
  • Upload date:
  • Size: 13.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for grnndata-1.3.1.tar.gz
Algorithm Hash digest
SHA256 48924745b701a6cf0336ce82b1d0e94569ae93877f7df7d6fa5a12f60e593498
MD5 0646953c52fa8ae9c97285a54f405a72
BLAKE2b-256 3d48587a2288a85ab22d8193d92b1a6009bec5000a40fb843571e2bec7ac60f4

See more details on using hashes here.

File details

Details for the file grnndata-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: grnndata-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for grnndata-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23f9470eec5978fb9ca770871efcc579497ec7596bd1a6bd7854d9cedffd0229
MD5 87d7537559f03903d394cc6968af2761
BLAKE2b-256 d187dfc66bf8905df98818783860ee41827de94ce310f6779ba3c9c15d5c4b89

See more details on using hashes here.

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