decoupler.dense_run
- decoupler.dense_run(func, mat, net, source='source', target='target', weight='weight', min_n=5, verbose=False, use_raw=True, args={}, estimate_loc=0)
Run a method without zero values.
This function runs any method in decoupler (see dc.show_methods()) in a dense manner, meaning that all zero vales are removed for each sample. Since this is sample dependent, parallelization is not available most of the time and running times might increase. This function is useful to test what effect does null imputation do to the inference of activities.
- Parameters:
- funcfunction
Function to call a decoupler method, check dc.show_methods() for the full list.
- matlist, DataFrame or AnnData
List of [features, matrix], dataframe (samples x features) or an AnnData instance.
- netDataFrame
Network in long format.
- sourcestr
Column name in net with source nodes.
- targetstr
Column name in net with target nodes.
- weightstr
Column name in net with weights (if needed).
- min_nint
Minimum of targets per source. If less, sources are removed.
- verbosebool
Whether to show progress.
- use_rawbool
Use raw attribute of mat if present.
- argsdict
A dict of argument to pass to func.
- estimate_locint
Which index is the desired estimate. Only relevant for methods that return more than one estime like wmean, wsum or gsea.
- Returns:
- estimateDataFrame
Estimate scores. Stored in .obsm[‘*_estimate’] if mat is AnnData.
- pvalsDataFrame
Obtained p-values. Stored in .obsm[‘*_pvals’] if mat is AnnData.