Skip to content

About

An R Shiny application for easy-to-use phytoplankton chemotaxonomy. This app wraps the phytoclass Simulated Annealing algorithm to determine class abundances from HPLC pigments, featuring interactive quality control, pigment clustering, and visualization.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phytoclassShiny

A guided workflow for phytoplankton pigment chemotaxonomy.

Version 1.1.0-beta

DOI License: GPL v3

Overview

phytoclassShiny is an open-source R Shiny application for estimating phytoplankton community composition from HPLC pigment data. It is a graphical interface to the phytoclass R package (Hayward et al., 2023), which fits pigment:chlorophyll a ratios by simulated annealing within published bounds, so no coding and no initial ratio table are needed.

The app guides each analysis through seven steps, from raw laboratory spreadsheets to a documented, reproducible result, and records every setting, decision and removed sample.

What the app adds, and what it can't tell you

phytoclassShiny calls phytoclass's own functions with the matrices, bounds, iterations, cooling step and seeds recorded in its report; it doesn't change the method. What it adds is preparation of the data, a record of every decision, and checks on the result:

  • Before the run, Build Matrix flags groups that can't be told apart with your pigments, and pairs that look alike, with the pigment that separates them and how often it was detected.
  • After the run, each group in every batch gets a range (the lowest and highest share of the chlorophyll a it can take while the fit stays as good as the best one, allowing for measurement noise) and a status: determined, determined together, set by the bounds, undetermined or minor, with the reason and what to try. Leave-out tests say whether the data need each doubtful group. Four grades (search, fit, determination and calibration) say how strong the result is, and Run Analysis lists what to do next as six stages, runs each change as a test with a verdict, and keeps every attempt.

A good fit (low RMSE) shows that the chosen groups can rebuild the measured pigments, not that they are the right groups. These checks show whether the fit could tell the groups apart; whether a group is really present can only be shown by independent observations such as microscopy, flow cytometry or sequencing.

The workflow

  1. Setup. Name the run, choose where results are saved, and start from the defaults, your last session or a settings file. On first launch a welcome window offers a quick tour, a full guided example on phytoclass's own data, and a walkthrough of your own data. A view button in the top bar switches between Guided (one section at a time, every explanation shown, recommended settings) and Full (every section and option at once, with longer explanations behind an Explain link). Both views report the same results.
  2. Import & Map. Load .xlsx, .xls or .csv files with any column names, and choose the sheet to read where a workbook has several. Pigments, dates (one column or year/month/day, Excel dates and common text formats) and positions are matched automatically, including column names changed by R or Excel (such as X19.Butanoyloxyfucoxanthin), and confirmed in a mapping window. A units row under the headers is recognised, and units are checked across files.
  3. Filter & Clean. Set blanks, text such as <LOD, negatives and values below a detection limit to zero; remove empty samples, samples without Tchla and duplicates; optionally keep a location, date or depth range, or exclude named samples with a recorded reason. Each file's readiness for each filter and the range of your data are shown, files that hold the same samples are flagged, and every removed sample is kept with its reason.
  4. Build Matrix. Choose the phytoplankton groups to estimate. The reference matrix and ratio bounds come from phytoclass's bounds table and the pigments in your data, with checks for groups that can't be told apart and for pairs that look alike. In the Full view, bounds can be edited, with a required source.
  5. Batch Samples. Group files together or separately, then choose one batch or a published grouping approach (by sampling conditions or a column of your own; phytoclass's hierarchical recipe; Ward's method on Euclidean distances; k-means in the Full view), optionally compared side by side with homogeneity and silhouette metrics and, for large datasets, a subsample stability check.
  6. Run Analysis. Choose a run type (Quick look, Confirm or Thorough, each with the time it would take on your computer, or Custom) and fit each batch several times with recorded seeds. From the best fits the app works out each group's range and status, and how well each pigment is predicted from the others. Every run is a ticket: start it at once, or queue several. Tickets run in the background, several fits at a time, so the app stays usable, and tickets that haven't run are kept for the next session. Each finished ticket is an attempt, which opens to its batches and fits; when several fits are equally good, the most typical of them is reported. Where the result stands grades the result in use, lists what to do next, and runs each change as a test with a verdict. Check the ranges analyses simulated copies of your data and counts how often each range catches the true share; in the Full view, Compare options runs alternatives beside your result, and the Overnight search leaves out every group alone and together, checks each loss against chance, and keeps the fewest groups the data need.
  7. View Results. Start with the grades and the next step, then the fit numbers, the reliability of each group (per batch, with a by-batch and by-file overview), composition, pigment fit, convergence and run-to-run variability; compare the result with another run or with reference data (such as CHEMTAX or microscopy), and save everything.

On every tab, a run record under the top bar fills in as you go, and the bar at the bottom holds Back, what the step still needs, the page's own action and Proceed.

What a saved run contains

  • A report workbook that opens with an Overview (one row per batch and per file: how far each result can be trusted, and the average composition) and ends with a Column guide. A Reporting table lists what to report with the results. In between, one sheet per step: the settings used, what was done and why, every removed sample, every batch assignment, the per-sample estimates, fitted ratios, fit diagnostics, the reliability of each group, the improvement steps and every attempt made, plus the checksum of every input file and the version of every R package used.
  • A README saying where to start.
  • A draft methods paragraph with the references it relies on.
  • A settings file that reproduces the run when loaded in Setup.
  • Optionally: figures, one re-importable input file per batch, one result workbook per batch, and the raw phytoclass output.

Settings that affect results are kept separately from computer-specific preferences (results folder, time-estimate calibration, learned column names, custom colours), so shared settings files never contain local paths.

Installation and use

You need R 4.4.0 or later. RStudio is optional.

  1. Download or clone this repository.
  2. Windows: the first time, double-click Start here.bat. It makes a phytoclassShiny shortcut beside it, starts the app and then removes itself; from then on, double-click the shortcut. The first launch builds the app's own package library (only missing packages are downloaded), then opens the app in your browser. If the folder is moved, app/system/make_shortcut.bat makes the shortcut again, and app/LAUNCH_PHYTOCLASSSHINY.bat starts the app directly.
  3. RStudio (any system): open app/phytoclassShiny.Rproj, open app.R and click Run App. To build the package library first, run system/package_installer.R.

The first launch installs about 140 packages (about 145 MB, most of them required by phytoclass itself) into the app's own library, so your other R work is unaffected.

Exact package versions. app/system/package_repository.txt names the repository packages are installed from (CRAN by default). To install exactly the versions available on a given date, replace its line with a dated snapshot, for example https://packagemanager.posit.co/cran/2026-10-01. Every install writes the versions used to app/system/package_lock.csv, and every saved report lists every package loaded.

Without the browser. app/phytoclassShiny_run.R runs a whole analysis from the command line with the app's own code (Rscript phytoclassShiny_run.R --help in the app folder lists its options). app/tests/run_tests.bat runs a short set of checks that the app works on this computer.

Folder layout

Path Contents
Start here.bat First start on Windows: makes the shortcut and starts the app
README.txt Short start-up instructions for the downloaded folder
app/ The app: app.R, the launcher, R/core (calculations and shared interface parts), R/modules (one file per step), R/reference tables, system (installer, settings template, icon), tests
output/ Saved results (made the first time you save)

Citation

If you use phytoclassShiny, please cite:

Quinlan, L. B., et al. (2026). phytoclassShiny: a guided workflow for phytoplankton pigment chemotaxonomy. EarthArXiv preprint. https://doi.org/10.31223/X55J6R

and the phytoclass package:

Hayward, A., Pinkerton, M. H., & Gutierrez-Rodriguez, A. (2023). phytoclass: A pigment-based chemotaxonomic method to determine the biomass of phytoplankton classes. Limnology and Oceanography: Methods, 21, 220-241.

Other key references

  • Mackey, M. D., et al. (1996). CHEMTAX - a program for estimating class abundances from chemical markers: application to HPLC measurements of phytoplankton. Marine Ecology Progress Series, 144, 265-283.
  • Latasa, M. (2007). Improving estimations of phytoplankton class abundances using CHEMTAX. Marine Ecology Progress Series, 329, 13-21.

Licence

GNU General Public License v3.0 (see LICENSE). This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License. It is intended to remain a free, open tool for the scientific community.

About

An R Shiny application for easy-to-use phytoplankton chemotaxonomy. This app wraps the phytoclass Simulated Annealing algorithm to determine class abundances from HPLC pigments, featuring interactive quality control, pigment clustering, and visualization.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages