Giter Site home page Giter Site logo

cantinilab / grnndata Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 15.87 MB

Awesome GRN enhanced AnnData toolkit

Home Page: https://cantinilab.github.io/GRnnData/

License: GNU General Public License v3.0

Dockerfile 0.03% Makefile 1.50% Python 11.70% Jupyter Notebook 86.78%
anndata gene-regulatory-network rna-seq scverse single-cell utils

grnndata's Introduction

GRnnData

codecov CI PyPI version Documentation Status 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

grnndata's People

Contributors

dependabot[bot] avatar jkobject avatar r-trimbour avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.