checkRimLim | R Documentation |
A function to visually check if the retention time search limits of the retention index markers (aka FAMEs) are correct or need some adjustment.
checkRimLim(samples, rim, layout, show = TRUE, single = TRUE, extend = 0.5,
rect.col = "#e7e7e7", mar = c(2, 2, 2, 2), oma = c(3, 3, 2, 0.5),
cex.main = 1, type = "l", ...)
samples |
A |
rim |
A |
layout |
A vector of the form |
show |
Logical. If |
single |
Logical. If |
extend |
a numeric coefficient to extend the time window search of the
respective time marker. Defaults to |
rect.col |
the color for the background rectangle which indicates the current retention time limits. |
mar |
the subplots margins, passed to |
oma |
the outer plot margins, passed to |
cex.main |
The magnification to be used for main titles, passed to
|
type |
A character vector indicating the type of plots. Default |
... |
extra plotting arguments passed to |
The function takes a tsSample
object and creates a panel
plot of the m/z traces around the area in which a marker is expected to be,
one panel for each marker. By default, a single (random) sample is chosen (see
option single
) for plotting, but it is also possible to visualize many
samples at the same time (but see note below).
For multiple sample visualization, it is recommended to use sub-setting for the
samples
and rim
arguments in order to avoid over crowded plots,
specially when there are several samples and several retention index markers.
See the examples below.
Plotting options such as col
, lty
, pch
, lwd
can
be passed; these are in turn passed to matplot()
.
Note that these are passed to each panel; it not possible to pass different
options to different panels (for example to have different line colors).
Moreover, using options such as xlim
and ylim
may result in
‘empty’ plots (because each panel needs its own limits). If different
styles are required, then either make your own function from the output or
use subsets of the rim
(tsRim
) object.
The output value is either invisible
or it depends on the option single
.
If this option is TRUE
(the old behavior), then the output will be a list
of n
times 2
matrices, each element corresponding to a retention marker.
Columns are retention time and intensities of the respective marker's m/z. The rows
can be as many data points are within the search window.
If single=FALSE
, the output is a list whose length is equal
to length(samples)
and its names are equal to sampleNames(samples)
.
Each element is in turn a list with exactly the same structure described in the
paragraph above.
If single=TRUE
, all CDF
files will be scanned, which can
take a significant amount of time to parse, in particular, if there are
hundred of them. Also due to this, each panel of the plot could be extremely
crowded. It is therefore recommended to use sample sub-setting to reduce
this number, as shown in the examples below.
matplot
for plotting parameters,
par
for inner and outer margins parameters,
tsSample
,
sampleNames
,
tsRim
,
ImportFameSettings
require(TargetSearchData)
# get the cdf path TargetSearchData
cdfpath <- tsd_data_path()
# import samples (see ImportSamples() for details)
samples <- ImportSamples(tsd_file_path("samples.txt"), CDFpath = cdfpath)
# Import RI markers (see ImportFameSettings())
rim <- ImportFameSettings(tsd_file_path("rimLimits.txt"))
# choose a sample at random and plot the m/z traces around the retention time window
ret <- checkRimLim(samples, rim)
# to choose a specific sample and marker, use subsetting
ret <- checkRimLim(samples[3], rim[1:2])
# to display many samples at the same time, set the option `single` to `FALSE` and select a subset
# of samples (recommended). In this example the first three samples are chosen.
ret <- checkRimLim(samples[1:3], rim, single=FALSE)
# in general, visualizing all samples (as shown below) at the same time it is not recommended
# for large number of samples.
## Not run:
ret <- checkRimLim(samples, rim, single=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.