API#
coloc module#
Focused on differential co-localization
Observed vs Expected log2 ratios filtered by p-value obtained from comparing them against a background distribution |
|
Observed vs Expected log2 ratios filtered by adjusted p-value from a per-pair background distribution. |
|
Check if a cell group (niche/type/category) is contained in a cell type pair |
|
(Differential) co-localization network |
|
Compute a kNN-based co-localization probability matrix between cell type pairs. |
|
Compute a radius-based co-localization probability matrix between cell type pairs. |
|
Differential co-localization test with table of scores and p-values as output |
|
Vectorized calculation of cell type pair co-localization probabilities per sample (sum across spots of probabilities of each cell type pair being in the same spot) |
|
Transforms matrix obtained with getColocProbs into a matrix of CT pairs x samples CTcoloc=previously obtained colocalisation matrix from getColocprobs complete=list with repeated values (ct1_x_ct2 and ct2_x_ct1) |
|
Plot cell types in spatial data (MERFISH / visium slices) |
|
Plot niches in spatial data (MERFISH / visium slices) |
|
Plot a single cell type proportions in spatial data (MERFISH / visium slices) |
comm module#
Focused on differential communication
Get cell communication scores per cell type pair per LR pair by summing that LR pair scores for that cell type pair. |
|
(Differential) communication network |
|
Check if a cell group (niche/type/category) is contained in a cell type pair |
|
Differential cell communication per LR category (eg: biological process) |
|
get the differential communication scores for a specific LR category |
|
Calculate cell communication scores per ligand category from a database |
|
Plot heatmap of differential cell communication statistics |
|
get unique elements in array without re-sorting |
tl module#
Helpful tools
Generate distribution of O/E ratios for colocalization probabilities of cell type pairs in randomly generated doublets (background dist) for tests in PIC-seq data |
|
Generate one set of O/E ratios for cell type pair co-localization probabilities from randomly paired single cells. |
|
Assign properties to network g to visualize with gravis interactive networks |
|
Generate boolean element indicating whether the specified element (cell pair) is contained in a list (category) |
|
Make dataframe of cell types with their corresponding niches and colors |
|
Compute standard centrality statistics for a (signed) NetworkX graph. |
|
Reduce the number of elements belonging to |
|
Get filtering object indicating which cell pairs are differentially co-localized |
|
Compute the expected co-localization probability of each cell type pair by multiplying cell type proportions derived from single-cell (singlets) data. |
|
Generate nreps sets of O/E ratios for cell type pair co-localization probabilities by running |
|
Get dataframe of cell pair to niche pair correspondence |
|
Optimized version of get_spatial_radius_BG_OEratios_DF using sparse matrix multiplication. |
|
Get cell type proportions per spot by summing the probabilities of cells of the same kind in each spot |
|
Bar plots of the top nodes by betweenness, PageRank, and signed degree centrality. |
|
Remove suffixes '|L' , '|R' and '|TF' from cell - cell communication (CrossTalkeR) tables |
|
Get dataframe for scores heatmap from dataframe obtained from diffColoc_test() |
|
get unique elements in array without re-sorting |
niche_stats module#
Tools to test and visualize the internal cohesion of each niche relative to its cross-niche connections
Per-community positive/negative edge count and weight statistics. |
|
Flat DataFrame version of |
|
Raw edge weight lists per community, split by location and sign. |
|
Combine positive and negative weights into a single signed distribution. |
|
Wilcoxon rank-sum test comparing internal vs external edge weight distributions for each community, with multiple-testing correction. |
|
Box plots of signed edge weights (internal vs external) per community. |
sankey_plot module#
Biological process specific sankey plots
Flat 2D Sankey diagram of ligand-receptor interactions from pyCrossTalkeR results. |