Skip to main content

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.

Release files for fcsy 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fcsy 0.5.0
File Size Uploaded
fcsy-0.5.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fcsy 0.5.0
File Interpreter ABI Platform
fcsy-0.5.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 23.9 kB

Release files / fcsy-0.5.0.tar.gz

Download URL fcsy-0.5.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
00943ee76c22f17f6e57dc77adc82a028ec9dfe6c4e7ae2f23c2f7f710cb1e29
BLAKE2b-256 checksum
How to use checksums
c5a038d96a29cf9bf61f6d51f3f13019ffbdbf2ee1e711a2afe0b51cbfdd851f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / fcsy-0.5.0-py2.py3-none-any.whl

Download URL fcsy-0.5.0-py2.py3-none-any.whl
Size 7.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
da6460ec3d6c6632e4115248728bc974027e2efef1251d5c1918dd6562ab83f5
BLAKE2b-256 checksum
How to use checksums
39e65707c0b25d70aefad2892b450b52db2ca4e8a70ef25daddac54366a8f23f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page