rmaFitUnit              package:flagme              R Documentation

_F_i_t_s _a _r_o_b_u_s_t _l_i_n_e_a_r _m_o_d_e_l (_R_L_M) _f_o_r _o_n_e _m_e_t_a_b_o_l_i_t_e

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

       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')

_D_e_t_a_i_l_s:

     Fits a robust linear model.

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Mark Robinson

_R_e_f_e_r_e_n_c_e_s:

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

_S_e_e _A_l_s_o:

     'peaksAlignment', 'clusterAlignment'

_E_x_a_m_p_l_e_s:

     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)

