msSet: S3 Class Representing a Set of Spectra with Common m/z Values

Description Usage Arguments Value S3 METHODS See Also Examples

Description

An object of class msSet is a list containing three required components:

mz

A vector of mass/charge values.

type

A factor denoting the disease label for each spectrum.

intensity

A matrix of intensity values. Each column corresponds to a spectrum and each row corresponds to an m/z value. The number of rows should be the same as the length of mz. The number of columns should be the same as the length of type.

It can also have additional elements such as "noise", "noise.local", "baseline", "tic", "peak.list", "peak.class", "peak.matrix", "intensity.mean", "noise.mean", and "noise.local.mean".

Usage

1
msSet(x, mz=NULL, type=NULL, data.name=NULL, ...)

Arguments

x

a vector, a matrix, a data.frame, or an object of class msSet.

...

additional elements to be added.

data.name

a character string denoting the name for the dataset. Default: NULL, i.e., using the variable name of the x argument.

mz

a vector of m/z values. It must be of the same length as x if x is a vector, or its length must be the same as the number of rows of x if x is a matrix or data.frame.

type

a factor denoting the disease label for each spectrum. This argument must be a scalar (length=1) if x is a vector, or a vector whose length is the same as the number of rows of x in the case that x is a matrix or data.frame.

Value

an object of class msSet.

S3 METHODS

[

spectra extraction from an msSet object.

Usage: x[i, j]

x

an msSet object.

i

a subscript expression used to identify the m/z elements to extract or replace.

j

a subscript expression used to identify the spectra to extract or replace.

image

displays a set of spectra as an image.

Usage: image(x, what="spectra", subset=NULL, xaxis="mass", xlim=NULL, add=FALSE, xaxs="i", yaxs="i", ...)

x

an msSet object.

what

a character string specifying what to be imaged. The options are "spectra", "noise", "noise.local", "baseline", "peak.list", and "peak.matrix". Default: "spectra". If what=="peak.matrix", the arguments subset, xaxis, and xlim are ignored.

subset

a numeric vector indicating the spectra numbers to be included. All spectra are included by default.

xaxis

a character string specifying what to be used as the x-axis. The options are "mass" and "time". Default: "time".

xlim

a numeric vector with two elements specifying the range for the x axis. Its first element should be less than its second element. If it is NULL (by default), the entire range of the data is plotted. If one of its element is NA, it is replaced with the corresponding limit.

add

a logical value. If TRUE, the plot is added using the current par() layout. Otherwise a new plot is produced. Default: FALSE.

xaxs

a character specifying the style of x axis interval calculation. Default: "i". See par for details.

yaxs

a character specifying the style of y axis interval calculation. Default: "i". See par for details.

...

Other graphical parameters passed to the image function.

plot

visualizes a particular processing step.

Usage: plot(x, process="msPrepare", subset=1, offset=0, xaxis="mass", xlim=NULL, pch=1, lty=1:2, col=1:8, lwd=1, add=FALSE, ...)

x

an msSet object.

process

a character string specifying the process to be visualized. The options are "msPrepare", "msDenoise", "msNoise", "msDetrend", "msNormalize", "msPeak", "msAlign". Default: "msPrepare".

subset

a numeric vector or NULL indicating the index of the spectra to be plotted. Default: 1, i.e., the first spectrum. If NULL, the entire set of spectra are plotted.

offset

a numeric scalar representing the vertical offset to apply between each spectrum. If NULL, the offset is automatically calculated. Default: NULL.

xaxis

a character string specifying what to be used as the x-axis. The options are "mass" and "time". Default: "time".

xlim

a numeric vector with two elements specifying the range for the x axis. Its first element should be less than its second element. If it is NULL (by default), the entire range of the data is plotted. If one of its element is NA, it is replaced with the corresponding limit.

pch

a single character or integer denoting the plotting character for the peaks. Default: 1, i.e., a circle.

lty

an integer vector of length 2 denoting the line type for the two lines associated with each spectrum to be plotted. If it is a single integer, it will be used cyclically. If its length is more than 2, only the first two elements will be used.

col

a vector of integers denoting the colors for the spectra to be plotted. Colors are used cyclically.

lwd

a integer vector of length 2 denoting the line width for the two lines associated with each spectrum to be plotted, device dependent. If it is a single integer, it will be used cyclically. If its length is more than 2, only the first two elements will be used. Width 1 is the standard width for the device. Many devices cannot change line width. Default: 1.

add

a logical value. If TRUE, the plot is added using the current par() layout. Otherwise a new plot is produced. Default: FALSE.

...

Other graphical parameters passed to the underlying plotting functions.

print

prints an msSet object.

Usage: print(x, justify="left", sep=":", ...) or x

x

an msSet object.

justify

a character string giving the justification of the numbers relative to each other. The choices are "none", "left", "right" and "decimal". Only the first letter needs to be given.

sep

a character string to be inserted between text and values. The default is a colon.

summary

provides a synopsis of an msSet object.

Usage: summary(x)

x

an msSet object.

See Also

msList, msPlot, apply.msSet.

Examples

1
2
3
4
5
6
7
if (!exists("qcset")) data("qcset", package="msProcess")

## plot a few spectra from qcset
plot(qcset, subset=1:5)

## image of all spectra in qcset
image(qcset)

zeehio/msProcess documentation built on May 4, 2019, 10:15 p.m.