metachat.tl.summary_communication

metachat.tl.summary_communication(adata, database_name=None, sum_metabolites=None, sum_metapathways=None, sum_customerlists=None, copy=False)[source]

Summarize communication signals by metabolite sets, pathways, or custom lists.

Parameters

adataanndata.AnnData

AnnData object that has run mc.tl.metabolic_communication().

database_namestr

Name of the metabolite–sensor interaction database (e.g., “MetaChatDB”).

sum_metaboliteslist of str, optional

List of specific metabolites to summarize communication for. Example: ['HMDB0000148', 'HMDB0000674'].

sum_metapathwayslist of str, optional

List of specific metabolic pathways to summarize communication for. Example: ['Alanine, aspartate and glutamate metabolism', 'Glycerolipid Metabolism'].

sum_customerlistsdict, optional

Custom metabolite–sensor groups. Each key represents a custom name, and the value is a list of (metabolite, sensor) tuples. Example: ``{‘CustomerA’: [(‘HMDB0000148’, ‘Grm5’), (‘HMDB0000148’, ‘Grm8’)],

‘CustomerB’: [(‘HMDB0000674’, ‘Trpc4’), (‘HMDB0000674’, ‘Trpc5’)]}``.

copybool, default=False

Whether to return a modified copy of the AnnData object.

Returns

adataanndata.AnnData

sum_metabolites, sum_metapathways, sum_customerlists can provided by user in one time. the summary information are added to .obsm and .obsp. For example: For each “metabolite_name” in “sum_metabolites”, adata.obsp['MetaChat-'+database_name+'-'+metabolite_name],``adata.obsm[‘MetaChat-‘+database_name+’-sum-sender-‘+’metabolite_name’][‘s-‘+metabolite_name]`` and adata.obsm['MetaChat-'+database_name+'-sum-receiver-'+'metabolite_name']['r-'+metabolite_name]. For each “pathway_name” in “sum_metapathways”, adata.obsp['MetaChat-'+database_name+'-'+pathway_name], adata.obsm['MetaChat-'+database_name+'-sum-sender-'+'pathway_name']['s-'+pathway_name] and adata.obsm['MetaChat-'+database_name+'-sum-receiver-'+'pathway_name']['r-'+pathway_name]. For each “customerlist_name” in “sum_customerlists”, adata.obsp['MetaChat-'+database_name+'-'+customerlist_name], adata.obsm['MetaChat-'+database_name+'-sum-sender-'+'customerlist_name']['s-'+customerlist_name] and adata.obsm['MetaChat-'+database_name+'-sum-receiver-'+'customerlist_name']['r-'+customerlist_name]. If copy=True, return the AnnData object and return None otherwise.