Skip to content

Commit

Permalink
adding documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jkobject committed Aug 6, 2024
1 parent 245084e commit 1a9d883
Show file tree
Hide file tree
Showing 7 changed files with 292 additions and 70 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ release: ## Create a new tag for release.
@git tag $${TAG}
@git push -u origin HEAD --tags
@echo "Github Actions will detect the new tag and release the new version."
@mkdocs gh-deploy
@echo "also pushed the documentation website"

.PHONY: docs
docs: ## Build the documentation.
Expand Down
60 changes: 50 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,73 @@
# grnndata
# GRnnData

[![codecov](https://codecov.io/gh/cantinilab/GRnnData/branch/main/graph/badge.svg?token=GRnnData_token_here)](https://codecov.io/gh/cantinilab/GRnnData)
[![CI](https://github.com/cantinilab/GRnnData/actions/workflows/main.yml/badge.svg)](https://github.com/cantinilab/GRnnData/actions/workflows/main.yml)
[![DOI](https://zenodo.org/badge/731236048.svg)](https://zenodo.org/doi/10.5281/zenodo.10573141)
[![PyPI version](https://badge.fury.io/py/GRnnData.svg)](https://badge.fury.io/py/benGRN)
[![Documentation Status](https://readthedocs.org/projects/GRnnData/badge/?version=latest)](https://GRnnData.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://pepy.tech/badge/GRnnData)](https://pepy.tech/project/GRnnData)
[![Downloads](https://pepy.tech/badge/GRnnData/month)](https://pepy.tech/project/GRnnData)
[![Downloads](https://pepy.tech/badge/GRnnData/week)](https://pepy.tech/project/GRnnData)
[![GitHub issues](https://img.shields.io/github/issues/cantinilab/GRnnData)](https://img.shields.io/github/issues/cantinilab/GRnnData)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![DOI](https://img.shields.io/badge/DOI-10.1101%2F2024.07.29.605556-blue)](https://doi.org/10.1101/2024.07.29.605556)

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.

Awesome gene regulatory network enhanced anndata created by @jkobject & remi trimbour
GRnnData is a subclass of anndata.AnnData, it enforces only that a .varp exists for the anndata

grnndata works similarly to anndata. The goal was to use the .varm of anndata to store the GRN data associated with a dataset and have a formal way to work with GRNs.
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,...

grnndata is a subclass of anndata.AnnData, it enforces only that a .varm exists for the anndata

grnndata also contains multiple helper functions to work with GRNs in scRNAseq
The package has been designed together with the [scPRINT paper](https://doi.org/10.1101/2024.07.29.605556) and [model](https://github.com/cantinilab/scPRINT), and the GRN benchmarking tool [BenGRN](https://github.com/jkobject/BenGRN)

## Install it from PyPI

```bash
pip install grnndata
```

### Install it locally and run the notebooks:

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

## Usage

```py
from grnndata import GRNAnnData
from grnndata import GRNAnnData, read_h5ad
from grnndata import utils

grn = GRNAnnData(subdata.copy(), grn=grn[1:,1:])
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](https://cantinilab.github.io/GRnnData/).
GRnnData works similarly to anndata. Learn more about usages in the documentation and its notebooks in the [docs](https://cantinilab.github.io/GRnnData/).

usage examples can be seen in the example notebooks of:
- [scPRINT](https://www.jkobject.com/scPRINT/notebooks/cancer_usecase/)
- [BenGRN](https://www.jkobject.com/benGRN/notebooks/bench_omni_genie3/)

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

Expand All @@ -42,3 +80,5 @@ In this context, we recommend trying to merge them across a similar group of cel
## Development

Read the [CONTRIBUTING.md](CONTRIBUTING.md) file.

Awesome gene regulatory network enhanced anndata created by @jkobject
67 changes: 60 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,73 @@
# grnndata (putting the grn in anndata)
# GRnnData

Awesome gene regulatory network enhanced anndata created by jkobject & remi trimbour
[![codecov](https://codecov.io/gh/cantinilab/GRnnData/branch/main/graph/badge.svg?token=GRnnData_token_here)](https://codecov.io/gh/cantinilab/GRnnData)
[![CI](https://github.com/cantinilab/GRnnData/actions/workflows/main.yml/badge.svg)](https://github.com/cantinilab/GRnnData/actions/workflows/main.yml)
[![PyPI version](https://badge.fury.io/py/GRnnData.svg)](https://badge.fury.io/py/benGRN)
[![Documentation Status](https://readthedocs.org/projects/GRnnData/badge/?version=latest)](https://GRnnData.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://pepy.tech/badge/GRnnData)](https://pepy.tech/project/GRnnData)
[![Downloads](https://pepy.tech/badge/GRnnData/month)](https://pepy.tech/project/GRnnData)
[![Downloads](https://pepy.tech/badge/GRnnData/week)](https://pepy.tech/project/GRnnData)
[![GitHub issues](https://img.shields.io/github/issues/cantinilab/GRnnData)](https://img.shields.io/github/issues/cantinilab/GRnnData)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![DOI](https://img.shields.io/badge/DOI-10.1101%2F2024.07.29.605556-blue)](https://doi.org/10.1101/2024.07.29.605556)

grnndata works similarly to anndata. The goal was to use the .varm of anndata to store the GRN data associated with a dataset and have a formal way to work with GRNs.
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 .varm exists for the anndata
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
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](https://doi.org/10.1101/2024.07.29.605556) and [model](https://github.com/cantinilab/scPRINT), and the GRN benchmarking tool [BenGRN](https://github.com/jkobject/BenGRN)

## Install it from PyPI

```bash
pip install grnndata
```

### Install it locally and run the notebooks:

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

## Usage

grnndata works similarly to anndata
```py
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](https://cantinilab.github.io/GRnnData/).

usage examples can be seen in the example notebooks of:
- [scPRINT](https://www.jkobject.com/scPRINT/notebooks/cancer_usecase/)
- [BenGRN](https://www.jkobject.com/benGRN/notebooks/bench_omni_genie3/)

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

Expand All @@ -28,4 +79,6 @@ In this context, we recommend trying to merge them across a similar group of cel

## Development

Read the [CONTRIBUTING.md](CONTRIBUTING.md) file.
Read the [CONTRIBUTING.md](../CONTRIBUTING.md) file.

Awesome gene regulatory network enhanced anndata created by @jkobject
2 changes: 1 addition & 1 deletion docs/notebooks/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@
},
"language_info": {
"name": "python",
"version": "3.10.0"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 1a9d883

Please sign in to comment.