getAlignedTimesCpp {DIAlignR} | R Documentation

## Get aligned indices from MS2 extracted-ion chromatograms(XICs) pair.

### Description

Get aligned indices from MS2 extracted-ion chromatograms(XICs) pair.

### Usage

    getAlignedTimesCpp(
      l1,
      l2,
      kernelLen,
      polyOrd,
      alignType,
      adaptiveRT,
      normalization,
      simType,
      Bp,
      goFactor = 0.125,
      geFactor = 40,
      cosAngleThresh = 0.3,
      OverlapAlignment = TRUE,
      dotProdThresh = 0.96,
      gapQuantile = 0.5,
      kerLen = 9L,
      hardConstrain = FALSE,
      samples4gradient = 100
    )

### Arguments

`l1` | (list) A list of numeric matrix of two columns. l1 and l2 should have same length.
`l2` | (list) A list of numeric matrix of two columns. l1 and l2 should have same length.
`kernelLen` | (integer) length of filter. Must be an odd number.
`polyOrd` | (integer) TRUE: remove background from peak signal using estimated noise levels.
`alignType` | (char) A character string. Available alignment methods are "global", "local" and "hybrid".
`adaptiveRT` | (numeric) Similarity matrix is not penalized within adaptive RT.
`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, crossCorrelation). Mask = s > quantile(s, dotProdThresh) AllowDotProd= [Mask × cosine2Angle + (1 - Mask)] > cosAngleThresh s_new= s × AllowDotProd
`Bp` | (numeric) Timepoint mapped by global fit for tA.
`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.
`kerLen` | (integer) In simType = crossCorrelation, length of the kernel used to sum similarity score. Must be an odd number.
`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.

### Value

NumericMatrix Aligned indices of l1 and l2.

### 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
    XICs.ref <- lapply(XICs[["hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt"]][["4618"]], as.matrix)
    XICs.eXp <- lapply(XICs[["hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt"]][["4618"]], as.matrix)
    Bp <- seq(4964.752, 5565.462, length.out = nrow(XICs.ref[[1]]))
    time <- getAlignedTimesCpp(XICs.ref, XICs.eXp, 11, 4, alignType = "hybrid", adaptiveRT = 77.82315,
     normalization = "mean", simType = "dotProductMasked", Bp = Bp,
     goFactor = 0.125, geFactor = 40, cosAngleThresh = 0.3, OverlapAlignment = TRUE,
     dotProdThresh = 0.96, gapQuantile = 0.5, hardConstrain = FALSE, samples4gradient = 100)

[Package DIAlignR version 2.2.0 Index]