plotAdjustedRtime {xcms} | R Documentation

## Visualization of alignment results

### Description

Plot the difference between the adjusted and the raw retention time (y-axis) for each file along the (adjusted or raw) retention time (x-axis). If alignment was performed using the `adjustRtime-peakGroups` method, also the features (peak groups) used for the alignment are shown.

### Usage

    plotAdjustedRtime(
      object,
      col = "#00000080",
      lty = 1,
      lwd = 1,
      type = "l",
      adjustedRtime = TRUE,
      xlab = ifelse(adjustedRtime, yes = expression(rt[adj]), no = expression(rt[raw])),
      ylab = expression(rt[adj] - rt[raw]),
      peakGroupsCol = "#00000060",
      peakGroupsPch = 16,
      peakGroupsLty = 3,
      ylim,
      ...
    )

### Arguments

`object` | A `XCMSnExp` object with the alignment results.
`col` | colors to be used for the lines corresponding to the individual samples.
`lty` | line type to be used for the lines of the individual samples.
`lwd` | line width to be used for the lines of the individual samples.
`type` | plot type to be used. See help on the `par` function for supported values.
`adjustedRtime` | logical(1) whether adjusted or raw retention times should be shown on the x-axis.
`xlab` | the label for the x-axis.
`ylab` | the label for the y-axis.
`peakGroupsCol` | color to be used for the peak groups (only used if alignment was performed using the `adjustRtime-peakGroups` method.
`peakGroupsPch` | point character (`pch`) to be used for the peak groups (only used if alignment was performed using the `adjustRtime-peakGroups` method.
`peakGroupsLty` | line type (`lty`) to be used to connect points for each peak groups (only used if alignment was performed using the `adjustRtime-peakGroups` method.
`ylim` | optional `numeric(2)` with the upper and lower limits on the y-axis.
`...` | Additional arguments to be passed down to the `plot` function.

### Author(s)

Johannes Rainer

### See Also

`adjustRtime` for all retention time correction/ alignment methods.

### Examples

    ## Load a test data set with detected peaks
    data(faahko_sub)
    ## Update the path to the files for the local system
    dirname(faahko_sub) <- system.file("cdf/KO", package = "faahKO")

    ## Disable parallel processing for this example
    register(SerialParam())

    ## Performing the peak grouping using the "peak density" method.
    p <- PeakDensityParam(sampleGroups = c(1, 1, 1))
    res <- groupChromPeaks(faahko_sub, param = p)

    ## Perform the retention time adjustment using peak groups found in both
    ## files.
    fgp <- PeakGroupsParam(minFraction = 1)
    res <- adjustRtime(res, param = fgp)

    ## Visualize the impact of the alignment.
    plotAdjustedRtime(res, adjusted = FALSE)
    grid()

[Package xcms version 3.16.1 Index]