a C++ FCS Loader
Project description
FlowMePy - a Python API for FlowMe
Load FCS 2.0/3.0/3.1 files with super fast C++ code. The FCS processing includes compensation and logicle transform. If FacsDiva projects (XMLs) or Kaluza projects (analysis) are provided, the FlowMePy will label events according to the gates contained.
Install
We provide a pre-compiled package (currently Windows only) which can be installed using:
pip install flowmepy
Dependencies
python(>= 3.6)CMake(>= 3.14.1)QtSDK or the compiled sources (>= 5.11.0)OpenCV(>= 4.0.0)- Visual Studio (>= 2015) or gcc
Configure FlowMe using CMake (Windows only)
- dir to ./flowme
- copy
CMakeUserPathsGit.cmakeand rename it toCMakeUserPaths.cmake - add your library paths to the
${CMAKE_PREFIX_PATH}inCMakeUserPaths.cmake
Clone
We use submodules for flowme and pybind11 if you clone using
$ git clone --recursive git@smithers.cvl.tuwien.ac.at:kwc/dev/flowme-python-api.git
everything should be fine. In case the repository's flowme or pybind11 folders are empty, check if the pull worked as expected:
- don't forget
--recursive - windows users: it's easiest if you do not password protect the ssh key
Build
$ virtualenv env
$ source /env/bin/activate
$ python setup.py install
If anything did not work as expected, try building FlowMe as standalone package (see README). Then run the above command again.
You can remove old versions using pip:
$ pip uninstall FlowMePy
Successfully uninstalled flowmepy-0.0.3
Packaging FlowMePy
Update pip (on Windows & Linux), then create the wheel:
python -m pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel
where sdist creates the source archive (without C++ files) and bdist_wheel creates the build package.
Then, upload the package:
python -m twine upload dist/*
in case you want to test your package, use this for uploading:
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Unfortunately, test.pypi.org rejects linux binary wheels - so linux users must build packages on their own. You can install this package using:
pip install -i https://test.pypi.org/simple/ flowmepy --extra-index-url https://pypi.org/simple
Test
Test flowmepy using:
$ python -m unittest discover -v test
build the docs
$ cd docs
$ make html
The compiled docs are here: docs/_build/index.html
FlowMePy in 2 minutes
load an FCS using
import flowme
filepath = "./flowme/src/data/samples/FacsDiva.xml"
sample = flowme.fcs(filepath)
events = sample.events() # get the event data (pandas.DataFrame)
gates = sample.gate_labels() # get gating (GT) information (pandas.DataFrame)
Per default events are not filtered by any Gate. However, it is possible to pass the name of a filtering gate:
import flowme
filepath = "./flowme/src/data/samples/FacsDiva.xml"
filter_gatename = "viable"
sample = flowme.fcs(filepath, filter_gatename)
FlowMe provides a built-in data cleaning function that prunes events accumulated at the measured maximum.
import flowme
filepath = "./flowme/src/data/samples/FacsDiva.xml"
sample = flowme.fcs(filepath)
events, gates = sample.filtered_data(cleanDataPercent=0.001)
Handling multi tube files
Some files may contain multiple tubes. The following code shows how available tubes can be queried as well as how to select from which tube to load the data.
import flowme
tube_names = sample.get_tube_names()
sample.set_tube_index(len(tub_names) - 1)
events = sample.events() #events of last tube in sample
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowmepy-0.4.0.tar.gz.
File metadata
- Download URL: flowmepy-0.4.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f36de7c4660c6e5145acb0538ab98b267bff939795672941575cce6335afc5
|
|
| MD5 |
7dc5947b6644ac49b557f9ef9c68b85d
|
|
| BLAKE2b-256 |
5ef144a5a493fe38e1d6a63d5f80b9bea06336755bf4da3046a3a1842c14b96b
|
File details
Details for the file flowmepy-0.4.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: flowmepy-0.4.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dddcd4a86b7bc4212c46ff22f807b6c9823b169d57b4bb9e71feedb15678baa
|
|
| MD5 |
e1becbdb8eb5f7fdc6f6190d726b6274
|
|
| BLAKE2b-256 |
2a68f9c34e17519e82e1cc7755d914bb2f06ae85ab656010cd40cf08dff42003
|
File details
Details for the file flowmepy-0.4.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: flowmepy-0.4.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed5a483871a642e0d0cc99670464a6c1974ea9a5fb162bffab6bb02d2ce1ba91
|
|
| MD5 |
99435cdd60fd8bc70e6b8af3d43d4bf7
|
|
| BLAKE2b-256 |
4a11f8331c0f95ba21ecac749b4f749e439ad0acd173a7815a8d47dd7e19557c
|
File details
Details for the file flowmepy-0.4.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: flowmepy-0.4.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9db6008917ce32395027d2f9b6ece5e696db70f699cd52d55f0d4330e0e816b
|
|
| MD5 |
41d3adb51031210e2b7efabbaa4da129
|
|
| BLAKE2b-256 |
fed34bead4f1749d37a2693681d51a27ea6ac2d793f71d3597f3c862f37c5e64
|
File details
Details for the file flowmepy-0.4.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: flowmepy-0.4.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98602956bc2a4d6f5086b9d4e2794fedff1802bff0a9ec327694707928be1687
|
|
| MD5 |
fb0654cfb6d413aa8be15f72d34ba665
|
|
| BLAKE2b-256 |
19778b04574041f05800bd369400adfe0da0d2a5088a2f0394bbe06c99b1c130
|
File details
Details for the file flowmepy-0.4.0-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: flowmepy-0.4.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b14f3d2678784fb449c981a8546f10f9cf1218e0a45fed17ea45aca4c870e63e
|
|
| MD5 |
0ffc9ec4eb1ab777ece0c0058364b706
|
|
| BLAKE2b-256 |
91c7fd5c50a107c9a3a580468e30da670664d429f62e1cdba85b73f70c2e0677
|