plotPeak: Plot peaks

View source: R/plot.R

plotPeakR Documentation

Plot peaks

Description

Plot a peak of a given metabolite in a given sample showing the search windows.

Usage

plotPeak(samples, Lib, metProf, rawpeaks, which.smp=1, which.met=1,
	massRange=NULL, corMass=FALSE)

Arguments

samples

A tsSample object created by ImportSamples function.

Lib

A tsLib object created by ImportLibrary function.

metProf

A metabolite profile object. See Profile

rawpeaks

A three component list containing the retention time, the intensity matrix, and the mass range. See peakCDFextraction.

which.smp

A numeric value indicating the sample.

which.met

A numeric value indicating the metabolite.

massRange

A two component numeric vector with the scan mass range to extract. Use NULL for automatic detection.

corMass

Logical. If TRUE, show only correlating masses for the selected metabolite. Show all masses otherwise.

Value

The output is the same as the function peakCDFextraction, that is, a list containing the retention time (Time), the intensity matrix (Peaks), the retention index (Index), the m/z range (massRange), and a flag indicating whether the chromatogram was baseline corrected (baselineCorrected).

The list can be recycled as the rawpeaks parameter for further plots (for example in a loop), so the CDF file doesn't need to be read again.

Note

This function was completely rewritten. For the old function, see plotPeakSimple.

In case the RI files are in text format and their column names are not standard (for example, when the files were generated with another software), use the global option 'TS_RI_columns' or transform the RI files to TargetSearch binary format. See the documentation in function text2bin.

Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

See Also

plotPeakSimple, RIcorrect, tsMSdata, tsRim, peakCDFextraction, matplot

Examples

require(TargetSearchData)
data(TSExample)

# update CDF and RI paths
CDFpath(sampleDescription) <- tsd_data_path()
RIpath(sampleDescription) <- tsd_data_path()

# Plot the peak "Valine" for sample number 1
grep("Valine", libName(refLibrary)) # answer: 3

# plot peak from the cdf file. The rawpeaks object can be recycled in order to plot
# other metabolites.
rawpeaks <- plotPeak(sampleDescription, refLibrary, metabProfile, which.smp=1,
        which.met=3, massRange=c(85,500), corMass=FALSE)

acinostroza/TargetSearch documentation built on Nov. 22, 2024, 3:31 p.m.