loadProfile {ncGTW} | R Documentation

## Load sample profiles for each peak group

### Description

This function loads each raw sample profiles from the file with certain m/z and RT range.

### Usage

    loadProfile(filePaths, excluGroups, mzAdd = 0.005, rtAdd = 10,
      profstep = 0, BPPARAM = BiocParallel::SnowParam(workers = 1))

### Arguments

`filePaths` | The character vector of the loading file paths.
`excluGroups` | The output matrix of `misalignDetect` or `xcmsSet-class`$`group`, in which `mzmin`, `mzmax`, `rtmin`, and `rtmax` are set as the m/z and RT range for loading.
`mzAdd` | The extra m/z range for loading (both sides), and the default is 0.005.
`rtAdd` | The extra RT range for loading (both sides), and the default is 10 (seconds).
`profstep` | The size of each m/z bin for peak integration, and the default is 0.
`BPPARAM` | A object of BiocParallel to control parallel processing, and can be created by `SerialParam`, `MulticoreParam`, or `SnowParam`.

### Details

This function obtains the extracted ion chromatogram for each sample at the givin m/z and RT range with a certain m/z bin size for integration. Considering there may be missing peak by peak detection, `mzAdd` and `rtAdd` are to increase the integration range.

### Value

A list of the same length as the row number of `excluGroups`, in which each element is a `ncGTWinput` 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]

    # load the sample profiles
    ncGTWinputs <- loadProfile(file, excluGroups)

[Package ncGTW version 1.0.0 Index]