Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitews/FlowIO
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.9.12
Choose a base ref
...
head repository: whitews/FlowIO
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Sep 8, 2021

  1. add DOI badge

    whitews committed Sep 8, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e5860db View commit details

Commits on Jan 24, 2022

  1. added only_text attribute

    Thereby only the header and text data can be read.
    JcGKitten committed Jan 24, 2022
    Copy the full SHA
    eb10dc5 View commit details

Commits on Jan 27, 2022

  1. Copy the full SHA
    e83cafa View commit details
  2. Copy the full SHA
    f92c0a0 View commit details
  3. Copy the full SHA
    f48e0ea View commit details
  4. release 0.9.13

    whitews committed Jan 27, 2022
    Copy the full SHA
    fe8a6df View commit details

Commits on Jan 28, 2022

  1. update travis link in README

    whitews committed Jan 28, 2022
    Copy the full SHA
    3533b7c View commit details

Commits on Mar 2, 2022

  1. Copy the full SHA
    f040684 View commit details
  2. Copy the full SHA
    78a87ff View commit details

Commits on Mar 3, 2022

  1. Merge pull request #13 from andreas-wilm/data-byte-offset-cap

    Added spec conform header support for large data sets
    whitews authored Mar 3, 2022
    Copy the full SHA
    0787666 View commit details
  2. Copy the full SHA
    19af354 View commit details
  3. Copy the full SHA
    357d25c View commit details
  4. Copy the full SHA
    2690689 View commit details
  5. Copy the full SHA
    6a2ef4b View commit details
  6. Copy the full SHA
    6df991a View commit details

Commits on Mar 4, 2022

  1. Copy the full SHA
    ea090a4 View commit details

Commits on Mar 8, 2022

  1. release 0.9.14

    whitews committed Mar 8, 2022
    Copy the full SHA
    ebb8293 View commit details

Commits on Mar 17, 2022

  1. fix typo in doc header

    whitews committed Mar 17, 2022
    Copy the full SHA
    861a255 View commit details

Commits on Mar 22, 2022

  1. Copy the full SHA
    b4fd88f View commit details
  2. expose __version__ to API

    whitews committed Mar 22, 2022
    Copy the full SHA
    db0738e View commit details
  3. new line

    whitews committed Mar 22, 2022
    Copy the full SHA
    5314516 View commit details
  4. Copy the full SHA
    20f9243 View commit details
  5. Copy the full SHA
    97fd23f View commit details
  6. Copy the full SHA
    38f0c3e View commit details
  7. Copy the full SHA
    4eb9669 View commit details
  8. Copy the full SHA
    dceb5a1 View commit details
  9. Copy the full SHA
    4e1caca View commit details
  10. Copy the full SHA
    00b5b2d View commit details
  11. update FCS write tests

    whitews committed Mar 22, 2022
    Copy the full SHA
    78ef016 View commit details
  12. Copy the full SHA
    9240144 View commit details
  13. Copy the full SHA
    ddb8c1d View commit details
  14. Copy the full SHA
    6a54b14 View commit details
  15. Copy the full SHA
    4f37d0b View commit details
  16. bump to beta v1.0.0

    whitews committed Mar 22, 2022
    Copy the full SHA
    b36672d View commit details
  17. Copy the full SHA
    51fe185 View commit details
  18. Copy the full SHA
    db28fe5 View commit details

Commits on Mar 23, 2022

  1. Copy the full SHA
    97e6735 View commit details
  2. Copy the full SHA
    283591b View commit details
  3. Copy the full SHA
    a81a4c5 View commit details
  4. Copy the full SHA
    4246faf View commit details
  5. ignore scratch directory

    whitews committed Mar 23, 2022
    Copy the full SHA
    916ac41 View commit details
  6. Copy the full SHA
    0a93689 View commit details
  7. Copy the full SHA
    9da467d View commit details
  8. Copy the full SHA
    0837b69 View commit details
  9. uupdate examples

    whitews committed Mar 23, 2022
    Copy the full SHA
    f5cb124 View commit details
  10. release v1.0.0

    whitews committed Mar 23, 2022
    Copy the full SHA
    00ca467 View commit details

Commits on May 18, 2022

  1. bump to next beta

    whitews committed May 18, 2022
    Copy the full SHA
    228e5b6 View commit details
  2. Copy the full SHA
    0717f3a View commit details

Commits on May 19, 2022

  1. Copy the full SHA
    60bb122 View commit details
  2. Copy the full SHA
    c3bcd3c View commit details
Showing with 2,010 additions and 847 deletions.
  1. +40 −0 .github/workflows/test_base.yml
  2. +45 −0 .github/workflows/test_flowkit_develop.yml
  3. +45 −0 .github/workflows/test_flowkit_master.yml
  4. +14 −0 .github/workflows/tests_develop.yml
  5. +14 −0 .github/workflows/tests_master.yml
  6. +2 −0 .gitignore
  7. +13 −0 .readthedocs.yaml
  8. +0 −18 .travis.yml
  9. +2 −0 MANIFEST.in
  10. +27 −15 README.md
  11. +8 −0 docs/_static/css/custom.css
  12. +16 −6 docs/api.rst
  13. +7 −7 docs/conf.py
  14. +34 −8 docs/index.rst
  15. +3 −0 docs/requirements.txt
  16. +1 −1 examples/compensate_example.py
  17. +4 −46 examples/fabricate_fcs_file.py
  18. BIN examples/fcs_files/data1.fcs
  19. BIN examples/fcs_files/data_start_offset_discrepancy_example.fcs
  20. BIN examples/fcs_files/data_stop_offset_discrepancy_example.fcs
  21. BIN examples/fcs_files/variable_int_example.fcs
  22. +0 −42 examples/print_channels.py
  23. +2 −2 examples/read_fcs_file.py
  24. +3 −1 examples/reshape_events.py
  25. +0 −2 flowio/__init__.py
  26. +0 −208 flowio/create_fcs.py
  27. +0 −416 flowio/flowdata.py
  28. +0 −9 flowio/tests/__init__.py
  29. +0 −23 flowio/tests/fcs_write_tests.py
  30. +0 −19 flowio/tests/flowdata_lmd_tests.py
  31. +38 −0 pyproject.toml
  32. +1 −1 run_tests.py
  33. +13 −20 setup.py
  34. +13 −0 src/flowio/__init__.py
  35. +4 −0 src/flowio/_version.py
  36. +352 −0 src/flowio/create_fcs.py
  37. +40 −0 src/flowio/exceptions.py
  38. +67 −0 src/flowio/fcs_keywords.py
  39. +606 −0 src/flowio/flowdata.py
  40. +66 −0 src/flowio/utils.py
  41. +10 −0 tests/__init__.py
  42. +404 −0 tests/test_fcs_write.py
  43. +36 −3 flowio/tests/flowdata_tests.py → tests/test_flowdata.py
  44. +43 −0 tests/test_flowdata_lmd.py
  45. +37 −0 tests/test_read_multiple_datasets.py
40 changes: 40 additions & 0 deletions .github/workflows/test_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test

on:
workflow_call:

jobs:
test:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install
run: |
pip install --upgrade pip
pip install coverage
pip install -e .[test]
- name: Run tests with coverage
run: |
coverage run --source flowio run_tests.py
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
45 changes: 45 additions & 0 deletions .github/workflows/test_flowkit_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test FlowKit downstream (develop)

on:
push:
branches:
- develop

jobs:
test-develop:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Checkout FlowIO
uses: actions/checkout@v4
with:
ref: develop
path: flowio

- name: Checkout FlowKit (develop)
uses: actions/checkout@v4
with:
repository: whitews/FlowKit
ref: develop
path: flowkit

- name: Install FlowKit
working-directory: flowkit
run: |
pip install --upgrade pip
pip install .
pip install ../flowio
- name: Run FlowKit tests
working-directory: flowkit
run: |
python3 ./run_tests.py
45 changes: 45 additions & 0 deletions .github/workflows/test_flowkit_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test FlowKit downstream (master)

on:
push:
branches:
- master

jobs:
test-master:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Checkout FlowIO
uses: actions/checkout@v4
with:
ref: master
path: flowio

- name: Checkout FlowKit (master)
uses: actions/checkout@v4
with:
repository: whitews/FlowKit
ref: master
path: flowkit

- name: Install FlowKit
working-directory: flowkit
run: |
pip install --upgrade pip
pip install .
pip install ../flowio
- name: Run FlowKit tests
working-directory: flowkit
run: |
python3 ./run_tests.py
14 changes: 14 additions & 0 deletions .github/workflows/tests_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test (develop)

on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
test:
uses: whitews/FlowIO/.github/workflows/test_base.yml@develop
secrets: inherit
14 changes: 14 additions & 0 deletions .github/workflows/tests_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test (master)

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
uses: whitews/FlowIO/.github/workflows/test_base.yml@master
secrets: inherit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
.DS_Store
build/
dist/
scratch/
*.egg
*.fcs
*.egg-info
/docs/_build/*
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.10"

python:
install:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/conf.py
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include LICENSE
prune tests/
42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,15 +3,34 @@
[![PyPI license](https://img.shields.io/pypi/l/flowio.svg?colorB=dodgerblue)](https://pypi.python.org/pypi/flowio/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/flowio.svg)](https://pypi.python.org/pypi/flowio/)
[![PyPI version](https://img.shields.io/pypi/v/flowio.svg?colorB=blue)](https://pypi.python.org/pypi/flowio/)
[![DOI](https://zenodo.org/badge/14634514.svg)](https://zenodo.org/badge/latestdoi/14634514)

[![Build Status](https://travis-ci.com/whitews/FlowIO.svg?branch=master)](https://travis-ci.com/whitews/FlowIO)

[![Test (master)](https://github.com/whitews/FlowIO/actions/workflows/tests_master.yml/badge.svg)](https://github.com/whitews/FlowIO/actions/workflows/tests_master.yml)
[![Test (develop)](https://github.com/whitews/FlowIO/actions/workflows/tests_develop.yml/badge.svg)](https://github.com/whitews/FlowIO/actions/workflows/tests_develop.yml)
[![Coverage](https://codecov.io/gh/whitews/FlowIO/branch/master/graph/badge.svg)](https://codecov.io/gh/whitews/flowio)
[![Documentation Status](https://readthedocs.org/projects/flowio/badge/?version=latest)](https://flowio.readthedocs.io/en/latest/?badge=latest)
![PyPI - Downloads](https://img.shields.io/pypi/dm/flowio)

## Overview

FlowIO is a Python library for reading / writing Flow Cytometry Standard (FCS)
files and has zero external dependencies. FlowIO is compatible with Python 3 (FlowIO v0.9.9 was the last release supporting Python 2).
files, with zero external dependencies and is compatible with Python 3.7+.

FlowIO retrieves event data exactly as it is encoded in the FCS file: as a
1-dimensional list without separating the events into channels or performing
any preprocessing (e.g. applying gain). Metadata stored in the FCS file is
available as a dictionary via the 'text' attribute. Basic attributes are also
available for commonly accessed properties. For example, the channel count
can be used to easily convert the event data to a multi-column NumPy array:

```
import flowio
import numpy
fcs_data = flowio.FlowData('example.fcs')
npy_data = numpy.reshape(fcs_data.events, (-1, fcs_data.channel_count))
```

For higher level interaction with flow cytometry data, including GatingML and FlowJo 10 support,
see the related [FlowKit](https://github.com/whitews/FlowKit) project.
@@ -29,21 +48,14 @@ Or, if you prefer, you can install from the GitHub source:
```
git clone https://github.com/whitews/flowio
cd flowio
python setup.py install
pip install .
```

## Usage
## Documentation

FlowIO retrieves event data exactly as it is encoded in the FCS file: as a
1-dimensional list without separating the events into channels. However, all the metadata
found within the FCS file is available as a dictionary via the 'text' attribute. Basic attributes
are also available for commonly accessed properties. For example, the channel count
can be used to easily convert the event data to a multi-column NumPy array:
The FlowIO API documentation is available [on ReadTheDocs here](https://flowio.readthedocs.io/en/latest/?badge=latest). If you have any questions about FlowIO or find any bugs [please submit an issue to the GitHub repository here](https://github.com/whitews/FlowIO/issues/new/).

```
import flowio
import numpy
### Changelogs

[Changelogs for versions are available here](https://github.com/whitews/FlowIO/releases)

fcs_data = flowio.FlowData('example.fcs')
npy_data = numpy.reshape(fcs_data.events, (-1, fcs_data.channel_count))
```
8 changes: 8 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -10,4 +10,12 @@ dl.method {
dl.function {
margin-top: 27px;
margin-left: 17px;
}

dt.field-even {
padding-top: 27px;
}

dd.field-even {
padding-top: 27px;
}
22 changes: 16 additions & 6 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
.. currentmodule:: flowio

FlowIO API
===================================

FlowIO includes a single FlowData class for reading existing FCS files and
a :code:`create_fcs` function for creating new FCS files.

FlowData Class
--------------

.. autoclass:: flowio.FlowData
.. autoclass:: FlowData
:members:


Reading FCS Files with Multiple Data Sets
-----------------------------------------

.. autofunction:: read_multiple_data_sets

Creating New FCS Files
----------------------

.. automodule:: flowio.create_fcs
:members:
.. autofunction:: create_fcs

FlowIO Exceptions
-----------------

.. automodule:: flowio.exceptions
:members:
14 changes: 7 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@

on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../src'))
else:
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('../src'))


class Mock(MagicMock):
@@ -68,13 +68,13 @@ def __getattr__(cls, name):
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'

html_theme_options = {
# 'logo': 'flowutils.png',
'github_user': 'whitews',
'github_repo': 'flowio',
'github_banner': True
# 'logo': 'logo.png',
# 'github_user': 'whitews',
# 'github_repo': 'flowio',
# 'github_banner': True
}

# Add any paths that contain custom static files (such as style sheets) here,
Loading