MassSpectrum represents a single spectrum of a MALDI-TOF
mass spectrometry measurement. It provides an easy framework for doing
some preprocessing steps like peak detection, baseline correction and
much more.
Objects from the Class
createMassSpectrum: Creates a
MassSpectrum object.
Extends
Class AbstractMassObject, directly.
Methods
calibrateIntensity
signature(x = "MassSpectrum"):
Calibrates the intensity of a
MassSpectrum object.
See calibrateIntensity,MassSpectrum-method for
details.
detectPeaks
signature(x = "MassSpectrum"):
Look for local maxima and estimate noise to extract peaks out of a
MassSpectrum object.
See detectPeaks,MassSpectrum-method for
details.
estimateBaseline
signature(x = "MassSpectrum"):
Estimates the baseline of a
MassSpectrum object.
See estimateBaseline,MassSpectrum-method for
details.
estimateNoise
signature(x = "MassSpectrum"):
Estimates the noise of a
MassSpectrum object.
See estimateNoise,MassSpectrum-method for
details.
isRegular
signature(object = "MassSpectrum"):
Returns FALSE if the frequency of mass values with irregular
intervals is greater than threshold (because object
was measured in centroid mode or some intensity
values were filtered).
removeBaseline
signature(x = "MassSpectrum"):
Estimates and removes the baseline of a
MassSpectrum object.
See removeBaseline,MassSpectrum-method for
details.
smoothIntensity
signature(object = "MassSpectrum"):
Smoothes the intensities of an MassSpectrum object.
See smoothIntensity,MassSpectrum-method for
details.
totalIonCurrent
signature(object = "MassSpectrum"):
Accessor function for Total Ion Current (TIC, area under the curve).
## load package
library("MALDIquant")
## create a MassSpectrum object by default constructor
s <- createMassSpectrum(mass=1:100, intensity=rnorm(100)^2,
metaData=list(name="example"))
## show some details
s
## plot spectrum
plot(s)
## get TIC
totalIonCurrent(s)
## modify intensity and metaData
intensity(s)[1:50] <- 0
metaData(s) <- list(name="modified example")
## plot again
plot(s)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MALDIquant)
This is MALDIquant version 1.15
Quantitative Analysis of Mass Spectrometry Data
See '?MALDIquant' for more information about this package.
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MALDIquant/MassSpectrum-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: MassSpectrum-class
> ### Title: Class "MassSpectrum"
> ### Aliases: MassSpectrum MassSpectrum-class isRegular
> ### isRegular,MassSpectrum-method totalIonCurrent
> ### totalIonCurrent,MassSpectrum-method
> ### Keywords: classes
>
> ### ** Examples
>
> ## load package
> library("MALDIquant")
>
> ## create a MassSpectrum object by default constructor
> s <- createMassSpectrum(mass=1:100, intensity=rnorm(100)^2,
+ metaData=list(name="example"))
>
> ## show some details
> s
S4 class type : MassSpectrum
Number of m/z values : 100
Range of m/z values : 1 - 100
Range of intensity values: 5.422e-05 - 9.177e+00
Memory usage : 2.398 KiB
Name : example
>
> ## plot spectrum
> plot(s)
>
> ## get TIC
> totalIonCurrent(s)
[1] 115.2347
>
> ## modify intensity and metaData
> intensity(s)[1:50] <- 0
> metaData(s) <- list(name="modified example")
>
> ## plot again
> plot(s)
>
>
>
>
>
> dev.off()
null device
1
>