Skip to content

Commit

Permalink
✨ add usage example to autologicle normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
maik authored and maik committed Apr 30, 2024
1 parent d8d1926 commit f78a419
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pytometry/tools/_normalization.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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'")
Expand Down

0 comments on commit f78a419

Please sign in to comment.