TrendPlot {mzmatch.R}R Documentation



A trend plot graphs the samples (probably in time series experiments) against a variable of interest (intensity, measured mass). It is used to examine whether or not there is a relationship between the signal examined and time. This version of PeakML.trendPlot function accepts matrix or data frame (instead of peakml file) as input for plotting routine.


	TrendPlot(peaktable,sampleclasses,plotnames=NULL,samplenames=NULL,outputfile,xaxisvalues=NULL,xaxislabels=NULL,log2scale=FALSE,collapse=FALSE,xaxislabel=NULL,percentiles=c(15,20,35),classaverage=FALSE,legendposition="bottomright",yminvalue=NULL,xmaxvalue=NULL,colors= c("black", "red", "green3", "blue", "cyan", "magenta", "yellow", "gray"),fontfamily="Helvetica",pdflayout=c(3,1))



Matrix or dataframe which contains integral or intensity values of detected peaks. Samples must be rows and columns detected features.


Character vector of length equal to count of measurements in PeakML data file. Every string in this vector should describe sample class.


Character vector of the same length as features in input matrix. If this values is not set, column names of matrix will be used instead.


Defaults to NULL. If the order of samples should be changed before plotting measurement names in expected order should be provided. Order of class values also should be ordered according names "samplenames" vector.


Name of pdf file which will be generated in current working directory of R.


Numeric vector of same length as number of measurements in PeakMl data file. If is set to 'NULL' sample index values are plotted on x axis.


Character vector of same length as number of measurements in PeakMl data file. If is set to 'NULL' sample index values are plotted on x axis. This parameter can be supplied only if xaxisvalues are supplied. Xaxis will be labeled by character values instead of numeric ones in xaxisvalues vector.


Applies log2 transformation on intensity values before plotting. Logical: FALSE or TRUE


Logical. If is set to TRUE, overly plot by sample classes will be generated


Character string which will be used to label x axis.


Vector of the numeric values indicating percentage thresholds at which deviation values from mean intensity value should be plotted. If set to NULL, no percentiles are plotted.


Average intensity values for data points in each sample class will be calculated and plotted by sample class. Error bars indicates standart deviations from mean value.


At which side plot legend should be added. Possible values are character strings: "bottomleft", "bottomright", "topleft", "topright".


At which value yaxis should start. If set to NULL, axis ranges are calculated automatically.


Maximum value for xaxis can be set, this is helpfull for placing legend on the plot. If set to NULL, axis ranges are calculated automatically.


You can improve look of graphics by defining color palette which to use for plotting by using 657 pre-defined colors are available. Value should be character vector of the same length as the sampleclasses defined. Available values for color definitions can be obtained by R command: colors (). Graphical representation of R colors are also shown on this web-page: Numeric values of colors can also be supplied instead of character values. Default color palettes is: black, red, green3, blue, cyan, magenta, yellow, gray. That means that points for 8 different sample groups can be coloured in different color by default.


The initial font family to be used, normally as a character string. In normal use it is one of "AvantGarde", "Bookman", "Courier", "Helvetica", "Helvetica-Narrow", "NewCenturySchoolbook", "Palatino" or "Times", and refers to the standard Adobe PostScript fonts families of those names which are included (or cloned) in all common PostScript devices. Refer to help (postscript) for more detailed description of available font families and specific characters. Default value: "Helvetica"


Numeric vector with two elements. The first number indicates in how many rows to place plots on every page of pdf document. The second number defines number of columns in pdf document.


The PeakML file format defines an open and extensible file format for storing extracted hyphenated mass spectrometry data. As such, the format will enable users to store intermediate data in a structured manner, but more importantly, to exchange data between different data analysis software. This will give complete flexible control to the users of data analysis software to cherry pick those components best suited to their needs.

The PeakML.trendPlot function allows to monitor intensity trends between samples in PeakML data file. Sample order before plotting can be changed by using 'samplenames' argument. Average values plot (between sample classes) with error bars can be plotted if parameter "classaverage" is set to TRUE. Y axis range is calculated automatically, but minimum value can be override by 'yminvalue' parameter.


Graphical output in pdf file.


Andris Jankevics ( Richard Scheltema (


PeakML/mzMatch - a file format, Java library, R library and tool-chain for mass spectrometry data analysis. In preparation.

See Also

[Package mzmatch.R version 2.0-6 Index]