require(TargetSearchData)
data(TargetSearchData)
# update CDF path
CDFpath(sampleDescription) <- file.path(find.package("TargetSearchData"), "gc-ms-data")
# Plot the peak "Valine" for sample number 1
grep("Valine", libName(refLibrary)) # answer: 3
# select the first file
cdfFile <- CDFfiles(sampleDescription)[1]
# select "Valine" top masses
top.masses <- topMass(refLibrary)[[3]]
# plot peak from the cdf file
plotPeakSimple(cdfFile = cdfFile, time.range = libRI(refLibrary)[3] + c(-2000,2000),
masses = top.masses, useRI = TRUE, rimTime = RImatrix[,1],
standard = rimStandard(rimLimits), massRange = c(85, 500))
# the same, but extracting the peaks into a list first. This may be better if
# you intend to loop through several peaks.
rawpeaks <- peakCDFextraction(cdfFile, massRange = c(85,500))
plotPeakSimple(rawpeaks, time.range = libRI(refLibrary)[3] + c(-2000,2000),
masses = top.masses, useRI = TRUE, rimTime = RImatrix[,1],
standard = rimStandard(rimLimits), massRange = c(85, 500))
Run the code above in your browser using DataLab