ladder.data.real_data.AnndataConverter#
- class ladder.data.real_data.AnndataConverter(metadata_df)#
Class used to convert tensor datasets into an
AnnDataobject.This class allows for arbitrary subsets of tensors to be mapped back into an object that looks like the subset of the original object. Inherits
MetadataConverter.
Methods table#
|
Function to actually do the mapping to |
|
The function that actually does the metadata mapping. |
Methods#
- AnndataConverter.map_to_anndat(val_tup)#
Function to actually do the mapping to
AnnData.- Parameters:
val_tup (
tuple) – Size 3 tuple ofTensor. The first index is used for counts. The second index provides labels, which are not used here as they are redundant but required for training. The third index provides the numerically encoded metadata.- Return type:
- Returns:
anndat :
AnnDataThe anndata equivalent of the numericalTensorobjects.
- AnndataConverter.map_to_df(met_val_string)#
The function that actually does the metadata mapping.
- Parameters:
met_val_string (
Tensor) – Tensor shaped likeTensorDataset.- Return type:
- Returns:
metadata_mapping :
ndarrayNumerical tensor converted back to categorical equivalent.