Quickstart#

import pytometry as pm
import readfcs
import anndata

Read fcs file example from the readfcs package.

path_data = readfcs.datasets.example()
adata = pm.io.read_fcs(path_data)
assert isinstance(adata, anndata._core.anndata.AnnData)
pm.pp.split_signal(adata, var_key="channel")
pm.pl.plotdata(adata)
/home/runner/work/pytometry/pytometry/.nox/build-3-9/lib/python3.9/site-packages/seaborn/distributions.py:2619: FutureWarning: `distplot` is a deprecated function and will be removed in a future version. Please adapt your code to use either `displot` (a figure-level function with similar flexibility) or `histplot` (an axes-level function for histograms).
  warnings.warn(msg, FutureWarning)
https://d33wubrfki0l68.cloudfront.net/063d518e05ca4cbbe55309608e8114636c0bf675/16847/_images/31ffa27b3ae3e51c05ddedaeec57a170864a7bf5871b7fce45eadabe4b111ce4.png
pm.pp.compensate(adata)
5616 NaN values found after compensation. Please adjust compensation matrix.
adata_arcsinh = pm.tl.normalize_arcsinh(adata, cofactor=150, inplace=False)
adata_biexp = pm.tl.normalize_biExp(adata, inplace=False)
adata_logicle = pm.tl.normalize_logicle(adata, inplace=False)
/home/runner/work/pytometry/pytometry/.nox/build-3-9/lib/python3.9/site-packages/pytometry/tools/_normalization.py:175: RuntimeWarning: invalid value encountered in double_scalars
  y = (ae2bx + p["f"]) - (ce2mdx + value)

Save data to HDF5 file format.

adata.write("example.h5ad")