Analyze, Process, Identify, and Share Raman and (FT)IR Spectra

Raman and (FT)IR spectral analysis tool for plastic particles and other environmental samples (Cowger et al. 2025, ). With read_any(), Open Specy provides a single function for reading individual, batch, or map spectral data files like .asp, .csv, .jdx, .spc, .spa, .0, and .zip. process_spec() simplifies processing spectra, including smoothing, baseline correction, range restriction and flattening, intensity conversions, wavenumber alignment, and min-max normalization. Spectra can be identified in batch using an onboard reference library using match_spec(). A bundled Shiny app is available via run_app() or online at < https://www.openanalysis.org/OpenSpecyV2/>.


OpenSpecy

Analyze, Process, Identify, and Share Raman and (FT)IR Spectra

CRAN version Project Status R-CMD-check Codecov test coverage License: CC BY 4.0 DOI Website

Raman and (FT)IR spectral analysis tool for environmental samples with a special focus on microplastics (Cowger et al. 2025, doi: 10.1021/acs.analchem.5c00962). With read_any(), Open Specy provides a single function for reading individual, batch, or map spectral data files like .asp, .csv, .jdx, .spc, .spa, .0, and .zip. process_spec() simplifies processing spectra, including smoothing, baseline correction, range restriction and flattening, intensity conversions, wavenumber alignment, and min-max normalization. Spectra can be identified in batch using an onboard reference library using match_spec(). A bundled Shiny app is available via run_app() or directly on this website.

Use OpenSpecy online

Use the hosted browser app on the OpenSpecy website. The local app remains available through run_app().

Installation

OpenSpecy is available from CRAN and GitHub.

Install from CRAN (stable version)

You can install the latest release of OpenSpecy from CRAN with:

install.packages("OpenSpecy")

Install from GitHub (development version)

To install the development version of this package, paste the following code into your R console (requires devtools):

if (!require(devtools)) install.packages("devtools")
devtools::install_github("wincowgerDEV/OpenSpecy-package")

Getting started

library(OpenSpecy)
run_app()

Simple workflow for single spectral identification

See package vignette for a detailed standard operating procedure.

# Fetch the current spectral library from the Open Specy AWS distribution
get_lib("derivative")

# Load library into global environment
spec_lib <- load_lib("derivative")

# Read sample spectrum
raman_hdpe <- read_extdata("raman_hdpe.csv") |> 
  read_any()

# Look at the spectrum
plotly_spec(raman_hdpe)

# Process the spectra and conform it to the library format
raman_proc <- raman_hdpe |>
  process_spec(conform_spec_args = list(range = spec_lib$wavenumber),
               smooth_intens = TRUE, make_rel = TRUE)

# Compare raw and processed spectra
plotly_spec(raman_hdpe, raman_proc)

top_matches <- match_spec(raman_proc, library = spec_lib, na.rm = TRUE, top_n = 5,
                          add_library_metadata = "sample_name",
                          add_object_metadata = "col_id")

# Print the top 5 results with relevant metadata
top_matches[, c("object_id", "library_id", "match_val", "SpectrumType",
                "SpectrumIdentity")]

# Get all metadata for the matches
get_metadata(spec_lib, logic = top_matches$library_id)

Related Packages

Open Specy on Python

Kris Heath created a Open Specy python package! https://pypi.org/project/openspi/

Citations

Cowger W, Steinmetz Z, Gray A, Munno K, Lynch J, Hapich H, Primpke S, De Frond H, Rochman C, Herodotou O (2021). "Microplastic Spectral Classification Needs an Open Source Community: Open Specy to the Rescue!" Analytical Chemistry, 93(21), 7543-7548. doi: 10.1021/acs.analchem.1c00123.

Cowger W et al. (2025). "Open Specy 1.0: Automated (Hyper)spectroscopy for Microplastics." Analytical Chemistry, 97(32), 17345-17356. doi: 10.1021/acs.analchem.5c00962.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("OpenSpecy")

2.0.3 by Win Cowger, 15 days ago


https://github.com/wincowgerDEV/OpenSpecy-package/, https://www.openanalysis.org/OpenSpecyV2/, https://www.openanalysis.org/OpenSpecyV2/pkgdown/


Report a bug at https://github.com/wincowgerDEV/OpenSpecy-package/issues/


Browse source code at https://github.com/cran/OpenSpecy


Authors: Win Cowger [cre, aut, dtc] (ORCID: , Zacharias Steinmetz [aut] (ORCID: , Hazel Vaquero [aut] , Nick Leong [aut] , Andrea Faltynkova [aut, dtc] (ORCID: , Hannah Sherrod [aut] , Andrew B Gray [ctb] , Hannah Hapich [ctb] , Jennifer Lynch [ctb, dtc] (ORCID: , Hannah De Frond [ctb, dtc] (ORCID: , Garth Covernton [ctb, dtc] (ORCID: , Keenan Munno [ctb, dtc] (ORCID: , Chelsea Rochman [ctb, dtc] (ORCID: , Sebastian Primpke [ctb, dtc] (ORCID: , Orestis Herodotou [ctb] , Mary C Norris [ctb] , Christine M Knauss [ctb] (ORCID: , Aleksandra Karapetrova [ctb, dtc, rev] (ORCID: , Vesna Teofilovic [ctb] , Laura A. T. Markley [ctb] (ORCID: , Nicolas Coca Lopez [ctb] , Shreyas Patankar [ctb, dtc] , Rachel Kozloski [ctb, dtc] (ORCID: , Samiksha Singh [ctb] , Katherine Lasdin [ctb] , Cristiane Vidal [ctb] , Clare Murphy-Hagan [ctb] (ORCID: , Philipp Baumann [ctb] , Pierre Roudier [ctb] , Adam Hauser [ctb] , National Renewable Energy Laboratory [fnd] , Possibility Lab [fnd]


Documentation:   PDF Manual  


CC BY 4.0 license


Imports methods, data.table, jsonlite, caTools, hyperSpec, mmand, plotly, digest, zip, glmnet, cluster, jpeg, png, shiny, hdf5r, matrixStats

Suggests knitr, rmarkdown, testthat, doFuture, doRNG, foreach, future, ranger, sgolay, curl, shinyjs, shinyWidgets, shinyFiles, bs4Dash, dplyr, DT, reshape2, ggplot2, htmltools, scales


See at CRAN