A Python library for SeaFlow data.
Project description
Seaflowpy
A Python package for SeaFlow flow cytometer data.
Install
This package is compatible with Python 3.7.
Command-line tool as single-file download
Single file executables of the seaflowpy
command-line tool
for MacOS and Linux can be downloaded from the project's github
release page.
Docker
Docker image are available from Docker Hub at ctberthiaume/seaflowpy
.
docker run -it ctberthiaume/seaflowpy seaflowpy version
The Docker build file is in this repo at /Dockerfile
.
PyPI
pip3 install seaflowpy
Source
This will clone the repo and create a new virtual environment seaflowpy
.
venv
can be replaced with virtualenv
, conda
, etc.
git clone https://github.com/armbrustlab/seaflowpy
cd seaflowpy
python3 -m venv seaflowpy
source seaflowpy/bin/activate
pip3 install -r requirements.txt
pip3 install .
# Confirm the seaflowpy command-line tool is accessible
seaflowpy version
deactivate
Integration with R
To call seaflowpy
from R, update the PATH environment variable in
~/.Renviron
. For example:
PATH=${PATH}:${HOME}/venvs/seaflowpy/bin
Testing
Seaflowpy uses pytest
for testing. Tests can be run from this directory as
pytest
to test the installed version of the package, or run tox
to install
the source into a temporary virtual environment for testing.
Command-line interface
All seaflowpy
CLI tools are accessible from the seaflowpy
executable.
Run seaflowpy --help
to begin exploring the CLI usage documentation.
SFL validation workflow
SFL validation sub-commands are available under the seaflowpy sfl
command.
The usage details for each command can be accessed as seaflowpy sfl <cmd> -h
.
seaflowpy sfl convert-gga
Converts GGA coordinate values to decimal degree. Otherwise the file is unchanged.
seaflowpy sfl dedup
Remove lines in an SFL file with duplicate "FILE" values. Because it's impossible to know which of the duplicated SFL entries corresponds to which EVT file, all duplicate rows are removed. A unique list of removed files is printed to STDERR.
seaflowpy sfl manifest
Compare EVT files listed in an SFL file with EVT files on-disk or in cloud object storage. This can serve as a quick sanity check for the internal consistency of a SeaFlow cruise data folder. NB, it's normal for one file to be missing from the SFL file or EVT day of year folder around midnight.
seaflowpy sfl print
Print a standard version of an SFL file with only the necessary columns. The correct day of year folder will be added to "FILE" column values if not present. "DATE" column will be created if not present from "FILE" column values (only applies to new-style datestamped file names). Any other required columns which are missing will be created with "NA" values.
seaflowpy sfl validate
Validate key values in an SFL file. The following checks are performed:
- all required columns are present
- "FILE" column values have day of year folders, are in the proper format, in chronological order, and are unique
- "DATE" column values are in the proper format, represent valid date and times, and are UTC
- "LAT" and "LON" coordinate column values are valid decimal degree values
Because some of these errors can affect every row of the file
(e.g. out of order files), only the first error of each type is printed.
To get a full printout of all errors run the command with --verbose
.
Development
Build
To build source tarball, wheel, PyInstaller files, and Docker image, run ./build.sh
.
This will
-
create
dist
with source tarball and wheel file -
executable files in
./pyinstaller/macos/dist/seaflowpy
and./pyinstaller/linux64/dist/seaflowpy
-
Docker image named
seaflowpy:<version>
To remove all build files, run git clean -fd
.
PyInstaller files and Docker image create depend on the wheel file located in dist
.
Updating requirements files
Create a new virtual environment
python3 -m venv newenv
source newenv/bin/actviate
And install seaflowpy
pip3 install .
Then freeze the requirements
pip3 freeze | grep -v seaflowpy >requirements.txt
Then install dev dependencies and freeze
pip3 install pylint pytest tox twine
pip3 freeze | grep -v seaflowpy >requirements-dev.txt
Do some testing, then leave this temporary virtual environment
deactivate
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
File details
Details for the file seaflowpy-0.14.0.tar.gz
.
File metadata
- Download URL: seaflowpy-0.14.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b4b39bc2a54ce9bfb1a6703e0e59c23e621c2c9caff09e4a5a4557965766387 |
|
MD5 | d3ef0f97fe8db8bd932c26bf6a311ee1 |
|
BLAKE2b-256 | f43457c2d44361af4da62952443b8e2e70987831e984f2f28f46a24507cdd930 |
File details
Details for the file seaflowpy-0.14.0-py3-none-any.whl
.
File metadata
- Download URL: seaflowpy-0.14.0-py3-none-any.whl
- Upload date:
- Size: 54.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 895e494d6898310c1da1ee6169b56098f93d15c6bd270679b71522754b6eb546 |
|
MD5 | ed33d122d0f00031bce5d93f659c89ba |
|
BLAKE2b-256 | 49d54681ff405604b58af3bbc99cdcba74bb55067cd20ecc8eee4f8ac0c36a5c |