Python function to plot relative influence for each spatially adjacent cell type.
plot_influence_proportions.Rd
The influence of cell types positioned next to a given velocity cluster, where influence
Cell types with higher ligand expression will contribute more to the final sum, resulting in a weighted influence score.
This calculation is run based on tangram-sc
transferred labels for velocity clusters and cell type clusters.
Usage
plot_influence_proportions(
adata,
adata_st,
celltype_key,
tangram_celltype_column,
velocity_cluster_key = "velocity_clusters",
tangram_result_column = "velocity_label_transfer",
color = None,
colormap = None,
top_n_ligands = 5,
save = "cell_influence_proportions.png",
dpi = 300
)
Arguments
- adata
An anndata object that has had
get_velocity_ligands_spatial
run on it.- adata_st
An anndata object containing spatially resolved data.
- celltype_key
Column name in
adata.obs
denoting sender cell type labels to be visualized.- tangram_celltype_column
Column name in
adata_st.obs
denoting cell type labels that have been label-transferred fromadata.obs
. If not given, this function will runtangram-sc
to transfer labels.- velocity_cluster_key
Default
"velocity_clusters"
. Name of the column inadata.obs
where velocity cluster labels are stored.- tangram_result_column
Default
"velocity_label_transfer"
. Name of the column inadata_st.obs
where velocity cluster labels are stored.- color
Argument for
matplotlib
plotting backend.- colormap
Argument for
matplotlib
plotting backend.- top_n_ligands
Default 5. The top n ligands (ranked by feature importance) to consider.
- save
Default "cell_influence_proportions.png". Filename to save plot as.
- dpi
Dpi for saving.