fcsy: Python package for processing FCS
fcsy is developed based on Data File Standard for Flow Cytometry Version FCS 3.1
Installation
$ pip install fcsy
for working with s3:
$ pip install fcsy[s3]
Usage
Write and read fcs based on Dataframe
>>> import pandas as pd
>>> from fcsy import DataFrame
>>> data = [[1.0,2.0,3.0],[4.0,5.0,6.0]]
>>> columns = pd.MultiIndex.from_tuples(list(zip('abc', 'ABC')), names=["short", "long"])
>>> df = DataFrame(data, columns=columns)
>>> df
short a b c
long A B C
0 1.0 2.0 3.0
1 4.0 5.0 6.0
>>> df.to_fcs('sample.fcs')
>>> df = DataFrame.from_fcs('sample.fcs', channel_type='multi')
>>> df
short a b c
long A B C
0 1.0 2.0 3.0
1 4.0 5.0 6.0
Work with fcs metadata
Read fcs channels
>>> from fcsy import read_channels
>>> read_channels('sample.fcs', channel_type='multi')
MultiIndex([('a', 'A'),
('b', 'B'),
('c', 'C')],
names=['short', 'long'])
Rename channels
>>> from fcsy import rename_channels, read_channels
>>> rename_channels('sample.fcs', {'a': 'a_1', 'b': 'b_1'}, channel_type='short')
>>> read_channels('sample.fcs', channel_type='multi')
MultiIndex([('a_1', 'A'),
('b_1', 'B'),
( 'c', 'C')],
names=['short', 'long'])
>>> rename_channels('sample.fcs', {'A': 'A_1', 'C': 'C_1'}, channel_type='long')
>>> read_channels('sample.fcs', channel_type='multi')
MultiIndex([('a_1', 'A_1'),
('b_1', 'B'),
( 'c', 'C_1')],
names=['short', 'long'])
Read events number
>>> from fcsy import read_events_num
>>> read_events_num('sample.fcs')
2
Work with files on aws s3
All apis support s3 url with the format: s3://{bucket}/{key}.
Write and read
>>> df.to_fcs('s3://sample-bucket/sample.fcs')
>>> df.from_fcs('s3://sample-bucket/sample.fcs', channel_type='multi')
short a b c
long A B C
0 1.0 2.0 3.0
1 4.0 5.0 6.0
Read channels
>>> read_channels('s3://sample-bucket/sample.fcs', channel_type='multi')
MultiIndex([('a', 'A'),
('b', 'B'),
('c', 'C')],
names=['short', 'long'])
Read events number
>>> read_events_num('s3://sample-bucket/sample.fcs')
2
Documentation
The documentation is available on https://fcsy.readthedocs.io/
License
- Free software: MIT license
History
Consult the Releases page for fixes and enhancements of each version.
Metadata
Release files for fcsy 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fcsy-0.10.0.tar.gz | 22.4 kB | Without provenance | Details for fcsy-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fcsy-0.10.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for fcsy-0.10.0-py2.py3-none-any.whl |
Total release size: 33.5 kB
Release files / fcsy-0.10.0.tar.gz
| Download URL | fcsy-0.10.0.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4604002c44acc793cb2ef9842cb85698366c57c1a507d5acc7a196a728a9607e
|
|
BLAKE2b-256 checksum How to use checksums |
579fa2dd7d248d3703d8ec1b07da541de5173510b22c4fe053974d37e4d320e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / fcsy-0.10.0-py2.py3-none-any.whl
| Download URL | fcsy-0.10.0-py2.py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5af3803071d35a32f6875878e0a6cb96bb8a33b61bac21569683b7e687f7f390
|
|
BLAKE2b-256 checksum How to use checksums |
09b4922a1c851f41b1ed011b5a4a63e5690012395409b7f845d20ed8be65fe04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for fcsy 0.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.