- spac.transformations.arcsinh_transformation(adata, input_layer=None, co_factor=None, percentile=None, output_layer='arcsinh', per_batch=False, annotation=None)[source]
Apply arcsinh transformation using a co-factor (fixed number) or a given percentile of each feature. This transformation can be applied to the entire dataset or per batch based on provided parameters.
Computes the co-factor or percentile for each biomarker individually, ensuring proper scaling based on its unique range of expression levels.
- Parameters:
adata (anndata.AnnData) – The AnnData object containing the data to transform.
input_layer (str, optional) – The name of the layer in the AnnData object to transform. If None, the main data matrix .X is used.
co_factor (float, optional) – A fixed positive number to use as a co-factor for the transformation.
percentile (float, optional) – The percentile is computed for each feature (column) individually.
output_layer (str, default="arcsinh") – Name of the layer to put the transformed results. If it already exists, it will be overwritten with a warning.
per_batch (bool, optional, default=False) – Whether to apply the transformation per batch.
annotation (str, optional) – The name of the annotation in adata to define batches. Required if per_batch is True.
- Returns:
adata – The AnnData object with the transformed data stored in the specified output_layer.
- Return type:
anndata.AnnData