alignChromatogramsCpp {DIAlignR} | R Documentation

## Aligns MS2 extracted-ion chromatograms(XICs) pair.

### Description

Aligns MS2 extracted-ion chromatograms(XICs) pair.

### Usage

    alignChromatogramsCpp(l1, l2, alignType, tA, tB, normalization, simType,
      B1p = 0, B2p = 0, noBeef = 0L, goFactor = 0.125, geFactor = 40,
      cosAngleThresh = 0.3, OverlapAlignment = TRUE,
      dotProdThresh = 0.96, gapQuantile = 0.5, hardConstrain = FALSE,
      samples4gradient = 100, objType = "heavy")

### Arguments

`l1` | (list) A list of numeric vectors. l1 and l2 should have same length.
`l2` | (list) A list of numeric vectors. l1 and l2 should have same length.
`alignType` | (char) A character string. Available alignment methods are "global", "local" and "hybrid".
`tA` | (numeric) A numeric vector. This vector has equally spaced timepoints of XIC A.
`tB` | (numeric) A numeric vector. This vector has equally spaced timepoints of XIC B.
`normalization` | (char) A character string. Normalization must be selected from (L2, mean or none).
`simType` | (char) A character string. Similarity type must be selected from (dotProductMasked, dotProduct, cosineAngle, cosine2Angle, euclideanDist, covariance, correlation). Mask = s > quantile(s, dotProdThresh) AllowDotProd= [Mask × cosine2Angle + (1 - Mask)] > cosAngleThresh s_new= s × AllowDotProd
`B1p` | (numeric) Timepoint mapped by global fit for tA[1].
`B2p` | (numeric) Timepoint mapped by global fit for tA[length(tA)].
`noBeef` | (integer) It defines the distance from the global fit, upto which no penalization is performed. The window length = 2*noBeef.
`goFactor` | (numeric) Penalty for introducing first gap in alignment. This value is multiplied by base gap-penalty.
`geFactor` | (numeric) Penalty for introducing subsequent gaps in alignment. This value is multiplied by base gap-penalty.
`cosAngleThresh` | (numeric) In simType = dotProductMasked mode, angular similarity should be higher than cosAngleThresh otherwise similarity is forced to zero.
`OverlapAlignment` | (logical) An input for alignment with free end-gaps. False: Global alignment, True: overlap alignment.
`dotProdThresh` | (numeric) In simType = dotProductMasked mode, values in similarity matrix higher than dotProdThresh quantile are checked for angular similarity.
`gapQuantile` | (numeric) Must be between 0 and 1. This is used to calculate base gap-penalty from similarity distribution.
`hardConstrain` | (logical) if false; indices farther from noBeef distance are filled with distance from linear fit line.
`samples4gradient` | (numeric) This parameter modulates penalization of masked indices.
`objType` | (char) A character string. Must be either light, medium or heavy.

### Value

affineAlignObj (S4class) A S4class object from C++ AffineAlignObj struct.

### Author(s)

Shubham Gupta, shubh.gupta@mail.utoronto.ca ORCID: 0000-0003-3500-8152 License: (c) Author (2019) + MIT Date: 2019-03-08

### Examples

    data(XIC_QFNNTDIVLLEDFQK_3_DIAlignR, package="DIAlignR")
    XICs <- XIC_QFNNTDIVLLEDFQK_3_DIAlignR
    data(oswFiles_DIAlignR, package="DIAlignR")
    oswFiles <- oswFiles_DIAlignR
    XICs.ref <- XICs[["run1"]][["14299_QFNNTDIVLLEDFQK/3"]]
    XICs.eXp <- XICs[["run2"]][["14299_QFNNTDIVLLEDFQK/3"]]
    tVec.ref <- XICs.ref[[1]][["time"]] # Extracting time component
    tVec.eXp <- XICs.eXp[[1]][["time"]] # Extracting time component
    B1p <- 4964.752
    B2p <- 5565.462
    noBeef <- 77.82315/3.414
    l1 <- lapply(XICs.ref, `[[`, 2)
    l2 <- lapply(XICs.eXp, `[[`, 2)
    AlignObj <- alignChromatogramsCpp(l1, l2, alignType = "hybrid", tA = tVec.ref, tB = tVec.eXp,
     normalization = "mean", simType = "dotProductMasked", B1p = B1p, B2p = B2p, noBeef = noBeef,
     goFactor = 0.125, geFactor = 40, cosAngleThresh = 0.3, OverlapAlignment = TRUE,
     dotProdThresh = 0.96, gapQuantile = 0.5, hardConstrain = FALSE, samples4gradient = 100,
     objType = "light")

[Package DIAlignR version 0.99.12 Index]