.samples

proteopy.ann.samples(adata, df, obs_on, df_on, *, suffix='_annotated', sort_obs_by_ann=False, inplace=True)[source]

Annotate adata.obs with rows from df matched on a key (alias for proteopy.ann.obs()).

In proteomics, observations (rows in adata.obs) often represent samples, so this alias provides a more intuitive name for the same functionality.

Parameters:
  • adata (AnnData) – Input AnnData object.

  • df (pandas.DataFrame) – Annotation table that supplies additional columns.

  • obs_on (str) – Name of the key column in adata.obs (or the obs index name / literal "index") used for matching.

  • df_on (str) – Name of the key column in df.

  • suffix (str, optional) – Suffix applied to colliding column names from df.

  • sort_obs_by_ann (bool, optional) – Reorder observations by the order of matching keys in df.

  • inplace (bool, optional) – If True, modify adata and return None. Otherwise return a new AnnData copy.

Returns:

Updated AnnData when inplace is False; otherwise None.

Return type:

AnnData or None

See also

obs

Original function with identical functionality