qtlCorrThreshold         package:MetaNetwork         R Documentation

_E_s_t_i_m_a_t_e _c_o_r_r_e_l_a_t_i_o_n _t_h_r_e_s_h_o_l_d

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

     Permutation test to estimate threshold for significant QTL
     correlation. In each permutation, the relation between genotype
     and trait are disturbed and then correlation is calculated. Thus,
     any detected genetic correlation is assumed to be false.  Compute
     the partial correlation coefficient in each permutation and record
     highest  value. Then after 'n.permutations', the threshold is set
     at desired 'alpha' level,  Bonferroni corrected by the number of
     edges per trait (the number of traits-1).

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

     qtlCorrThreshold(markers, genotypes, traits, spike, qtlThres, 
                      n.permutations = 10000, alpha = 0.05, method = "qtl")

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

 markers: matrix of markers (rownames) and their chromosome numbers
          (column 1) and centi-Morgan positions (cM, column 2), ordered
          by position.
           See 'markers' example data. 

genotypes: matrix of genotypes for each marker (rownames) and
          individual  (columnnames), as numeric values 1, 2 or NA when
          missing.
           See 'genotypes' example data.

  traits: matrix of phenotypes for each trait (rownames) and individual
           (columnnames), as numeric or NA when missing.
           See 'traits' example data.

   spike: numeric cut-off value to separate absent (qualitative) from 
          available (quantitative) trait abundance. 

qtlThres: numeric -log_{10}(p) threshold value for significant QTLs. 

n.permutations: (optional) number of iterations of permutation. 
          Default is 10000 times. 

   alpha: (optional) Bonferonni corrected significant level. Default is
          0.05. 

  method: (optional) correlation method string, "qtl" or "abundance"  
          for correlation on QTL profiles or  metabolite abundance
          level, respectively. 
           If 'method' is "qtl" (default),  qtlCorrThreshold will call
          'qtlCorrZeroOrder' to calculate the correlation between  QTL
          profiles. Otherwise, when 'method' is "abundance",
          qtlCorrThreshold will  use Spearman correlation with the
          'cor' function to calculate the  correlation between
          metabolite  abundance profiles.

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

     Returns: threshold value for correlation coefficient. 

corrPermutations: a vector of the permutations of maximum, absolute
          correlation values.

_N_o_t_e:

     The individual columns of 'genotypes' and 'traits' must have the
     same order.  The 'markers' should be ordered sequentially. The
     names of markers, traits and individuals should be consistent over
     'markers',  'genotypes', and 'traits'.

_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 'markers', 'genotypes' and 'traits' as  example data sets or
     use 'loadData' to load your own data.
       Use 'qtlThreshold' to estimate 'qtlThres' QTL significance 
     threshold.
      Use 'qtlCorrZeroOrder' and 'qtlCorrSecondOrder' for  QTL
     correlations that can be test against the resulting correlation
     threshold.
      Use 'MetaNetwork' for automated appliction of this function as 
     part a genetic analysis protocol on metabolites.

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

     ## load the example data provided with this package                        
     data(markers)   
     data(genotypes)
     data(traits)                                                       
                                                  
     ##OR: load your own data                     
     #markers    <- loadData("markers.csv")
     #genotypes  <- loadData("genotypes.csv")
     #traits     <- loadData("traits.csv")  
                                                  
     ##set the qtl threshold
     qtlThres    <- 3.79

     ##OR: estimate the threshold yourself
     #qtlThres   <- qtlThreshold(genotypes, traits, spike=4)

     ##estimate qtlCorrThreshold with low number of permutations (advised: 10000)
     cat("warning: simulating correlations takes a few minutes")
     flush.console()
     corrThres   <- qtlCorrThreshold(markers, genotypes, traits, spike=4, 
                                     qtlThres=qtlThres, n.permutations=10) 

     ##show threshold
     corrThres

