normDotProduct            package:flagme            R Documentation

_N_o_r_m_a_l_i_z_e_d _D_o_t _P_r_o_d_u_c_t

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

     This function calculates the similarity of all pairs of peaks from
     2 samples, using the spectra similarity

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

     normDotProduct(x1,x2,t1=NULL,t2=NULL,df=max(ncol(x1),ncol(x2)),D=100000,timedf=NULL,verbose=FALSE)

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

      x1: data matrix for sample 1

      x2: data matrix for sample 2

      t1: vector of retention times for sample 1

      t2: vector of retention times for sample 2

      df: distance from diagonal to calculate similarity

       D: retention time penalty

  timedf: matrix of time differences to normalize to.  if 'NULL', 0 is
          used.

 verbose: logical, whether to print out information

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

     Efficiently computes the normalized dot product between every pair
     of peak vectors and returns a similarity matrix.  C code is
     called.

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

     matrix of similarities

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

     'dp', 'peaksAlignment'

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

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

