metabCombine {metabCombiner} | R Documentation

## metabCombiner Wrapper Function

### Description

`metabCombine` wraps the five main `metabCombiner` workflow steps into a single wrapper function. Parameter list arguments organize program parameters by constituent package functions.

### Usage

    metabCombine(
      xdata,
      ydata,
      binGap = 0.005,
      xid = NULL,
      yid = NULL,
      means = list(mz = FALSE, rt = FALSE, Q = FALSE),
      fitMethod = "gam",
      anchorParam = selectAnchorsParam(),
      fitParam = fitgamParam(),
      scoreParam = calcScoresParam(),
      labelParam = labelRowsParam()
    )

### Arguments

`xdata` | metabData object. One of two datasets to be combined.
`ydata` | metabData object. One of two datasets to be combined.
`binGap` | numeric parameter used for grouping features by m/z. See ?mzGroup for more details.
`xid` | character identifier of xdata. If xdata is a metabData, assigns a new ID for this dataset; if xdata is a metabCombiner, must be assigned to one of the existing dataset IDs. See details for more information.
`yid` | character identifier of ydata. If ydata is a metabData, assigns a new ID for this dataset; if ydata is a metabCombiner, must be assigned to one of the existing dataset IDs. See details for more information.
`means` | logical. Option to take average m/z, rt, and/or Q from `metabComber`. May be a vector (length = 3), single value (TRUE/FALSE), or a list with names "mz", "rt", "Q" as names.
`fitMethod` | RT spline-fitting method, either "gam" or "loess"
`anchorParam` | list of parameter values for selectAnchors() function
`fitParam` | list of parameter values for fit_gam() or fit_loess()
`scoreParam` | list of parameter values for calcScores()
`labelParam` | list of parameter values for labelRows()

### Details

The five main steps in `metabCombine` are 1) m/z grouping & combined table construction, 2) selection of ordered pair RT anchors, 3) nonlinear spline (Basis Spline GAM or LOESS) fitting to predict RTs, 4) score calculation and feature pair alignment ranking, 5) combined table row annotation and reduction. metabData arguments `xdata` & `ydata` and m/z grouping `binGap` are required for step 1.

Steps 2-5 are handled by `anchors`, `fit`, `scores`, & `labels`, respectively, with lists containing the argument values for each step expected for these arguments. `selectAnchorsParam`, `fitgamParam`, `fitloessParam`, `calcScoresParam`, & `labelRowsParam` load the default program values of `selectAnchors`, `fit_gam`, `fit_loess`, `calcScores` & `labelRows`, respectively. These program arguments should be modified as necessary for the datasets used for analysis.

By default, the RT fitting method (`fitMethod`) is set to "gam", which means the argument `fit` is a list of parameters for `fit_gam`; if the (`fitMethod`) argument is set to "loess", then the `fit` argument expects a list of `fit_loess` parameters.

### Value

a `metabCombiner` object following complete analysis

### See Also

`selectAnchorsParam`, `fitgamParam`, `calcScoresParam`, `labelRowsParam`, `fitloessParam`

### Examples

    data("plasma20")
    data("plasma30")

    p30 <- metabData(plasma30, samples = "CHEAR")
    p20 <- metabData(plasma20, samples = "Red", rtmax = 17.25)

    #parameter lists:
    saParam <- selectAnchorsParam(tolrtq = 0.2, windy = 0.02, tolmz = 0.002)
    fitParam <- fitgamParam(k = seq(12,15), iterFilter = 1, outlier = "boxplot",
                            family = "gaussian", prop = 0.6, coef = 1.5)
    scoreParam <- calcScoresParam(A = 75, B = 15, C = 0.3)
    labelParam <- labelRowsParam(maxRankX = 2, maxRankY = 2, delta = 0.1)

    #metabCombine wrapper
    p.combined <- metabCombine(xdata = p30, ydata = p20, binGap = 0.0075,
                               anchorParam = saParam, fitParam = fitParam,
                               scoreParam = scoreParam, labelParam = labelParam)

    ##to view results
    p.combined.table <- combinedTable(p.combined)

[Package metabCombiner version 1.2.2 Index]