alignChromatogramsCpp | R Documentation |

Aligns MS2 extracted-ion chromatograms(XICs) pair.

```
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,
kerLen = 9L,
hardConstrain = FALSE,
samples4gradient = 100,
objType = "heavy"
)
```

`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, crossCorrelation). |

`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. |

`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. |

`objType` |
(char) A character string. Must be either light, medium or heavy. |

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

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

```
data(XIC_QFNNTDIVLLEDFQK_3_DIAlignR, package="DIAlignR")
XICs <- XIC_QFNNTDIVLLEDFQK_3_DIAlignR
data(oswFiles_DIAlignR, package="DIAlignR")
oswFiles <- oswFiles_DIAlignR
XICs.ref <- XICs[["hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt"]][["4618"]]
XICs.eXp <- XICs[["hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt"]][["4618"]]
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")
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.