plotBatmanFit: Plot Batman Metabolite Fit of NMR Spectra (With Down...

Description Usage Arguments See Also Examples

View source: R/plotBatmanFit.R

Description

This function plots the BATMAN fit results, and saves the figure to pdf file in specified directory. For multiple spectra analysis, the file name is in the format of "specFit_itoj_metaName.pdf", where i and j are the range numbers of spectra in the figure and the metabolite name will be shown in place of metaName if supplied. Maximum of 2 spectra will be shown in each figure. The figure file will not be overwritten if it already exists by default. A prefix can be added to the file name for new saves.

Usage

1
2
3
4
 plotBatmanFit(BM, xfrom, xto, yfrom, yto, listMeta = FALSE,
               metaName, saveFig = TRUE, saveFigDir = BM$outputDir, 
               prefixFig, rerun = FALSE, placeLegend,
               plotColour, overwriteFig = FALSE, showPlot)

Arguments

BM

batman output data frame.

xfrom

The start ppm value to plot. Default is set to the start ppm value of the whole processed range.

xto

The end ppm value to plot. Default is set to the end ppm value of the whole processed range.

yfrom

The start value of vertical axis to plot. Default is set to 0.

yto

The end value of vertical axis to plot. Default is set to the maximum value of the spectrum point in display.

listMeta

Individual metabolite fit will also be shown in the plot if set TRUE. The default is FALSE.

metaName

One or more specified metabolite fits will be shown in the plot. If no name was given and listMeta = TRUE, all the individual metabolite fit will be shown.

saveFig

Save figure(s) to pdf file(s) if set TRUE. The default is TRUE.

saveFigDir

Save figure(s) in this directory. The default is output directory of BM.

prefixFig

Add prefix to each saved figure name. The default is no prefix.

rerun

Set to FALSE to plot batman result, and TRUE to plot batmanrerun result.

placeLegend

Where to place the legend in figure. The default is "topright".

plotColour

User can specify colours for each metabolite if listMeta = TRUE. If not, a set of randomly generated colours will be used.

overwriteFig

Overwrite saved figure file in pdf format if overwriteFig = TRUE. If set to FALSE, a new figure file with system time as postfix will be created. The default is FALSE.

showPlot

If set FALSE, no plot will be shown on display, the pdf file(s) for the figure plot(s) will be created in output folder. If missing from input, for windows and osx operating systems, it will be set to TRUE, for the rest operating systems, it will be set to FALSE automatically.

See Also

batman, batmanrerun

Examples

1
2
3
4
5
6
7
8
library(batman)
## Run BATMAN 
if(interactive()) 
{
bm<-batman()
## then plot results
plotBatmanFit(bm)
}

Example output



batman documentation built on May 2, 2019, 6:13 p.m.