.samples
- proteopy.ann.samples(adata, df, obs_on, df_on, *, suffix='_annotated', sort_obs_by_ann=False, inplace=True)[source]
Annotate
adata.obswith rows fromdfmatched on a key (alias forproteopy.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, modifyadataand returnNone. Otherwise return a new AnnData copy.
- Returns:
Updated AnnData when
inplaceisFalse; otherwiseNone.- Return type:
AnnData or None
See also
obsOriginal function with identical functionality