Skip to main content

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

UMAP of top 4 rare cell type markers for PBMCs

R package

Link to R package:

https://github.com/ScialdoneLab/CIARA/

Release files for ciara-python 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ciara-python 1.0.4
File Size Uploaded
ciara_python-1.0.4.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ciara-python 1.0.4
File Interpreter ABI Platform
ciara_python-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size:8.9 kB

Release files / ciara_python-1.0.4.tar.gz

Download URL ciara_python-1.0.4.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0e778b8c72a7fff1d3dd0cd617f7f7c80183ae84debd699b7398ce765329bbaa
BLAKE2b-256 checksum
How to use checksums
9930291c268981a76e9bc2cef00d6de065768dfebc5fd49185449a8924bcfe74
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ciara_python-1.0.4-py3-none-any.whl

Download URL ciara_python-1.0.4-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cdde78bb2c19bc19b46ea7604e04bc1c98d71d5a11fa6b4146c9734238489ea
BLAKE2b-256 checksum
How to use checksums
90164dc7c0bd7b8037db620d37d95c8891373a1bbba67f8da06b596d8d5a791f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.9.9

2 release files

0.9.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page