swiftcnv.summarise_by_obs

swiftcnv.summarise_by_obs#

summarise_by_obs(adata, obsm_key='cnv_mat', by='sample', mode='mean')#

Summarise the values in the specified obsm matrix by cell attributes (sample by default).

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

  • obsm_key (str, default 'cnv_mat') – Key of the obsm layer to summarise.

  • by (str, default 'sample') – Key of the obs layer to group columns by.

  • mode ({'mean', 'median'}, default 'mean') – Summarise method to use (‘mean’ or ‘median’).

Returns:

Summarised matrix indexed by the grouped by attribute.

Return type:

pandas.DataFrame