require(TargetSearchData)
# import refLibrary, rimLimits and sampleDescription.
data(TargetSearchData)
# get the CDF files
cdfpath <- file.path(find.package("TargetSearchData"), "gc-ms-data")
# select a subset of samples
smp <- sampleDescription[1:4]
# update the CDF path
CDFpath(smp) <- cdfpath
# make a copy of the RI markers object
rim <- rimLimits
# mess up the limits of marker 3 (real value is 369 seconds app.)
rimLimits(rim)[3,] <- c(375, 400)
# run RIcorrect
RImat <- RIcorrect(smp, rim, massRange = c(85,320),
Window = 15, pp.method = "ppc", IntThreshold = 50)
# fix the limits of marker 3
rimLimits(rim)[3,] <- c(360, 400)
# you could run again RIcorrect, but this is faster
fixRI(smp, rim)
# get the RI matrix
RImat <- riMatrix(smp, rim)
# compare the values with the real ones (previously stored in RImatrix)
stopifnot( all.equal(RImat, RImatrix[,1:4], tolerance=1e-8) )
# manual adjusment or RI markers for sample 3.
# Warning: this is just an example to illustrate how to use this function.
# don't do this unless you know what you're doing.
RImat[,3] <- c(252, 311, 369)
fixRI(smp, rim, RImat, 3)
Run the code above in your browser using DataLab