Learn R Programming

spectralAnalysis (version 4.3.3)

Pre-Process, Visualize and Analyse Spectral Data

Description

Infrared, near-infrared and Raman spectroscopic data measured during chemical reactions, provide structural fingerprints by which molecules can be identified and quantified. The application of these spectroscopic techniques as inline process analytical tools (PAT), provides the pharmaceutical and chemical industry with novel tools, allowing to monitor their chemical processes, resulting in a better process understanding through insight in reaction rates, mechanistics, stability, etc. Data can be read into R via the generic spc-format, which is generally supported by spectrometer vendor software. Versatile pre-processing functions are available to perform baseline correction by linking to the 'baseline' package; noise reduction via the 'signal' package; as well as time alignment, normalization, differentiation, integration and interpolation. Implementation based on the S4 object system allows storing a pre-processing pipeline as part of a spectral data object, and easily transferring it to other datasets. Interactive plotting tools are provided based on the 'plotly' package. Non-negative matrix factorization (NMF) has been implemented to perform multivariate analyses on individual spectral datasets or on multiple datasets at once. NMF provides a parts-based representation of the spectral data in terms of spectral signatures of the chemical compounds and their relative proportions. See 'hNMF'-package for references on available methods. The functionality to read in spc-files was adapted from the 'hyperSpec' package.

Copy Link

Version

Install

install.packages('spectralAnalysis')

Monthly Downloads

284

Version

4.3.3

License

GPL-3

Maintainer

Adriaan Blommaert

Last Published

January 30th, 2024

Functions in spectralAnalysis (4.3.3)

checkIdenticalClass

check wether all elements of of the same class
combineSpectralObjects

Function to combine SpectraInTime-class objects containing 1 spectrum each
getDefaultSumFunc

function to get default summary functions
first

return first element (of a vector)
getDimensionReduction

generic function to extract dimensionReduction-slot
getDefaultTimeFormat

function to get default time format in the package
getElements

generic function to extract elements-slot
firstSpectrum

Get the first spectrum
completeSourceMatrix

complete source matrix
getRange

generic function to extract range-slot
getClosestElements

get closest element for elements looked up in a vector
flagVectorInInterval

flag vector elements within interval (closed interval )
getExtraInfo

generic function to extract extraInfo-slot
getExperimentName

generic function to extract experimentName-slot
getSpectra

generic function to extract spectra-slot
getPathProcessTimesExample

example path process times
getProcessTimesExample

get a minimal ProcessTimes-class example based on getSpectraInTimeExample
getTimePoints

generic function to extract timePoints-slot
getTimeConversionFactor

transform timeUnit to convert from seconds to specified unit
getPreprocessing

generic function to extract preprocessing-slot
getProcessTimesFrameExample

get mimimal example ProcessTimesFrame-class
getSpectraInTimeCompExample

Artificial example of SpectraInTimeComp-class
initializeNMFModel

Initialize NMF model with initial spectral data
includeRedundantSources

Re-introduce redundant sources in NMF-model
getUnits

generic function to extract units-slot
getSpectraInTimeExample

Artificial example SpectraInTime-class
convertS4ToList

convert an S4 object into a list
last

return laste element( of a vector )
lastSpectrum

Get the last spectrum
getStartTime

generic function to extract startTime-slot
loadAllSPCFiles

Load all or a selection of SPC files from a given directory.
getSpectralAxis

generic function to extract spectralAxis-slot
localBaselineCorrect

Local baseline correction
multiplicativeScatterCorrect

multiplicative scatter correction on 1 function
preprocess

generic function to preprocess an S4 object
scaleNMFResult

Apply fixed scaling to NMF model
preprocessSpectraInTimeWithList

internal function to wrap multiple preprocessing steps
predictNNLS

Based on previously obtained NMF result NMFResult, estimate coefficients for a new spectralData object object using non-negative least squares fitting. The result is returned as as an NMF model.
getListOfSpectraExample

get example list of spectra
getNMFInputMatrix

Get spectralData as input NMF model
e

Create an ElementsToSelect-class from a numeric vector or multiple numeric values or vectors
runNMF

Actual NMF analysis
saveSpectra

read or save a SpectraInTime-class from or to a .txt file
r

create a RangeToSubset-class object from 2 elements or from a vector
plotlyAxis

help function to make plotly axis title
scatterCorrect

perform multiplicative scatter correction
scatterCorrectSpectra

perform multiplicative scatter correction on spectralData
normalize

generic normalization function
readSPC

Read-in of a SPC file.
removeRedundantSources

Remove redundant sources from the initial NMF model
nonNegativePreprocessing

condition datamatrix to input in and condition properly for NMF
readProcessTimes

read .csv file as process times
spectralIntegration

Integrate spectraInTime object
setExperimentName<-

set the experiment name
spectralNMFList

Perform Non-Negative Matrix factorization on list of SPC files
subset-methods

Subsetting SpectraInTime-class
spectralSmoothAndDifferentiate

internal smoothing and differentiation function
spectralPLSCalibration

Compute PLS model
spectralPlsPrediction

Perform PLS prediction
setTimePointsAlt<-

set time alternative time axis
spectralNMF

Perform Non-Negative Matrix factorization on spectral data
timeAlign.listOfSpectra

Align all spectra in a list
trapz

Integration via trapezium rule
upsampleNMFResult

Upsample NMF result to original temporal resolution
spectralNormalization

normalization function
timeAlign

Time align first object, using info in the second object
smooth

generic smoothing function
wavelengthAlign

Wavelength align spectral data
testListOfSpectra

internal function to check all elements are spectraInTime
subset.SpectraTime

internal function for subsetting
timeAlign.SpectraInTime

align 1 SpectraInTime with 1 cooling information
RangeToSubset-class

RangeToSubset-class
ElementsToSelect-class

Elements S4 class useful for closest elements subsetting
SummaryByWavelengths-class

S4-class for summary object SpectraInTime
baselineCorrect

generic function to perfom baseline correction
ProcessTimesFrame-class

ProcessTimes-class
ProcessTimes-class

S4 Class key process times
SpectraInTimeComp-class

SpectraInTimeComp-class (time resolved spectra )
checkForRedundantSources

Check for redunt NMF source vectors
computeNMFResidu

NMF relative residual per observation
addMessage

add an message to list of messages for printing #
checkMethod

check method in list of allowd method
SpectraInTime-class

SpectraInTime-class
checkTimeUnit

check timeeUnit and produce error if not correct unit
changeDevSettings

Function to overwrite default settings
convertListToS4

convert an a named list to S4 object
addPreprocessingStep

function to use by preprocessing step
checkCompatible

Check object compatibility