dp                  package:flagme                  R Documentation

_D_y_n_a_m_i_c _p_r_o_g_r_a_m_m_i_n_g _a_l_g_o_r_i_t_h_m, _g_i_v_e_n _a _s_i_m_i_l_a_r_i_t_y _m_a_t_r_i_x

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

     This function calls C code for a bare-bones dynamic programming
     algorithm, finding the best cost path through a similarity matrix.

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

     dp(M,gap=.5,big=10000000000,verbose=FALSE)

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

       M: similarity matrix

     gap: penalty for gaps

     big: large value used for matrix margins

 verbose: logical, whether to print out information

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

     This is a pretty standard implementation of a bare-bones dynamic
     programming algorithm, with a single gap parameter and allowing
     only simple jumps through the matrix (up, right or diagonal).

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

     'list' with element 'match' with the set of pairwise matches.

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

     'normDotProduct'

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

     # similarity matrix
     r<-normDotProduct(pd@peaksdata[[1]],pd@peaksdata[[2]])

     # dynamic-programming-based matching of peaks
     v<-dp(r,gap=.5)

