spectralAnalysis (version 4.3.3)

SpectraInTime-class: SpectraInTime-class

Description

Time resolved spectra for one experiment

Usage

# S4 method for SpectraInTime
dim(x)

extractSummarySpecs(object, summaryFunctions = getDefaultSumFunc())

# S4 method for SpectraInTime summary(object, summaryFunctions = getDefaultSumFunc())

# S4 method for SummaryByWavelengths show(object)

# S4 method for SpectraInTime as.data.frame(x, timePointsAlt = FALSE, timeUnit = "seconds")

# S4 method for SpectraInTime,missing plot( x, y, type = "3D", timeUnit = "hours", timePointsAlt = FALSE, ylab = "Wavelength", colors = "D", nColors = 200, limits = NULL )

# S3 method for list plot(x, ..., type = "line", ncol = 2)

Value

data.frame with first column wavelengths followed

a data.frame containing spectral information in long format

data.frame

Arguments

x

the object to be plotted

object

SpectraInTime-class

summaryFunctions

character vector of summary functions

timePointsAlt

see getTimePoints

timeUnit

time unit specification in the form of a character string

y

not used, for consitency with plot method

type

character choice of plot type between: * "3D" surface plot (default) * "spectralAxis" spectral axis in legend, time on the axis * "wavelength" same behaviour as with type is "spectralAxis", kept for historical reasons * "time" time in legend, spectral values on the axis * "contour" contour plot of spectra time versus spectral values

ylab

Specification y-axis label. By default this is "Wavelength", but can be different for e.g. mass spectra

colors

colorblind friendly palettes are used from the de viridis_pal choice between "A" (magna), "B" (inferno), "C" (plasma) and "D" the default viridis color palette

nColors

number of colours to use, only relevant if type is "contour", defaults to 200

limits

2-element numeric vector specifying the range of values onto which the color scale should be mapped (currently only relevant if type is "contour")

...

additional argument, for plotting a list of spectra one can use:

  • times numeric vector of time points to plot

  • timeUnit time unit for times default to "seconds"

  • timePointsAlt logical value indicating whether alternative time axis should be used, defaults to FALSE

Slots

spectra

matrix of spectral measurement with as rows timePoints and columns spectral axis

experimentName

character vector with name of the experiment

spectralAxis

numeric vector of spectral values (e.g. wavelengths or mass to charge)

timePoints

of measurement in seconds

timePointsAlt

numeric vector of shifted time points in order to time align multiple spectral measurements in plots, by default equal to timePoints

extraInfo

list additional information such as probe type

startTime

start date and time POSIXct format

units

list with information on measurement units

preprocessing

list of preprocessing steps in taken in order

Author

Adriaan Blommaert

Examples

Run this code
 spectralExample  <-  getSpectraInTimeExample() 
 summarySpectra   <-  summary( spectralExample )
 str( summarySpectra )
 summarySpectra

## convert to data.frame
spectra                 <-  getSpectraInTimeExample()
spectraFlat             <-  as.data.frame( spectra )


### visualization 
  # \donttest{
  data = getSpectraInTimeExample()
  plot( x =  data , type = "3D" , timeUnit = "hours" , timePointsAlt = FALSE )
  plot( x =  data[  , r(500, 350) ] , type = "3D" ,
      timeUnit = "hours" , timePointsAlt = TRUE , colors = "B"  )
  plot( x =  data[ e( 1 , 2 , 3) , , timeUnit = "hours" ] ,
      type = "time" , timeUnit = "hours" , timePointsAlt = FALSE ) 
  plot( x =  data[ , e( seq( 200 , 400 , 50 ) ) ] , 
     type = "spectralAxis" , timeUnit = "minutes" , timePointsAlt = TRUE , colors = "A" )

  plot( x = data , type = "contour" , nColors = 200 , 
    colors = "C" , timeUnit = "seconds", timePointsAlt = TRUE)
# }

 ## plotting a list of spectra
    
 listOfSpectra     <-  getListOfSpectraExample()
 plot( listOfSpectra , times = 1 , timeUnit = "hours" )
 plot( listOfSpectra , times = 1 , timeUnit = "hours" , timePointsAlt = TRUE  )
 plot( listOfSpectra , times = 1:3 , timeUnit = "hours" , colors = "B" ) 
# \donttest{
 plot( listOfSpectra , timeUnit = "hours" , colors = "C" , type = "contour" )
# }

Run the code above in your browser using DataLab