cytonormpy._dataset.DataHandlerAnnData

cytonormpy._dataset.DataHandlerAnnData#

class cytonormpy._dataset.DataHandlerAnnData(adata, layer, reference_column, reference_value, batch_column, sample_identifier_column, channels, n_cells_reference=None, transformer=None, key_added='cyto_normalized')#

Class to handle AnnData objects in cytonormpy.

Parameters:
  • adata (AnnData) – The anndata object of shape n_objects x n_channels.

  • layer (str) – The layer of the AnnData object to be used.

  • reference_column (str) – The column in adata.obs that specifies whether files serve as a batch-reference

  • reference_value (str) – The value of reference_column that specifies the reference files.

  • batch_column (str) – The column in adata.obs that specifies which batch the files belong to.

  • sample_identifier_column (str) – The column in adata.obs that specifies the individual files. Have to be unique.

  • channels (Union[list[str], str, Literal['all', 'marker']]) – Can be a list of detectors (e.g. BV421-A), a single channel or all or markers. If markers, channels containing ‘FSC’, ‘SSC’, ‘Time’, ‘AF’ and CyTOF technicals will be excluded.

  • key_added (str) – The name of the layer in adata.layers where the normalized data are inserted to.

Return type:

None

Attributes

Methods

add_file(file_name, batch)

append_cytof_technicals(value)

append_flow_technicals(value)

append_spectral_flow_technicals(value)

get_corresponding_ref_dataframe(file_name)

Returns the data of the corresponding reference for the indicated file name.

get_dataframe(file_name)

Returns a dataframe for the indicated file name.

get_ref_data_df([markers])

Returns the reference data frame.

get_ref_data_df_subsampled(n[, markers])

Returns the reference data frame, subsampled to n events.

write(file_name, data)

Writes the data to the anndata object to the layer specified during setup.