Skip to content

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

License

Notifications You must be signed in to change notification settings

brunocalet/OpenSpecy

 
 

Repository files navigation

Open Specy

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

CRAN version Project Status R-CMD-check License: CC BY 4.0 DOI Website Twitter Follow

Raman and (FT)IR spectral analysis tool for plastic particles and other environmental samples (Cowger et al. 2021, doi: 10.1021/acs.analchem.1c00123). Supported features include reading spectral data files (.asp, .csv, .jdx, .spc, .spa, .0), Savitzky-Golay smoothing of spectral intensities with smooth_intens(), correcting background noise with subtr_bg() in accordance with Zhao et al. (2007, doi: 10.1366/000370207782597003), and identifying spectra using an onboard reference library (Cowger et al. 2020, doi: 10.1177/0003702820929064). Analyzed spectra can be shared with the Open Specy community. A Shiny app is available via run_app() or online at http://www.openspecy.org.

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")

Getting started

library(OpenSpecy)
run_app()

See package vignette for a detailed standard operating procedure.

Workflow

library(dplyr)

# Fetch current spectral library from https://osf.io/x7dpz/
get_lib()

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

# Read sample spectrum
raman_hdpe <- read_text(read_extdata("raman_hdpe.csv"))

# Share your spectrum with the Open Spey community
share_spec(raman_hdpe,
           metadata = c(user_name = "Win Cowger",
                        contact_info = "wincowger@gmail.com",
                        spectrum_type = "Raman",
                        spectrum_identity = "HDPE")
           )

# Adjust spectral intensity
raman_adj <- raman_hdpe %>%
  adj_intens()

# Smooth and background-correct spectrum
raman_proc <- raman_adj %>% 
  smooth_intens() %>% 
  subtr_bg()

# Match spectrum with library and retrieve meta data
match_spec(raman_proc, library = spec_lib, which = "raman")

find_spec(sample_name == 5381, library = spec_lib, which = "raman")

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, Steinmetz Z (2021). “OpenSpecy: Analyze, Process, Identify, and Share, Raman and (FT)IR Spectra.” R package, 0.9.3. https://github.com/wincowgerDEV/OpenSpecy.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 90.9%
  • JavaScript 8.9%
  • HTML 0.2%