nichesphere.coloc.OvsE_coloc_test

nichesphere.coloc.OvsE_coloc_test#

nichesphere.coloc.OvsE_coloc_test(observedColocProbs, expectedColocProbs, cell_types, testDistribution, oneCTinteractions, p=0.05)#

Observed vs Expected log2 ratios filtered by p-value obtained from comparing them against a background distribution

Parameters:
  • observedColocProbs (pd.Series) – observed cell type pair co-localization probabilities in a sample/condition

  • expectedColocProbs (pd.Series) – expected cell type pair co-localization probabilities in a sample/condition

  • cell_types (list) – list of cell types (sorted as in observedColocProbs)

  • testDistribution (list) – distribution of log2 observed vs expected ratios obtained from random sampling pairs of single cells from scRNA data from the same sample/condition (obtained generally from function ‘PIC_OEratios_BGdist’) from the tl module

  • oneCTinteractions (list) – list of single cell interactions (celltype-celltype)

  • p (float (default: 0.05)) – values must have a p-value lower than this to be considered significant

Returns:

OvsE_HMdf – cell types x cell types data frame of log2 observed/expected significant values (scores) for each cell cell interaction

Return type:

pd.DataFrame