.var

proteopy.ann.var(adata, df, var_on, df_on, *, suffix='_annotated', sort_var_by_ann=False, inplace=True)[source]

Annotate adata.var with rows from df matched on a key.

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

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

  • var_on (str) – Name of the key column in adata.var (or the var 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_var_by_ann (bool, optional) – Reorder variables 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