calcTimeDiffs             package:flagme             R Documentation

_C_a_l_c_u_l_a_t_e _r_e_t_e_n_t_i_o_n _t_i_m_e _s_h_i_f_t_s _f_r_o_m _p_r_o_f_i_l_e _a_l_i_g_n_m_e_n_t_s

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

     This function takes the set of all pairwise profile alignments and
     use these to estimate retention time shifts between each pair of
     samples.  These will then be used to normalize the retention time
     penalty of the signal peak alignment.

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

     calcTimeDiffs(pd,ca.full,verbose=TRUE)

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

      pd: a 'peaksDataset' object

 ca.full: a 'clusterAlignment' object, fit with 

 verbose: logical, whether to print out information

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

     Using the set of profile alignments,

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

     'list' of same length as 'ca.full@alignments' with the matrices
     giving the retention time penalties.

_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)

