rmaFitUnit: Fits a robust linear model (RLM) for one metabolite

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

View source: R/rmaFitUnit.R

Description

Using rlm from MASS, this procedure fits a linear model using all the fragments

Usage

1
 rmaFitUnit(u,maxit=5,mzEffect=TRUE,cls=NULL,fitSample=TRUE,fitOrCoef=c("coef","fit"),TRANSFORM=log2) 

Arguments

u

a metabolite unit (list object with vectors mz and rt for m/z and retention times, respectively and a data element giving the fragmentxsample intensitity matrix)

maxit

maximum number of iterations (default: 5)

mzEffect

logical, whether to fit m/z effect (default: TRUE)

cls

class variable

fitSample

whether to fit individual samples (alternative is fit by group)

fitOrCoef

whether to return a vector of coefficients (default: "coef"), or an rlm object ("fit")

TRANSFORM

function to transform the raw data to before fitting (default: log2)

Details

Fits a robust linear model.

Value

list giving elements of fragment and sample coefficients (if fitOrCoef="coef") or a list of elements from the fitting process (if fitOrCoef="fit")

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

peaksAlignment, clusterAlignment

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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])

# pairwise alignment using all scans
fullca<-clusterAlignment(pd, usePeaks = FALSE, df = 100)

# calculate retention time shifts
timedf<-calcTimeDiffs(pd, fullca)

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