troutpy.tl.get_gene_interaction_strength#
- troutpy.tl.get_gene_interaction_strength(source_proportions, target_proportions, gene_symbol='', return_interactions=False, save=False, output_path='', format='pdf')#
Compute and plot the interaction strength between source and target cell types for one gene.
The interaction matrix is the outer product of the gene’s proportion in each source cell type and its proportion in each target cell type.
- Parameters:
source_proportions (pandas.DataFrame) – Proportion of the gene (rows) in each source cell type (columns).
target_proportions (pandas.DataFrame) – Proportion of the gene (rows) in each target cell type (columns).
gene_symbol (str, optional) – Gene for which the interaction strength is computed. Defaults to
"".return_interactions (bool, optional) – Currently unused. Defaults to
False.save (bool, optional) – If
True, save the plot tooutput_path/figures. Defaults toFalse.output_path (str, optional) – Directory in which the
figuressubdirectory is created whensave=True. Defaults to"".format (str, optional) – File format used when
save=True(e.g."pdf","png"). Defaults to"pdf".
- Return type:
DataFrame- Returns:
pandas.DataFrame Interaction strength matrix (source cell types x target cell types) for
gene_symbol.