Skip to contents

The function calculates and reports the variance explained for a single marker by fitting a double generalized linear model. It gives both the variance explained by the mean and variance parts of model.

Usage

vGWAS.variance(phenotype, marker.genotype, print = TRUE)

Arguments

phenotype

a numeric vector of the phenotyic values. See Examples.

marker.genotype

a numeric or character or factor vector of the genotypes of a single marker. See Examples.

print

a logical value. If FALSE, the heritability values will be returned for storage.

Value

variance.mean

the variance explained by the mean part of model.

variance.disp

the variance explained by the variance part of model.

Details

The Value will only be available if only.print = FALSE.

References

Shen, X., Pettersson, M., Ronnegard, L. and Carlborg, O. (2011): Inheritance beyond plain heritability: variance-controlling genes in Arabidopsis thaliana. PLoS Genetics, 8, e1002839.

Author

Xia Shen

Examples

# \donttest{
# ----- load data ----- #
data(pheno)
data(geno)
data(chr)
data(map)
# ----- variance GWA scan ----- #
vgwa <- vGWAS(phenotype = pheno, geno.matrix = geno,
marker.map = map, chr.index = chr, pB = FALSE)
#> 
# ----- visualize the scan ----- #
plot(vgwa)
#> nominal significance threshold with Bonferroni correction for 20000 tests are calculated.

summary(vgwa)
#> [1] Top 10 markers, sorted by p-value:
#>    marker chr    map               Pval
#> 1  V16630   5 393135 0.0000000005831907
#> 2  V16627   5 392704 0.0000000012144397
#> 3  V16621   5 391781 0.0000000018983749
#> 4  V16614   5 390839 0.0000000021781079
#> 5  V16601   5 388736 0.0000000031525392
#> 6  V16609   5 390084 0.0000000039528039
#> 7  V16612   5 390492 0.0000000039528039
#> 8  V16613   5 390663 0.0000000082466233
#> 9  V16608   5 389975 0.0000000137787674
#> 10 V16598   5 388349 0.0000000261193103
# ----- calculate the variance explained by the strongest marker ----- #
vGWAS.variance(phenotype = pheno,
marker.genotype = geno[, vgwa[["p.value"]] == min(vgwa[["p.value"]])])
#> variance explained by the mean part of model:
#> 4.2 %
#> variance explained by the variance part of model:
#> 23.06 %
#> variance explained in total:
#> 27.26 %
#> $vm
#>         C 
#> 0.1026317 
#> 
#> $vv
#>         C 
#> 0.5628937 
#> 
#> $ve
#>       C 
#> 1.77584 
#> 
#> $vp
#>        C 
#> 2.441366 
#> 
# }