In ChemoSpec2D, spectral data sets are stored in an S3 class called Spectra2D, which contains a variety of information in addition to the spectra themselves. Spectra2D objects are created by files2Spectra2DObject.

Structure

The structure of a Spectra2D object is a list of eight elements and an attribute as follows: w

elementtypedescription
$F2numA common frequency (or wavelength) axis corresponding
to the F2 dimension in NMR or the x axis more generally.
Must be sorted ascending.
$F1numA common frequency (or wavelength) axis corresponding
to the F1 dimension in NMR or the y axis more generally.
Must be sorted ascending.
$datanumA list of matrices. Each matrix contains a 2D spectrum.
Each matrix should have length(F1) rows and
length(F2) columns. The matrix must not have dimnames.
The low end of the F2 dimension is last column of the last row
(lower right hand corner as typically displayed). The low end of
the F1 dimension is the last column of the first row (upper right hand corner).
In other words, the spectrum is stored as typically displayed.
The list of matrices, if named, should have the same names as
names. However, this is not currently enforced.
$nameschrThe sample names for the spectra; length must be no. samples.
$groupsfactorThe group classification of the samples; length must be no. samples.
$colorscharacterColors for plotting; length must be no. samples.
Colors correspond to groups.
$unitschrThree entries, the first giving the F2 (x) axis unit, the
second the F1 (y) axis unit, and the third the z axis unit,
usually some kind of intensity.
$descchrA character string describing the data set.
- attrchr"Spectra2D" The S3 class designation.

See also

sumSpectra to summarize a Spectra2D object. sumGroups to summarize group membership of a Spectra2D object. chkSpectra to verify the integrity of a Spectra2D object.

Author

Bryan A. Hanson, DePauw University.

Examples

data(MUD1) str(MUD1)
#> List of 8 #> $ F2 : num [1:100] 0 0.0505 0.101 0.1515 0.202 ... #> $ F1 : num [1:50] 10 11.4 12.9 14.3 15.7 ... #> $ data :List of 10 #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> ..$ : num [1:50, 1:100] 0.08046 0.03152 0.05684 0.00853 0.00185 ... #> $ names : chr [1:10] "Alcohol_1" "Alcohol_2" "Alcohol_3" "Alcohol_4" ... #> $ groups: Factor w/ 2 levels "Alcohol","Ether": 1 1 1 1 1 2 2 2 2 2 #> $ colors: chr [1:10] "black" "black" "black" "black" ... #> $ units : expression(""^1 * H ~ ppm, ""^13 * C ~ ppm, "intensity") #> $ desc : chr "MUD1: HSQC-like data for testing. See ?MUD1" #> - attr(*, "class")= chr "Spectra2D"
sumSpectra(MUD1)
#> #> MUD1: HSQC-like data for testing. See ?MUD1 #> #> There are 10 spectra in this set. #> #> The F2 dimension runs from 0 to 5 ""^1 * H ~ ppm #> and there are 100 data points. #> #> The F1 dimension runs from 10 to 80 ""^13 * C ~ ppm #> and there are 50 slices. #> #> The spectra are divided into 2 groups: #> #> group no. color #> 1 Alcohol 5 black #> 2 Ether 5 red #> #> *** Note: this is an S3 object #> of class 'Spectra2D'