findMultiplePeaks        package:MetaNetwork        R Documentation

_C_l_u_s_t_e_r _m_u_l_t_i_p_l_e _m_a_s_s _p_e_a_k_s _b_a_s_e_d _o_n _c_o_r_r_e_l_a_t_i_o_n _a_n_d _m_a_s_s

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

     Predict metabolites that may be represented by multiple mass peaks
      based on correlation and m/z value. If two mass peaks are highly
     correlated  (r>0.95) and their mass difference  is 1 or 2 (as
     isotopes) or mass ratio is 2, 3, or 1/2, 1/3 (as different
     charged),  they are predicted as multiple peaks of a same
     metabolite.

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

     findMultiplePeaks <- function( corrZeroOrder, peaks, corrThres=0.95, 
                                    filename=NULL) )

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

corrZeroOrder: a zero order peak correlation matrix that has been
          calculated before.
           See 'corrZeroOrder' example data.

   peaks: matrix of mass/charge peaks (column1) for each trait
          (rownames).  See 'peaks2' example peaks data for unidentified
          example traits data 'traits2'.

corrThres: (optional) numeric threshold for significant correlated
          peaks that should be tested for multiple peaks relationships.
          Default is 0.95. 

filename: (optional) path of the csv file where the multiple peak
          summary  is to be stored. Default NULL. 

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

     Returns a data frame with Multiple Peaks summary containing the
     following headers: 

 cluster: cluster id of related multiple peaks.

   peak1: mass over charge peak.

     mz1: mass over charge ratio of 'peak1'.

   peak2: mass over charge peak that is related to 'peak1'.

     mz2: mass over charge ratio of 'peak2'. 

corrCoef: correlation coefficient between 'peak1' and 'peak2'. 

massDiff: peak difference: 'mz1' - 'mz2'.

massRatio: peak ratio: 'mz1'/'mz2'.

relationship: putative 'isotope' or 'diffCharged' relationship.

     See 'multiplePeaks' example data set.

_N_o_t_e:

     The names of traits should be consistent over 'corrZeroOrder' and
     'peaks'.

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

     Jingyuan Fu <j.fu@rug.nl>,  Morris Swertz <m.a.swertz@rug.nl>, 
     Ritsert Jansen <r.c.jansen@rug.nl>

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

     Fu J, Swertz MA, Keurentjes JJB, Jansen RC. MetaNetwork: a
     computational tool for the  genetic study of metabolism. Nature
     Protocols (2007). 

     <URL: http://gbic.biol.rug.nl/supplementary/2007/MetaNetwork>

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

     Use 'traits2' and 'peaks2' as example unidintified peak  data set
     or use 'loadData' to load your own data.
      Use 'qtlCorrZeroOrder' to calculate 'corrZeroOrder' zero order
     correlation.

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

     ## load the example data provided with this package                         
     data(traits2)   
     data(peaks2)    
     data(genotypes)     
     data(markers)                                         
                                                  
     ##OR: load your own data                     
     #traits2      <- loadData("traits2.csv")
     #peaks2       <- loadData("peaks2.csv")
     #genotypes    <- loadData("genotypes.csv")
     #markers      <- loadData("markers.csv")
                                                  
     ##calculate the two part qtl
     qtlProfiles   <- qtlMapTwoPart(genotypes=genotypes, traits=traits2, spike=4)
       
     ##set the qtl threshold
     qtlThres      <- 3.79

     ##OR: estimate the threshold yourself
     #qtlThres     <- qtlThreshold(genotypes, traits, spike=4)
       
     ##calculate zero order correlation
     corrZeroOrder <- qtlCorrZeroOrder(markers, qtlProfiles, qtlThres)

     ##find multiple peaks
     multiplePeaks <- findMultiplePeaks(corrZeroOrder, peaks2)

     ##show summary
     multiplePeaks

