qtlCorrThreshold {MetaNetwork} | R Documentation |
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).
qtlCorrThreshold(markers, genotypes, traits, spike, qtlThres, n.permutations = 10000, alpha = 0.05, method = "qtl")
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. |
Returns: threshold value for correlation coefficient.
corrPermutations |
a vector of the permutations of maximum, absolute correlation values. |
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
.
Jingyuan Fu <j.fu@rug.nl>, Morris Swertz <m.a.swertz@rug.nl>, Ritsert Jansen <r.c.jansen@rug.nl>
Fu J, Swertz MA, Keurentjes JJB, Jansen RC. MetaNetwork: a computational tool for the genetic study of metabolism. Nature Protocols (2007).
http://gbic.biol.rug.nl/supplementary/2007/MetaNetwork
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.
## 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