alignSamples: Alignment between samples

alignSamplesR Documentation

Alignment between samples

Description

AlignSamples performs alignment between samples (i.e. the matching of variables between the peak lists within the ptrSet object) by using a kernel gaussian density (Delabriere et al, 2017). This function returns an ExpressionSet, which contains the matrix of peak intensities, the sample metadata (borrowed from the input ptrSet) and the variable metadata which contains the peak intensities in the background. Two filters may be applied to:

  • keep only variables with a significant higher intensity in the expirations compared to the background (i.e., a p-value less than pValGreaterThres) for at least fracExp

  • keep only variables which are detected in more than fracGroup percent of the samples (or group)

If you do not want to apply those filters, set fracGroup to 0 and pValGreaterThres to 1.

Usage

alignSamples(
  X,
  ppmGroup = 70,
  fracGroup = 0.8,
  group = NULL,
  fracExp = 0.3,
  pValGreaterThres = 0.001,
  pValLessThres = 0,
  quantiUnit = c("ppb", "ncps", "cps")[1],
  bgCorrected = FALSE,
  dmzGroup = 0.001
)

## S4 method for signature 'ptrSet'
alignSamples(
  X,
  ppmGroup = 70,
  fracGroup = 0.8,
  group = NULL,
  fracExp = 0.3,
  pValGreaterThres = 0.001,
  pValLessThres = 0,
  quantiUnit = c("ppb", "ncps", "cps")[1],
  bgCorrected = FALSE,
  dmzGroup = 0.001
)

Arguments

X

ptrSet already processed by the detectPeak function

ppmGroup

ppm maximal width for an mz group

fracGroup

only variables present in fracGroup percent of at least one group will be kept (if 0 the filter is not applied)

group

character: sampleMetadata data column name. If NULL, variables not present in fracGroup percent of samples will be deleted. Else, variables not present in fracGroup percent in in at least one group group will be removed.

fracExp

fraction of samples which must have their p-value less than pValGreaterThres and pValLessThres

pValGreaterThres

threshold of the p-value for the unilateral testing that quantification (in cps) of expiration points are greater than the intensities in the background.

pValLessThres

threshold of the p-value for the unilateral testing that quantification (in cps) of expiration points are less than the intensities of the background.

quantiUnit

ppb, ncps or cps

bgCorrected

logical: should the peak table contain the background corrected values?

dmzGroup

minimum mz width to be used for grouping the features (required for low masses)

Value

an ExpressionSet (Biobase object)

References

Delabriere et al., 2017

Examples

library(ptairData)
dirRaw <- system.file("extdata/exhaledAir", package = "ptairData")
exhaledPtrset <- createPtrSet(dir=dirRaw, 
setName="exhaledPtrset", mzCalibRef = c(21.022, 60.0525),
fracMaxTIC = 0.7, saveDir = NULL )
exhaledPtrset<-detectPeak(exhaledPtrset,mzNominal=c(21,60,79))
eset <- alignSamples(exhaledPtrset,pValGreaterThres=0.05,bgCorrected=TRUE)
Biobase::exprs(eset)
Biobase::fData(eset)
Biobase::pData(eset)

camilleroquencourt/ptairMS documentation built on June 9, 2024, 10:35 a.m.