This package automates the aggregation of output from MIDI Inc. Sherlock PLFA Analysis Software into a single csv file.
Project description
PLFA Tools Aggregator
Purpose
The MIDI Inc. Sherlock PLFA Analysis Software has a paid add-on package called PLFA Tools. The software takes as input GC results of PLFA (and NLFA) samples and assigns peaks to categories (General FAME, Gram Negative, etc.). The software creates a new Excel Worksheet for each sample, possibly resulting in hundreds of worksheets of various formats. The purpose of this package is to automate the aggregation of the data into a single CSV file for analysis.
License
As a work of the United States government, this project is in the public domain within the United States.
Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication.
Installation information
Can be installed using pip:
pip install plfatools
Must be using Python 3 or later to use this package.
Using this package
From command line
PlfaTools can be used via the command line by running the main file within the aggregator package. It takes two arguments: 1) a full path to the directory containing the files to be aggregated and 2) a full path to the directory where you want the final.csv file to be written.
Example:
> python -m plfatools "C:\Files\Experiment1\PlfaOutput" "C:\Files\Experiment1\Output"
Where:
"C:\Files\Experiment1\PlfaOutput"
is the directory with xlsx files to be aggregated"C:\Files\Experiment1\Output"
is the directory where "final.csv" file containing aggregated data is written
From Python
PlfaTools can also be imported as a module: import plfatools
The Aggregator
Class contains four functions, listed below in order of decreasing generality:
read_dir()
: Reads a directory path that contains multiple files from PLFA Tools and returns a pandas DataFrame with all data from all files and worksheetsread_file()
: Reads a file from PLFA Tools and returns a pandas DataFrame with all data from all worksheetstransform_stacked_to_tidy()
: Accepts a Pandas DataFrame generated by "read_dir" or "read_file" and returns a new DataFrame in a tidy formattransform_raw_to_stacked()
: Reformats output from PLFA Tools, of a single sample, into proper tabular format
Note: If there are other .xlsx files in the directory to be aggregated this will cause errors as the main file assumes all the XLSX files in the directory are GC results.
Example:
import pathlib
import plfatools
# create an aggregator object
aggregator = plfatools.Aggregator()
# specify path to directory with PLFA Tools output (Windows paths)
path_to_directory = pathlib.Path('C:\\Files\\Experiment1\\PlfaOutput')
# aggregate and format instrument output and assign it to a Pandas DataFrame
plfa_data = aggregator.read_dir(path_to_directory)
# alternatively, read a single file and assign the formatted output to Pandas DataFrame
path_to_file = path_to_directory / 'gc-output.xlsx'
plfa_data = aggregator.read_file(path_to_file)
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 plfatools-0.1.0.tar.gz
.
File metadata
- Download URL: plfatools-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dab25711209ee8bc64c420ccef22de33c04accfd501160d2b39b5549a22bb104 |
|
MD5 | 1c618279d928d3d4e3f0fc11c379ae7f |
|
BLAKE2b-256 | 5597b5890ffa82ad9f1e26698ff00b35ba528fb389adac2a979b98fcb1544fae |
File details
Details for the file plfatools-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: plfatools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13e560a9614554143bb9803ad0e74fa80acc5d0954d4131ce0fb3d16249913a |
|
MD5 | 0aedf70b27de3dc97b777eb0c4329504 |
|
BLAKE2b-256 | 0256f800d0d53b4fc71b66a9f64ef82f9c186efc3d41116766801f5776fcad73 |