pytometry.tools.normalize_autologicle#
- pytometry.tools.normalize_autologicle(adata, channels=None, m=4.5, q=0.05, inplace=True)#
Autologicle transformation.
Automatically apply a logicle transformation to specified channels in an AnnData object. Code adapated from the
Cytofkit
package (Chen et al. 2016). This function processes multiple channels within an AnnData object by applying a logicle transformation to each one.- Parameters
adata (AnnData) – The AnnData object containing the data to be transformed.
channels (list of str) – A list of channel names to be logicle transformed.
m (float, optional) – The upper limit for the transformation parameter ‘m’. Defaults to 4.5.
q (float, optional) – The quantile to determine the lower threshold for the transformation. Defaults to 0.05.
- Returns
- A dictionary with channel names as keys and dictionaries containing
logicle transformation parameters as values.
- Return type
dict
- Usage:
params = pm.tl._autoLgcl_params(adata, channels=list(adata.var_names)) for channel in adata.var_names:
channel_idx = np.where(adata.var_names == channel)[0][0] adata.X[:, channel_idx] = transforms.logicle(adata.X[:, channel_idx],
channel_indices=[channel_idx], **params[channel])