ncGTWalign {ncGTW}R Documentation

Run ncGTW alignment

Description

This function applies ncGTW alignment to the input feature.

Usage

ncGTWalign(ncGTWinput, xcmsLargeWin, parSamp = 10,
  bpParam = BiocParallel::SnowParam(workers = 1), ncGTWparam = NULL)

Arguments

ncGTWinput

A ncGTWinput object.

xcmsLargeWin

A xcmsSet-class object.

parSamp

Decide how many samples are in each group when considering parallel computing, and the default is 10.

bpParam

A object of BiocParallel to control parallel processing, and can be created by SerialParam, MulticoreParam, or SnowParam.

ncGTWparam

A ncGTWparam object.

Details

This function realign the input feature with ncGTW alignment function with given m/z and RT range.

Value

A ncGTWoutput object.

Examples

# obtain data
data('xcmsExamples')
xcmsLargeWin <- xcmsExamples$xcmsLargeWin
xcmsSmallWin <- xcmsExamples$xcmsSmallWin
ppm <- xcmsExamples$ppm

# detect misaligned features
excluGroups <- misalignDetect(xcmsLargeWin, xcmsSmallWin, ppm)

# obtain the paths of the sample files
filepath <- system.file("extdata", package = "ncGTW")
file <- list.files(filepath, pattern="mzxml", full.names=TRUE)

tempInd <- matrix(0, length(file), 1)
for (n in seq_along(file)){
    tempCha <- file[n]
    tempLen <- nchar(tempCha)
    tempInd[n] <- as.numeric(substr(tempCha, regexpr("example", tempCha) + 7,
        tempLen - 6))
}
# sort the paths by data acquisition order
file <- file[sort.int(tempInd, index.return = TRUE)$ix]
## Not run: 
# load the sample profiles
ncGTWinputs <- loadProfile(file, excluGroups)

# initialize the parameters of ncGTW alignment with default
ncGTWparam <- new("ncGTWparam")

# run ncGTW alignment
ncGTWoutputs <- vector('list', length(ncGTWinputs))
for (n in seq_along(ncGTWinputs))
    ncGTWoutputs[[n]] <- ncGTWalign(ncGTWinputs[[n]], xcmsLargeWin, 5,
        ncGTWparam = ncGTWparam)

## End(Not run)

[Package ncGTW version 1.0.0 Index]