plotTIC {ptairMS} | R Documentation

## plot the Total Ion sptectrum (TIC) for one or several files.

### Description

plot the Total Ion sptectrum (TIC) for one or several files.

### Usage

    plotTIC(
      object,
      type = c("plotly", "ggplot")[1],
      baselineRm = FALSE,
      showLimits = FALSE,
      ...
    )

    ## S4 method for signature 'ptrRaw'
    plotTIC(object, type, baselineRm, showLimits, fracMaxTIC = 0.8, ...)

    ## S4 method for signature 'ptrSet'
    plotTIC(
      object,
      type,
      baselineRm,
      showLimits,
      pdfFile = NULL,
      fileNames = NULL,
      colorBy = "rownames",
      normalizePrimariIon = FALSE,
      ...
    )

### Arguments

`object` | ptrSet or ptrRaw S4 object
`type` | set 'plotly' to get an interactive plot, and 'ggplot' for classical plot.
`baselineRm` | logical. If `TRUE`, remove the baseline of the TIC
`showLimits` | logical. If `TRUE`, add the time limits to the plot (obtain with the 'fracMaxTIC' argument or 'createPtrSet' function)
`...` | not used
`fracMaxTIC` | Percentage (between 0 and 1) of the maximum of the Total Ion Current (TIC) amplitude with baseline removal. We will analyze only the part of the spectrum where the TIC intensity is higher than 'fracMaxTIC * max(TIC) '. If you want to analyze the entire spectrum, set this parameter to 0.
`pdfFile` | a absolute file path. A pdf will be generated with a plot for each file, caints TIC and time limits.
`fileNames` | vector of character. The file names of the ptrSer that you want to plot. Could be in basename or fullname.
`colorBy` | character. A name of the ptrSet's sampleMetaData column, to display with the same color files of same attributes.
`normalizePrimariIon` | should the TIC be normalized by the primary ion

### Value

a plotly of ggplot2 object.

### Examples

    ### ptrRaw object

    library(ptairData)
    filePath <- system.file('extdata/exhaledAir/ind1', 'ind1-1.h5',
    package = 'ptairData')
    raw <- readRaw(filePath)
    p <- plotTIC(raw)
    p
    dirRaw <- system.file("extdata/exhaledAir", package = "ptairData")
    exhaledPtrset <- createPtrSet(dir=dirRaw, setName="exhaledPtrset",
    mzCalibRef = c(21.022, 60.0525), fracMaxTIC = 0.7, saveDir = NULL )
    plotTIC(exhaledPtrset ,type='ggplot')

[Package ptairMS version 1.2.0 Index]