Quickstart#

import pytometry as pm
import readfcs
import anndata

Read fcs file example from the readfcs package. The fcs file was part of the following reference and originally deposited on the FlowRepository.

path_data = readfcs.datasets.Oetjen18_t1()
adata = pm.io.read_fcs(path_data)
assert isinstance(adata, anndata._core.anndata.AnnData)

Next, we split the data matrix into the marker intensity part and the FSC/SSC part. Moreover, we move all height related features to the .obs part of the anndata file. Notably. the function split_signal checks if a feature name is either FSC/SSC or whether a name endswith -A for area related features and -H for height related features.

pm.pp.split_signal(adata, var_key="channel")

We can plot the fluorescent marker intensity distribution with the plotdata function.

pm.pl.plotdata(adata)
../_images/ec5911d21501cef5247d7b3e538d47930692419283fddacceadeab95a05da133.png ../_images/ec5911d21501cef5247d7b3e538d47930692419283fddacceadeab95a05da133.png

For 2D distribution plots, we use the scatter_density function.

pm.pl.scatter_density(adata, x_lim=[-1, 2.7e5])
../_images/403b3c71b53926000af41ef1c4349f57812195857d449355c8babc21da691dbe.png
pm.pp.compensate(adata)
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)
adata_autologicle = pm.tl.normalize_autologicle(adata, inplace=False)

Save data to HDF5 file format.

adata.write("example.h5ad")