test_annotation_significance

test_annotation_significance#

mofaflex.tl.test_annotation_significance(model, annotations, data=None, corr_adjust=True, p_adj_method='fdr_bh', min_size=10, subsample=1000)#

Test feature sets for significant associations with model factors.

This is an implementation of PCGSE [FLM15].

Parameters:
  • model (MOFAFLEX) – The MOFA-FLEX model.

  • annotations (dict[str, DataFrame]) – Boolean dataframe with feature sets in each row for each view.

  • data (MuData | dict[str, dict[str, AnnData]] | MofaFlexDataset | None (default: None)) – The data that the model was trained on. Only required if corr_adjust=True.

  • corr_adjust (bool (default: True)) – Whether to adjust for correlations between features.

  • p_adj_method (str (default: 'fdr_bh')) – Method for multiple testing adjustment.

  • min_size (int (default: 10)) – Minimum size threshold for feature sets.

  • subsample (int (default: 1000)) – Work with a random subsample of the data to speed up testing. Set to 0 to use all data (may use excessive amounts of memory). Only relevant if corr_adjust=True.

Return type:

dict[str, DataFrame]

Returns:

PCGSE results for each view.