ncGTWwarp-accessors: ncGTWwarp-accessors

Description Usage Arguments Value Examples

Description

Accessors to the realigned RT and the peaks with adjusted RT of ncGTW alignment.

Usage

1
2
3
4
5
## S4 method for signature 'ncGTWwarp'
rtncGTW(object)

## S4 method for signature 'ncGTWwarp'
ncGTWpeaks(object)

Arguments

object

a ncGTWwarp object.

Value

rtncGTW returns a list of the same length as the sample number, in which each element is a vector of the realigned RT of the corresponding sample.

rtncGTW returns a matrix containing peak data with adjusted RT.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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 <- initncGTWparam()

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

# adjust RT with the realignment results from ncGTW
ncGTWres <- xcmsLargeWin
adjustRes <- adjustRT(ncGTWres, ncGTWinputs[[1]], ncGTWoutputs[[1]], ppm)
rt <- rtncGTW(adjustRes)
peaks <- ncGTWpeaks(adjustRes)

## End(Not run)

ChiungTingWu/ncGTW documentation built on Dec. 30, 2019, 10:12 p.m.