acore.enrichment_analysis.annotate module

acore.enrichment_analysis.annotate module#

Put unique features into foreground, background or assign nan.

annotate_features(features: Series, in_foreground: set[str] | list[str], in_background: set[str] | list[str]) Series[source]#

Annotate features as foreground or background based on their presence in the foreground and background lists.

Parameters:
  • features – pandas.Series with features and their annotations.

  • in_foreground (set or list-like) – list of features identifiers in the foreground.

  • in_background (set or list-like) – list of features identifiers in the background.

Returns:

pandas.Series containing ‘foreground’ or ‘background’. missing values are preserved.

Example:

result = _annotate_features(features, in_foreground, in_background)