Quick Start with sk-cyto

Installation

From PyPI .. code-block:

pip install sk-cyto

Install from Github source code with

Training your first FlowSOM model

File reading

sk-cyto does not provide file reading capabilities. To read fcs files, please refer to the excellent flowIO package, which has zero dependencies.

Alternatively for testing purposes, we can create a fake data set with 5 populations like this:

Preprocessing the data

Flow cytometry data usually is compensated and transformed. This was mostly done historically, to make it easier for the human analyzers to separate populations. Machine learning models often do not require this kind of preprocessing, but it can help the training process. The FlowSOM paper for example suggests to normalize your data in addition to compensation and logicle transformation. Also, FlowSOM does usually only use fluorescence channels, and not the forward and side scatter channels.

To combine all these preprocessing steps, we can take advantage of the sklearn infrastructure.

Training a FlowSOM model

Now we can easily train a FlowSOM model.

Combining everything using sklearn infrastructure

We can also easily integrate the FlowSOM training into the pipeline

Using the model for inference

FlowSOM can not only be used for unsupervised clustering, the model can also be used for inference of new data points. For example, you might collect some reference data set at the beginning of your experiments, to which you want to map other data.