rapids_singlecell.dcg.aucell#
- rapids_singlecell.dcg.aucell = <rapids_singlecell.decoupler_gpu._method_aucell.AucellMethod object>[source]#
Area Under the Curve for set enrichment within single cells (AUCell).
Given a ranked list of features per observation, AUCell calculates the AUC by measuring how early the features in the set appear in this ranking. Specifically, the enrichment score \(ES\) is:
\[{ES}_{i, F} = \int_0^1 {RecoveryCurve}_{i, F}(r_i) \, dr\]Where:
\(i\) is the observation
\(F\) is the feature set
\({RecoveryCurve}_{i, F}(r_i)\) is the proportion of features from \(F\) recovered in the top \(r_i\)-fraction of the ranked list for observation \(i\)
This method does not perform statistical testing on \(ES\) and therefore does not return \(p_{value}\).
- Parameters:
- data
AnnData instance, DataFrame or tuple of [matrix, samples, features].
- net
Dataframe in long format. Must include
sourceandtargetcolumns, and optionally aweightcolumn.- tmin default:
5 Minimum number of targets per source. Sources with fewer targets will be removed.
- layer
Layer key name of an
anndata.AnnDatainstance.- raw default:
False Whether to use the
.rawattribute ofanndata.AnnData.- empty default:
True Whether to remove empty observations (rows) or features (columns).
- bsize default:
100 For large datasets in sparse format, this parameter controls how many observations are processed at once. Increasing this value speeds up computation but uses more memory.
- verbose default:
False Whether to display progress messages and additional execution details.
- pre_load default:
False Whether to pre-load the data into memory. If
True, the data will be pre-loaded into memory before processing.- adj_pv_gpu
Whether to use GPU for adjusting p-values.
- n_up default:
None Number of features to include in the AUC calculation. If
None, the top 5% of features based on their magnitude are selected.
- Returns:
Enrichment scores \(ES\) and, if applicable, adjusted \(p_{value}\) by Benjamini-Hochberg.
Example
import decoupler as dc adata, net = dc.ds.toy() rsc.dcg.aucell(adata, net, tmin=3)