Package to decipher LRI-mediated brain network communication
Project description
CLRIA
CLRIA: connectome-constrained ligand-receptor interaction analysis for understanding brain network communication
Installation
-
Install from PyPI:
pip install clria -
install from source:
git clone git@github.com:duzc-Repos/CLRIA.git cd CLRIA pip install .
-
[Optional] install pytorch for GPU acceleration, see pytorch.org for detail.
Usage
Quick example
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import clria
## 0. simulation data
n_rank = 5
n_region = 100
n_lrpair = 20
eps = 1e-100
r, A, B, C, L, R, TL, TR, M, (M1, M2) = clria.otsim.simu_data(
n_r=n_rank, n1=n_region, n_lr=n_lrpair, ## r, A, B, C
TL=10, TR=15, ## L, R, TL, TR
scale_factor=1e4, epsilon=1, ## M,
is_decomposition=True, n_d=10, solver="nmf", ## (M1, M2)
eps=eps)
## 1. solver
epsi, tau = 0, 1
r = 5
mmot_obj = clria.ottl.MMOTNTD(L, R, M, TL, TR, epsilon=epsi, tau1=tau, tau2=tau,)
mmot_obj.fit(r=r)
(Ae, Be, Ce) = mmot_obj.factors
tca_obj = clria.ottl.TCA(Ae, Be, Ce)
## 2. plotting
annot = pd.DataFrame({ i:[f"network_{i//20+1}"] for i in range(100) }).T ## random generate annotation
clria.otpl.plot_sankey(tca_obj, annot, figure_size=(600, 700))
Notebook
-
See
./tutorial/tutorial.ipynbfor an application of CLRIA to publicly available gene expression (AHBA) and diffusion MRI (HCP) data. The data used in this tutorial can be found at https://zenodo.org/records/15005583 -
The code to replicate the analysis of the study are available at https://zenodo.org/records/13906808.
API
Here is a brief list of the functionalities provided by this repository. Additional information is provided in their docstring or by calling help(function_name).
preprocessing: otpp
otpp.LRdatabse(lrdb, ...):.extract_lr_expression(self, expr, ...): extract ligand and receptor expression from gene expression matrix..generate_coupling_matrix(self, ...): generate two matrix $T_L, T_R$ recoding the correspondence between LR pairs and ligand or receptor.
otpp.BNCM():.proximal_to_distance(self, SC): transfrom the fiber density measure to distance measures..calc_navigation(self, L, D): calculate navigation measure based on $L$ (strength-to-length remapping of the connection weight) and $D$ (distance matrix, e.g. Euclidean distance between nodes)
tools: ottl
ottl.MMOTNTD(L, R, M, TL, TR, ...).fit(self, r): solve LR-mediated communication patterns $A, B, C$.
ottl.gen_PermM(surf_files, info, ...): generate spatial-preserving permutation idx.ottl.TCA(A, B, C):.calc_T_statistics_matrix(self): infer region-wise asymmetrix signaling across all LR pairs..analyze_trans_hierarchical_signaling_cortex(self, hierarchy, ...): infer trans-hierarchical asymmetrix signaling between cortical regions by KS test..analyze_trans_hierarchical_signaling_cortex_spin(self, hierarchy, ...): infer trans-hierarchical asymmetrix signaling between cortical regions by spin test..analyze_trans_hierarchical_signaling_cortex_and_subcortex(self, hierarchy, ...): infer trans-hierarchical asymmetrix signaling between cortical and subcortex regions by KS test..graph_spectrum_analysis(self, hamonics, SC): energy density analysis of asymmetrix signal of each LR pair..get_pathway_network(self, pathway_name, ...): reconstruct pathway-specific communication network from communication pattters..get_lr_network(self, idx, ...): reconstruct LR-specific communication network from communication pattters..identify_dominant_LR_from_Ce(self, ...): identify domiant LR pairs for each tensor factor..prepare_ROI_from_Ae_Be(self, atlas_nii, ...): prepare ROI files of each tensor factor for Neurosynth analysis.
ottl.UOTRegression(pattern, ...).fit(src, dst, ...): solve UOT regression between source state and target state..get_opt_UOT_dist(self, beta, P): compute UOT distance value..get_opt_obj_val(self, beta, P, src, dst): compute objective function values.
ottl.OTRegression(pattern, ...): an balanced version ofUOTRegression.fit(src, dst, ...): solve OT regression between source state and target state..get_opt_OT_dist(self, beta, P): compute OT distance value..get_opt_obj_val(self, beta, P, src, dst): compute objective function values.
plotting: otpl
.otpl.plot_sankey(tca_obj, annot, ...): sankey plot of communication patterns, LR or pathway communication network..otpl.plot_circos(tca_obj, annot, name, ...): circos plot of communication patterns, LR or pathway communication network.
simmulation: otsim
otsim.simu_data(n_r, n1, n2, n_lr, ...): simulating data using inverse optimal transport (iOT).
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clria-1.0.9.tar.gz.
File metadata
- Download URL: clria-1.0.9.tar.gz
- Upload date:
- Size: 51.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0003785d2a8d0080bf5296f1211f68418d4aeaf0e88446725782ea5d1e88107
|
|
| MD5 |
df5e89eeec21349b73ce77db7c209348
|
|
| BLAKE2b-256 |
f5f778a0dda98fe686c7adb1bf167455228f76a7735c38785215014c9aad5a0f
|
File details
Details for the file clria-1.0.9-py3-none-any.whl.
File metadata
- Download URL: clria-1.0.9-py3-none-any.whl
- Upload date:
- Size: 51.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02c6179a91eff5c0f2bb3937a5aa64d6400198c5075e735cc9eec885c6ce2dbb
|
|
| MD5 |
faff7d4de303034278079d44b37d1a4e
|
|
| BLAKE2b-256 |
591a9e3d65bcd498df808a4930803f6652af3a6ec17ca83e876289b6798e2bc9
|