From f78a419e3e4ca71e74efbc46c4b45de76370c41d Mon Sep 17 00:00:00 2001 From: maik Date: Tue, 30 Apr 2024 11:29:47 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20usage=20example=20to=20autolo?= =?UTF-8?q?gicle=20normalization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pytometry/tools/_normalization.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pytometry/tools/_normalization.py b/pytometry/tools/_normalization.py index d046069..585fcc3 100644 --- a/pytometry/tools/_normalization.py +++ b/pytometry/tools/_normalization.py @@ -1,6 +1,7 @@ import numpy as np from anndata import AnnData from scipy import interpolate +from flowutils import transforms def normalize_arcsinh(adata: AnnData, cofactor=5, inplace: bool = True): @@ -571,6 +572,12 @@ def autoLgcl(adata, channels, m=4.5, q=0.05): Returns: - dict: A dictionary with channel names as keys and dictionaries containing logicle transformation parameters as values. + + Usage: + params = autoLgcl(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]) """ if not isinstance(adata, AnnData): raise TypeError("adata has to be an object of class 'AnnData'")