alignedXIC: Create an aligned chromatogram

View source: R/merge_chromatogram.R

alignedXICR Documentation

Create an aligned chromatogram

Description

Modifies chromatogram to have the same length as indices. Imputes missing values with appropriate method. Time and intensity for the flanking missing indices are set as NA.

Usage

alignedXIC(
  XIC,
  indices,
  method = "spline",
  polyOrd = 4,
  kernelLen = 9,
  splineMethod = "fmm"
)

Arguments

XIC

(data-frame) first column is time, second column is intensity.

indices

(integer) vector of monotonically increasing integers.

method

(string) must be either "spline", "sgolay" or "linear".

polyOrd

(integer) must be less than kernelLen.

kernelLen

(integer) must be an odd integer.

splineMethod

(string) must be either "fmm" or "natural".

Value

(dataframe) has two columns:

time

(numeric)

intensity

(numeric)

Author(s)

Shubham Gupta, shubh.gupta@mail.utoronto.ca

ORCID: 0000-0003-3500-8152

License: (c) Author (2020) + GPL-3 Date: 2020-05-23

See Also

childXIC, imputeChromatogram

Examples

data(XIC_QFNNTDIVLLEDFQK_3_DIAlignR, package="DIAlignR")
data(alignObj_DIAlignR, package="DIAlignR")
XICs.ref <- XIC_QFNNTDIVLLEDFQK_3_DIAlignR[["hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt"]][["4618"]]
alignedIndices <- cbind(alignObj_DIAlignR@indexA_aligned, alignObj_DIAlignR@indexB_aligned)
colnames(alignedIndices) <- c("indexAligned.ref", "indexAligned.eXp")
alignedIndices[, 1:2][alignedIndices[, 1:2] == 0] <- NA_integer_
## Not run: 
plot(alignedXIC(XICs.ref[[1]], alignedIndices[,"indexAligned.ref"]), type = "l")

## End(Not run)

shubham1637/DIAlignR documentation built on March 29, 2023, 8:45 p.m.