gatherInfo: Gathers abundance informations from an alignment

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/gatherInfo.R

Description

Given an alignment table (indices of matched peaks across several samples) such as that within a progressiveAlignment or multipleAlignment object, this routines goes through the raw data and collects the abundance of each fragment peak, as well as the retention times across the samples.

Usage

1
2
  gatherInfo(pD, obj, newind = NULL, method = c("apex"), findmzind = TRUE, 
             useTIC = FALSE, top = NULL, intensity.cut = 0.05)

Arguments

pD

a peaksDataset object, to get the abundance data from

obj

either a multipleAlignment or progressiveAlignment object

newind

list giving the

method

method used to gather abundance information, only apex implemented currently.

findmzind

logical, whether to take a subset of all m/z indices

useTIC

logical, whether to use total ion current for abundance summaries

top

only use the top top peaks

intensity.cut

percentage of the maximum intensity

Details

This procedure loops through the the table of matched peaks and gathers the

Value

Returns a list (of lists) for each row in the alignment table. Each list has 3 elements:

mz

a numerical vector of the m/z fragments used

rt

a numerical vector for the exact retention time of each peak across all samples

data

matrix of fragment intensities. If useTIC = TRUE, this matrix will have a single row

Author(s)

Mark Robinson

References

Mark D Robinson (2008). Methods for the analysis of gas chromatography - mass spectrometry data PhD dissertation University of Melbourne.

See Also

imputePeaks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  require(gcspikelite)

  ## paths and files
  gcmsPath <- paste(find.package("gcspikelite"), "data", sep = "/")
  cdfFiles <- dir(gcmsPath, "CDF", full = TRUE)
  eluFiles <- dir(gcmsPath, "ELU", full = TRUE)

  ## read data, peak detection results
  pd <- peaksDataset(cdfFiles[1:2], mz = seq(50, 550), rtrange = c(7.5, 8.5))
  pd <- addAMDISPeaks(pd, eluFiles[1:2])

  ## multiple alignment
  ma <- multipleAlignment(pd, c(1,1), wn.gap = 0.5, wn.D = 0.05, bw.gap = 0.6, 
                          bw.D = 0.2, usePeaks = TRUE, filterMin = 1, df = 50,
                          verbose = TRUE, metric = 1, type = 1)

  ## gather apex intensities
  d <- gatherInfo(pd, ma)

  ## table of retention times
  nm <- list(paste("MP", 1:length(d), sep = ""), c("S1", "S2"))
  rts <- matrix(unlist(sapply(d, .subset, "rt")), byrow = TRUE, nc = 2, 
                dimnames = nm)

flagme documentation built on Nov. 8, 2020, 5:24 p.m.