cytonormpy.mad_comparison_from_anndata

cytonormpy.mad_comparison_from_anndata#

cytonormpy.mad_comparison_from_anndata(adata, file_list, channels, orig_layer, norm_layer, sample_identifier_column='file_name', cell_labels=None, groupby=None, transformer=None)#

This function is a wrapper around mad_from_anndata that directly combines the normalized and unnormalized dataframes. Currently only works if the normalized and unnormalized files are in the same directory.

Parameters:
  • adata (AnnData) – The AnnData object

  • file_list (Union[list[str], str]) – A list of files. Used in conjunction with sample_identifier_column.

  • channels (Optional[list[str]]) – A list of detectors to analyze.

  • orig_layer (str) – The layer where the original data are stored.

  • norm_layer (str) – The layer where the normalized data are stored.

  • sample_identifier_column (str) – Specifies the column in adata.obs in which the samples are identified.

  • labels (cell) – Specifies the column in adata.obs containing cell labels. The cell labels will be added to the dataframe. If None, MADs will be calculated per file and channel.

  • groupby (Optional[Union`[:py:class:`list[str], str]]) – Specify on what the MADs should be grouped. Can be “file_name”, “label” or [“file_name”, “label”].

  • transformer (Optional[Transformer]) – An instance of the cytonormpy transformers.

Return type:

A pandas.DataFrame containing the MAD values per file or per file and cell_label.