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/pytometry/plotting/_histogram.py:83: UserWarning: 

`distplot` is a deprecated function and will be removed in seaborn v0.14.0.

Please adapt your code to use either `displot` (a figure-level function with
similar flexibility) or `histplot` (an axes-level function for histograms).

For a guide to updating your code to use the new functions, please see
https://gist.github.com/mwaskom/de44147ed2974457ad6372750bbe5751

  sns.distplot(
https://d33wubrfki0l68.cloudfront.net/5a0f034de515f82e4bac639ac4b949a712bbff27/09f2c/_images/1d390e9703a8ce7665fcddd7cee1af90e32c11c8d4d930313666b3c54916a0ae.png
pm.pl.scatter_density(adata)
https://d33wubrfki0l68.cloudfront.net/499d10d0707ccd493d87dead158d5a9744dddd3c/d7a8d/_images/8357713368caa1c92818680e0c1e53ded43916554a69bcd2df1beeedae552466.png
pm.pp.compensate(adata)
5499 NaN values found after compensation. Please adjust compensation matrix.
/home/runner/work/pytometry/pytometry/.nox/build-3-9/lib/python3.9/site-packages/pytometry/preprocessing/_process_data.py:177: RuntimeWarning: overflow encountered in cast
  adata.X[:, ref_idx] = X_comp
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:166: RuntimeWarning: invalid value encountered in scalar subtract
  y = (ae2bx + p["f"]) - (ce2mdx + value)

Save data to HDF5 file format.

adata.write("example.h5ad")