flowsom
FlowSOM algorithm in Python, using self-organizing maps and minimum spanning tree for visualization and interpretation of cytometry data
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.8%) to scientific vocabulary
Keywords
Repository
FlowSOM algorithm in Python, using self-organizing maps and minimum spanning tree for visualization and interpretation of cytometry data
Basic Info
Statistics
- Stars: 26
- Watchers: 1
- Forks: 8
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
README.md
FlowSOM
This repository contains a Python implementation of FlowSOM algorithm for clustering and visualizing a mass cytometry data set.
For more details about the algorithm, please check (En|中)
Installation
Just use pip
pip install FlowSom
Or download this repository to a directory of your choice and then run:
pip install -r requirements.txt
How to use it
- Read Files
- In order to use FlowSOM you need your data saved as a .csv file or a .fcs file.
python
file = r'flowmetry.fcs'
- Or
python
file = 'flowmetry.csv'
- Import Package
- Then you need to import the package.
- If you install the package via pip, then you should run
python
from flowsom import flowsom
- If you download the repository, you should run
python
from flowsom import *
- Play Around
- Then you can run FlowSOM just as follows:
python
fsom = flowsom(file) # read the data
fsom.som_mapping(50, 50, 31, sigma=2.5,
learning_rate=0.1, batch_size=100) # trains SOM with 100 iterations
fsom.meta_clustering(AgglomerativeClustering, min_n=40,
max_n=45,
iter_n=3) # train the meta clustering for cluster in range(40,45)
Use the trained output
After the training, you will be able to:
- Get the weights of SOM with method
fsom.map_som - Get the best number of clustering with method
fsom.bestk - Get the prediction dataframe with method
fsom.dfandfsom.tf_df - Visualize the final clustering outcome with method
fsom.vis
Examples
The demo code could be found here.
The distance map of SOM trained from a sample flow cytometry data:

The visualization example after meta-clustering using Minimal Spanning Tree (MST):

FlowSOM Algorithm
FlowSOM analyzes flow or mass cytometry data using a self-Organizing Map (SOM). Using a two-level clustering and star charts, FlowSOM helps to obtain a clear overview of how all markers are behaving on all cells, and to detect subsets that might be missed otherwise.
The algorithm consists of four steps: - reading the data - building a Self-Organizing Map - building a minimal spanning tree - computing a meta-clustering
Self-Organizing Map
SOM is a type of unsupervised Artificial Neural Network able to convert complex, nonlinear statistical relationships between high-dimensional data items into simple geometric relationships on a low-dimensional display. Introduction
Minimum Spanning Tree
A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges of a connected, edge-weighted undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight.
Meta-clustering
The meta-clustering technique conducted on the SOM is hierarchical consensus meta-clustering, which clusters the weights of trained SOM into different groups.
Acknowledge
FlowSOM is built based on FlowCytometryTools, MiniSom and Consensus Clustering.
Update pypi: source
Owner
- Login: Hatchin
- Kind: user
- Location: Bay Area
- Website: https://hatchin.netlify.com/
- Repositories: 3
- Profile: https://github.com/Hatchin
notes4hatchin@gmail.com
GitHub Events
Total
- Watch event: 5
Last Year
- Watch event: 5
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Sangyu Shen | s****n@g****m | 73 |
| Hatchin | s****7@u****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 2
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 2
- Total pull request authors: 0
- Average comments per issue: 2.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- SofieVG (1)
- prubbens (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- FlowCytometryTools >=0.5.0
- matplotlib >=2.2.2
- minisom >=2.1.5
- networkx >=2.1
- numpy >=1.9.2
- pandas >=0.20
- scikit-learn >=0.20.2
- scipy >=0.15.1