"Cluster Independent Algorithm for the identification of RAre cell types."
Project description
CIARA
(Cluster Independent Algorithm for the identification of markers of RAre cell types)
Python implementation of the CIARA algorithm that integrates into scanpy's analysis with the AnnData format.
The package can be installed via pip:
python -m pip install ciara_python
Note: The package only works on UNIX / MacOS operating systems, not on Windows systems, due to the copy-on-write multiprocessing setup used.
Tutorial
The functions are designed to work with scanpy's AnnData objects. For an interactive tutorial check out the Human Gastrula IPython Notebook which is also part of this repository.
First you load your dataset as a scanpy object and after normal preprocessing calculate the knn-network:
import scanpy as sc
pbmc = sc.datasets.pbmc3k()
sc.pp.filter_cells(pbmc, min_genes=50)
sc.pp.filter_genes(pbmc, min_cells=10)
sc.pp.log1p(pbmc)
sc.pp.pca(pbmc)
sc.pp.neighbors(pbmc)
The CIARA package contains the two main functions get_background_full()
and ciara()
which should be imported via:
from ciara_python import get_background_full, ciara
Afterwards, the background genes get marked by running the get_background_full()
function on your scanpy dataset. This adds the boolean column 'CIARA_background' to your pbmc.var
AnnData slot, where relevant background genes are marked.
get_background_full(pbmc, threshold=1, n_cells_low=2, n_cells_high=5)
Finally, the ciara()
function is run on the dataset. This adds the column 'CIARA_p_value' to your pbmc.var
object, where the calculated p_values for each of the previously marked background genes are stored.
ciara(pbmc, n_cores=4, p_value=0.001, approximation=True, local_region=1)
We can then extract the top markers or rare cells (lowest CIARA_p_value) and plot them onto the UMAP:
from matplotlib.pyplot import rc_context
sc.tl.umap(pbmc)
top_markers = pbmc.var.nsmallest(4, ["CIARA_p_value"],)
with rc_context({'figure.figsize': (3, 3)}):
sc.pl.umap(pbmc, color=top_markers.index.tolist())
R package
Link to R package:
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
Built Distribution
File details
Details for the file ciara_python-1.0.4.tar.gz
.
File metadata
- Download URL: ciara_python-1.0.4.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.62.2 importlib-metadata/4.5.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e778b8c72a7fff1d3dd0cd617f7f7c80183ae84debd699b7398ce765329bbaa |
|
MD5 | d9337beb333692e536b9e56d143214fb |
|
BLAKE2b-256 | 9930291c268981a76e9bc2cef00d6de065768dfebc5fd49185449a8924bcfe74 |
File details
Details for the file ciara_python-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: ciara_python-1.0.4-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.62.2 importlib-metadata/4.5.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cdde78bb2c19bc19b46ea7604e04bc1c98d71d5a11fa6b4146c9734238489ea |
|
MD5 | 9f052218be0a3293f2425533f8a0944f |
|
BLAKE2b-256 | 90164dc7c0bd7b8037db620d37d95c8891373a1bbba67f8da06b596d8d5a791f |