A package for processing FCS files
Project description
fcsy
A package for processing FCS files.
- Free software: MIT license
Installation
$ pip install fcsy
Usage
Use the pandas flavor api fcsy.DataFrame which
has all the features of pandas DataFrame plus the fcs io (New in v0.5.0).
API (ver >= 0.5.0)
DataFrame.from_fcs(path, channel_type='short')
Read fcs file to dataframe
| path | path to the input fcs |
| channel_type | "short" | "long" | "multi". Read short or long channels to the dataframe columns. In "multi" mode both channels are read as a pandas MultiIndex |
| return | DataFrame |
Example:
from fcsy import DataFrame
df = DataFrame.from_fcs('sample1.fcs', channel_type='multi')
DataFrame.to_fcs(path)
Write dataframe to fcs file. 'short' and 'long' channels will be written separately if pandas MultiIndex is used as the columns. Otherwise 'short' and 'long' channels will be the same writen from the columns.
Example:
import numpy as np
from fcsy import DataFrame
df = DataFrame(np.random.rand(10, 4)), columns=list('ABCD'))
df.to_fcs('sample1.fcs')
Old API
Write a data frame to fcs. df.columns is written to both short and long names of the fcs.
from fcsy import write_fcs
write_fcs(df, 'output_file')
Write to fcs with "long name". df.columns and long_names are written to short and long names of the fcs.
write_fcs(df, 'output_file', long_names=['a','b','c'])
Read a fcs file to pandas DataFrame.
from fcsy import read_fcs
df = read_fcs('input_file')
Read a fcs file with "long name"
df = read_fcs('input_file', name_type='long')
# or only read the names
from fcsy import read_fcs_names
long_names = read_fcs_names('input_file', name_type='long')
Write a data frame to fcs. df.columns is written to both short and long names of the fcs.
from fcsy import write_fcs
write_fcs(df, 'output_file')
Write to fcs with "long name". df.columns and long_names are written to short and long names of the fcs.
write_fcs(df, 'output_file', long_names=['a','b','c'])
Credits
This package was created with Cookiecutter* and the audreyr/cookiecutter-pypackage* project template.
Cookiecutter: https://github.com/audreyr/cookiecutter
audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage
======= History
0.1.0 (2018-12-18)
- First release on PyPI.
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 Distribution
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 fcsy-0.5.0.tar.gz.
File metadata
- Download URL: fcsy-0.5.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00943ee76c22f17f6e57dc77adc82a028ec9dfe6c4e7ae2f23c2f7f710cb1e29
|
|
| MD5 |
9b55c3180bf0cc1cae41dbbf077bca25
|
|
| BLAKE2b-256 |
c5a038d96a29cf9bf61f6d51f3f13019ffbdbf2ee1e711a2afe0b51cbfdd851f
|
File details
Details for the file fcsy-0.5.0-py2.py3-none-any.whl.
File metadata
- Download URL: fcsy-0.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da6460ec3d6c6632e4115248728bc974027e2efef1251d5c1918dd6562ab83f5
|
|
| MD5 |
32e4e8a849bc3eee92c6b83c7e7a6f6b
|
|
| BLAKE2b-256 |
39e65707c0b25d70aefad2892b450b52db2ca4e8a70ef25daddac54366a8f23f
|