[Genabel-commits] r1991 - in pkg/MultiABEL: . R inst man src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jun 3 23:27:00 CEST 2015
Author: shenxia
Date: 2015-06-03 23:27:00 +0200 (Wed, 03 Jun 2015)
New Revision: 1991
Added:
pkg/MultiABEL/R/MultiSummary.R
pkg/MultiABEL/R/load.summary.R
pkg/MultiABEL/man/MultiSummary.Rd
pkg/MultiABEL/man/load.summary.Rd
pkg/MultiABEL/src/
pkg/MultiABEL/src/MultiSummaryLoop.f90
pkg/MultiABEL/src/symbols.rds
Modified:
pkg/MultiABEL/ChangeLog
pkg/MultiABEL/DESCRIPTION
pkg/MultiABEL/NAMESPACE
pkg/MultiABEL/R/MultiABEL.R
pkg/MultiABEL/R/MultiRep.R
pkg/MultiABEL/R/Multivariate.R
pkg/MultiABEL/R/misc.R
pkg/MultiABEL/inst/CITATION
pkg/MultiABEL/man/MultiABEL.Rd
pkg/MultiABEL/man/MultiMeta.Rd
pkg/MultiABEL/man/MultiRep.Rd
pkg/MultiABEL/man/Multivariate.Rd
Log:
Update to v 1.1-0. MultiSummary() module included for multivariate GWA using summary statistics. This update is accompanying our paper submission of GIANT meta-GWA.
Modified: pkg/MultiABEL/ChangeLog
===================================================================
--- pkg/MultiABEL/ChangeLog 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/ChangeLog 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,5 +1,12 @@
-2014-10-28 15:25 xia
+2015-06-02 02:01 xia
+ * Updated to version 1.1-0
+ * MultiSummary() module included
+ for multi-trait GWAS using summary stats
+ * MVGWA modules recoded in Fortran 90
+
+2014-10-28 15:00 xia
+
* Updated to version 1.0-1 for
technical review of the GenABEL project
* Replication analysis confirmed
Modified: pkg/MultiABEL/DESCRIPTION
===================================================================
--- pkg/MultiABEL/DESCRIPTION 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/DESCRIPTION 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,13 +1,15 @@
Package: MultiABEL
Type: Package
-Title: Multivariate Genome-Wide Association Analyses
-Version: 1.0-2
-Date: 2014-12-05
-Author: Xia Shen, Yurii Aulchenko
+Title: Multi-trait Genome-Wide Association Analyses
+Version: 1.1-0
+Date: 2015-06-02
+Author: Xia Shen
Maintainer: Xia Shen <xia.shen at ki.se>
-Description: This package includes functions for performing multivariate
- genome-wide association (GWA) analyses. The GWA module is
- compatible with existing *ABEL data formats.
+Description: Performing multivariate
+ genome-wide association (MVGWA) analyses. The modules are
+ compatible with existing *ABEL data formats. The GWA
+ analyses can be done on individual level data or on
+ single-trait GWA summary statistics only.
Depends:
R (>= 2.10),
GenABEL,
@@ -15,4 +17,4 @@
svMisc
License: GPL (>= 2)
LazyLoad: yes
-Packaged: 2014-12-05 11:25:18 GMT; xia
+Packaged: 2015-06-02 02:00:18 CET; xia
Modified: pkg/MultiABEL/NAMESPACE
===================================================================
--- pkg/MultiABEL/NAMESPACE 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/NAMESPACE 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,2 +1,4 @@
+useDynLib(MultiABEL)
import("GenABEL", "DatABEL", "svMisc")
-export("Multivariate", "MultiRep", "MultiMeta")
+export("Multivariate", "MultiRep", "MultiMeta", "load.summary", "MultiSummary")
+exportClasses("multi.summary")
\ No newline at end of file
Modified: pkg/MultiABEL/R/MultiABEL.R
===================================================================
--- pkg/MultiABEL/R/MultiABEL.R 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/R/MultiABEL.R 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,8 +1,9 @@
#' MultiABEL: Multivariate Genome-Wide Association Analyses
#'
-#' The MultiABEL package performs multivariate genome-wide association studies (GWAS)
-#' and subsequent analyses. The GWAS module is compatible with different kinds of *ABEL
-#' data formats.
+#' Performing multivariate genome-wide association (MVGWA) analyses.
+#' The modules are compatible with existing *ABEL data formats. The GWA
+#' analyses can be done on individual level data or on
+#' single-trait GWA summary statistics only.
#'
#' For converting data from other formats, see
#'
@@ -36,15 +37,12 @@
#' \code{\link{snp.names}},
#' \code{\link{snp.subset}}.
#'
-#' @author Xia Shen, Yurii Aulchenko
+#' @author Xia Shen
#'
#' @references
-#' If you use MultiABEL package in your analysis, please cite the following work:
+#' If you use the MultiABEL package in your analysis, please cite the
+#' papers in \code{citation("MultiABEL")}.
#'
-#' Xia Shen, ..., Gordan Lauc, Jim Wilson, Yurii Aulchenko (2014).
-#' Multi-omic-variate analysis identified the association between 14q32.33
-#' and compound N-Glycosylation of human Immunoglobulin G. \emph{Submitted}.
-#'
#' @seealso \code{GenABEL}, \code{DatABEL}
#'
#'
Modified: pkg/MultiABEL/R/MultiRep.R
===================================================================
--- pkg/MultiABEL/R/MultiRep.R 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/R/MultiRep.R 2015-06-03 21:27:00 UTC (rev 1991)
@@ -29,7 +29,7 @@
#' as in \code{$training.coef} but estimated in the replication sample, but these are just for the record,
#' NOT used in the replication procedure.
#'
-#' @author Xia Shen, Yurii Aulchenko
+#' @author Xia Shen
#'
#' @references
#' Xia Shen, ..., Gordan Lauc, Jim Wilson, Yurii Aulchenko (2014).
Added: pkg/MultiABEL/R/MultiSummary.R
===================================================================
--- pkg/MultiABEL/R/MultiSummary.R (rev 0)
+++ pkg/MultiABEL/R/MultiSummary.R 2015-06-03 21:27:00 UTC (rev 1991)
@@ -0,0 +1,95 @@
+#' Multivariate genome-wide association scan using summary statistics
+#'
+#' The function performs multivariate GWA analysis using meta-GWAS summary statistics
+#'
+#' @param x A data object of class \code{multi.summary} loaded by the function \code{load.summary}.
+#' @param type A string gives the type of analysis. Default is \code{"outbred"}, referring to
+#' general outbred populations, following Hardy-Weinberg equilibrium. \code{"inbred"} refers to
+#' inbred populations, where no heterzygotes exists, namely, allele frequency = genotype frequency.
+#' \code{"precise"} refers to precise test statistics, especially when the individual-level data
+#' are available, for which the argument \code{vars} has to be given.
+#' @param vars A numeric vector gives the variance of the genotypes at each SNP, coded as 0, 1 and 2.
+#' Only used when \code{type = "precise"}.
+#'
+#' @return The function returns a data frame containing the multi-trait GWAS results, where the row names are
+#' the variants names. The column names are: variant name (\code{Marker}), allele frequency (\code{Freq}),
+#' the smallest sample size of the traits (\code{N}), effect on the phenotype score (\code{Beta.S}, see reference),
+#' standard error (\code{SE}), p-value (\code{P}), and the rest the coefficients to construct the phenotype score
+#' (see reference)
+#'
+#' @author Xia Shen
+#'
+#' @references
+#' Xia Shen, Xiao Wang, Zheng Ning, Yakov Tsepilov, Masoud Shirali,
+#' Generation Scotland, Blair H. Smith, Lynne J. Hocking, Sandosh Padmanabhan, Caroline Hayward,
+#' David J. Porteous, Yudi Pawitan, Chris S. Haley, Yurii S. Aulchenko (2015).
+#' Simple multi-trait analysis identifies novel loci
+#' associated with growth and obesity measures. \emph{Submitted}.
+#'
+#' @seealso
+#' \code{load.summary}, \code{Multivariate}
+#'
+#' @examples
+#' \dontrun{
+#' ## download the six example files from:
+#' ## https://www.dropbox.com/sh/hhta45cewvvea2s/AADfj4OXlbroToZAwIii2Buha?dl=0
+#' ## the summary statistics from Randall et al. (2013) PLoS Genet
+#' ## for males only
+#' ## bmi: body mass index
+#' ## hip: hip circumference
+#' ## wc: waist circumference
+#' ## whr: waist-hip ratio
+#'
+#' ## load the prepared set of independent SNPs
+#' indep.snps <- as.character(read.table('indep.snps')$V1)
+#'
+#' ## load summary statistics of the six traits
+#' stats.male <- load.summary(files = c('bmi.txt', 'height.txt',
+#' 'weight.txt', 'hip.txt', 'wc.txt',
+#' 'whr.txt'), indep.snps = indep.snps)
+#'
+#' ## perform multi-trait meta-GWAS
+#' result <- MultiSummary(stats.male)
+#' head(result)
+#' }
+#' @aliases MultiSummary, multi.summary
+#' @keywords multivariate, meta-analysis
+#'
+`MultiSummary` <- function(x, type = 'outbred', vars = NULL) {
+ if (class(x) != 'multi.summary') {
+ stop('wrong data type!')
+ }
+ cat('multi-trait genome scan ... ')
+ m <- nrow(x$cor.pheno)
+ f <- x$gwa[,2*m + 1]
+ n <- x$gwa[,2*m + 2]
+ k <- nrow(x$gwa)
+ betamat <- x$gwa[,seq(1, 2*m, 2)]
+ res <- data.frame(Marker = rownames(x$gwa), Freq = f, N = n, Beta.S = NA, SE = NA, P = NA)
+ rownames(res) <- rownames(x$gwa)
+ if (type == 'outbred') {
+ scan <- .Fortran('MultiSummaryLoop', k = as.integer(k), m = as.integer(m), nn = n,
+ f = f, betamat = betamat, R = x$cor.pheno, invR = solve(x$cor.pheno),
+ E0 = diag(m), H = diag(m), coef = betamat,
+ pil = numeric(k), fstat = numeric(k), PACKAGE = "MultiABEL")
+ } else if (type == 'inbred') {
+ scan <- .Fortran('MultiSummaryLoopInbred', k = as.integer(k), m = as.integer(m), nn = n,
+ f = f, betamat = betamat, R = x$cor.pheno, invR = solve(x$cor.pheno),
+ E0 = diag(m), H = diag(m), coef = betamat,
+ pil = numeric(k), fstat = numeric(k), PACKAGE = "MultiABEL")
+ } else if (type == 'precise' & !is.null(vars)) {
+ scan <- .Fortran('MultiSummaryLoopPrecise', k = as.integer(k), m = as.integer(m), nn = n,
+ f = f, betamat = betamat, R = x$cor.pheno, invR = solve(x$cor.pheno),
+ E0 = diag(m), H = diag(m), coef = betamat,
+ pil = numeric(k), fstat = numeric(k), vg = vars, PACKAGE = "MultiABEL")
+ } else {
+ stop('wrong type of analysis!')
+ }
+ cat('done.\n')
+ res$Beta.S <- scan$pil
+ res$P <- pf(scan$fstat, m, n - m - 1, lower.tail = FALSE)
+ res$SE <- res$Beta.S/sqrt(qchisq(res$P, 1, lower.tail = FALSE))
+ coef <- scan$coef
+ colnames(coef) <- paste('Coef.Trait', 1:m, sep = '.')
+ return(data.frame(res, coef))
+}
Property changes on: pkg/MultiABEL/R/MultiSummary.R
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: pkg/MultiABEL/R/Multivariate.R
===================================================================
--- pkg/MultiABEL/R/Multivariate.R 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/R/Multivariate.R 2015-06-03 21:27:00 UTC (rev 1991)
@@ -48,6 +48,7 @@
#' ## converting the same dataset into DatABEL format files
#' write.table(phdata(ge03d2ex.clean), 'pheno.txt', col.names = TRUE, row.names = TRUE,
#' quote = FALSE, sep = '\t')
+#' geno <- as.double(ge03d2ex.clean)
#' matrix2databel(geno, 'geno')
#'
#' ## running the multivariate GWAS again
Added: pkg/MultiABEL/R/load.summary.R
===================================================================
--- pkg/MultiABEL/R/load.summary.R (rev 0)
+++ pkg/MultiABEL/R/load.summary.R 2015-06-03 21:27:00 UTC (rev 1991)
@@ -0,0 +1,153 @@
+#' Loading multiple summary statistics from genome-wide association studies
+#'
+#' The function loads multiple meta-GWAS summary statistics, for subsequent multi-trait GWAS.
+#' Currently, the package only analyzes summary statistics from inverse-Gaussianized continuous traits.
+#'
+#' @param files A vector of file names as strings. Each file name should contain summary statistics of
+#' one trait to be included in the multi-trait analysis. The columns of the summary statistics have to
+#' contain \code{'snp'} (marker ID), \code{'a1'} (the first allele), \code{'freq'}
+#' (frequency of the first allele), \code{'beta'} (effect size), \code{'se'} (standard error), and
+#' \code{'n'} (sample size).
+#' @param cor.pheno A #traits x #traits matrix of correlation matrix of the phenotypes, to be used to
+#' construct the multi-trait test statistic. If \code{NULL},
+#' this matrix will be estimated from genome-wide summary statistics. If you have partially overlapping
+#' samples for different traits, shrinkage correlation matrix is recommended (see reference), so in that
+#' case, unless you know what you are doing, leave this argument as default, i.e. \code{NULL}.
+#' @param indep.snps A vector of strings containing the names of a set of independent SNPs. This is
+#' recommended to be generated by LD-pruning the genotype data in a certain cohort. Typically the
+#' number of SNPs should be more than 10,000 in order to obtain a good estimate of \code{cor.pheno}. If
+#' \code{cor.pheno = NULL}, this argument cannot be \code{NULL}.
+#'
+#' @return The function returns a list of class \code{multi.summary}, containing two elements: \code{gwa}
+#' (the cleaned data to be processed in multi-trait GWAS) and \code{cor.pheno} (user input or estimated).
+#'
+#' @author Xia Shen
+#'
+#' @references
+#' Xia Shen, Xiao Wang, Zheng Ning, Yakov Tsepilov, Masoud Shirali,
+#' Generation Scotland, Blair H. Smith, Lynne J. Hocking, Sandosh Padmanabhan, Caroline Hayward,
+#' David J. Porteous, Yudi Pawitan, Chris S. Haley, Yurii S. Aulchenko (2015).
+#' Simple multi-trait analysis identifies novel loci
+#' associated with growth and obesity measures. \emph{Submitted}.
+#'
+#' @seealso
+#' \code{MultiSummary}
+#'
+#' @examples
+#' \dontrun{
+#' ## download the six example files from:
+#' ## https://www.dropbox.com/sh/hhta45cewvvea2s/AADfj4OXlbroToZAwIii2Buha?dl=0
+#' ## the summary statistics from Randall et al. (2013) PLoS Genet
+#' ## for males only
+#' ## bmi: body mass index
+#' ## hip: hip circumference
+#' ## wc: waist circumference
+#' ## whr: waist-hip ratio
+#'
+#' ## load the prepared set of independent SNPs
+#' indep.snps <- as.character(read.table('indep.snps')$V1)
+#'
+#' ## load summary statistics of the six traits
+#' stats.male <- load.summary(files = list.files(pattern = '*.txt'), indep.snps = indep.snps)
+#'
+#' ## perform multi-trait meta-GWAS
+#' result <- MultiSummary(stats.male)
+#' head(result)
+#' }
+#' @aliases load.summary
+#' @keywords multivariate, meta-analysis
+#'
+`load.summary` <- function(files, cor.pheno = NULL, indep.snps = NULL) {
+ if (!all(is.character(files))) {
+ stop('files should be given as strings!')
+ }
+ if (sum(file.exists(files)) < 2) {
+ stop('number of traits has to be more than 2!')
+ }
+ m <- length(files)
+ if (!is.null(cor.pheno)) {
+ if (nrow(cor.pheno) != m | ncol(cor.pheno) != m) {
+ stop('wrong dimensions of cor.pheno!')
+ }
+ }
+ cat('loading data ...\n')
+ data <- c()
+ fn <- rev(files)
+ for (i in m:1) {
+ dd <- read.table(fn[i], header = TRUE)
+ idx <- which(duplicated(dd$snp))
+ data[[i]] <- dd[-idx,]
+ rownames(data[[i]]) <- dd$snp[-idx]
+ progress((m - i + 1)/m*100)
+ }
+ cat('\n')
+ cat('checking markers ...\n')
+ snps <- data[[1]]$snp
+ for (i in 2:m) {
+ snps <- data[[i]]$snp[data[[i]]$snp %in% snps]
+ progress(i/m*100)
+ }
+ snps <- unique(snps)
+ cat('\n')
+ cat('cleaning data ...\n')
+ for (i in 1:m) {
+ data[[i]] <- data[[i]][snps,]
+ progress(i/m*100)
+ }
+ cat('\n')
+ cat('correcting parameters ...\n')
+ for (i in 2:m) {
+ if (any(data[[i]]$a1 != data[[1]]$a1)) {
+ adj <- 2*as.numeric(data[[i]]$a1 == data[[1]]$a1) - 1
+ data[[i]]$beta <- data[[i]]$beta*adj
+ data[[i]]$freq <- (adj == 1)*data[[i]]$freq + (adj == -1)*(1 - data[[i]]$freq)
+ }
+ progress(i/m*100)
+ }
+ cat('\n')
+ cat('adjusting sample size ... ')
+ n0 <- matrix(NA, nrow(data[[1]]), m)
+ for (i in 1:m) {
+ n0[,i] <- data[[i]]$n
+ }
+ n <- apply(n0, 1, "min")
+ cat('done.\n')
+ cat('finalizing summary statistics ...\n')
+ gwa0 <- matrix(NA, nrow(data[[1]]), 2*m + 2)
+ for (i in 1:m) {
+ gwa0[,i*2 - 1] <- data[[i]][,'beta']
+ gwa0[,i*2] <- data[[i]][,'se']
+ progress(i/m*100)
+ }
+ gwa0[,2*length(data) + 1] <- data[[1]][,'freq']
+ gwa0[,2*length(data) + 2] <- n
+ rownames(gwa0) <- data[[1]]$snp
+ gwa0 <- na.omit(gwa0)
+ cat('\n')
+ if (is.null(cor.pheno)) {
+ if (is.null(indep.snps)) {
+ stop('indep.snps required for estimating cor.pheno!')
+ }
+ n.ratio <- diag(m)
+ for (i in 1:(m - 1)) {
+ for (j in (i + 1):m) {
+ ratio <- mean(sqrt(n0[,j]/n0[,i]), na.rm = TRUE)
+ n.ratio[i,j] <- n.ratio[j,i] <- ifelse(ratio > 1, 1/ratio, ratio)
+ }
+ }
+ if (any(n.ratio < 1)) {
+ cat('samples partially overlap!\n')
+ cat('estimating shrinkage phenotypic correlations ... ')
+ } else {
+ cat('estimating phenotypic correlations ... ')
+ }
+ idx <- which(rownames(gwa0) %in% indep.snps)
+ gwa1 <- gwa0[idx,]
+ z <- gwa1[,seq(1, 2*m, 2)]/gwa1[,seq(2, 2*m, 2)]
+ cor.pheno <- cor(z, use = 'pairwise.complete.obs')
+ cat('done.\n')
+ }
+ dd <- list(gwa = gwa0, cor.pheno = cor.pheno)
+ class(dd) <- 'multi.summary'
+ return(dd)
+}
Property changes on: pkg/MultiABEL/R/load.summary.R
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: pkg/MultiABEL/R/misc.R
===================================================================
--- pkg/MultiABEL/R/misc.R 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/R/misc.R 2015-06-03 21:27:00 UTC (rev 1991)
@@ -14,4 +14,5 @@
packageStartupMessage(paste("Author: ", pkgAuthor, sep = ""))
packageStartupMessage(paste("Maintainer: ", pkgMaintainer, "\n", sep = ""))
packageStartupMessage('Use citation("MultiABEL") to know how to cite this work.\n')
-}
\ No newline at end of file
+}
+
Modified: pkg/MultiABEL/inst/CITATION
===================================================================
--- pkg/MultiABEL/inst/CITATION 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/inst/CITATION 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,22 +1,44 @@
-citHeader("To cite the package MultiABEL in publications use:")
+citHeader("If you use the MultiSummary() and the other procedures, respectively, please cite:")
citEntry(entry="Article",
- title = "Multi-omic-variate analysis identified the association between 14q32.33 and compound N-Glycosylation of human Immunoglobulin G",
+ title = "Simple multi-trait analysis identifies novel loci associated with growth and obesity measures",
author = personList(as.person("Xia Shen"),
+ as.person("Xiao Wang"),
as.person("..."),
+ as.person("Yudi Pawitan"),
+ as.person("Chris S. Haley"),
+ as.person("Yurii S. Aulchenko")),
+ journal = "Submitted",
+ year = "2015",
+ volume = "0",
+ number = "0",
+ pages = "0-0",
+ url = "http://",
+
+ textVersion =
+ paste("Xia Shen, Xiao Wang, ..., Yudi Pawitan, Chris S. Haley, Yurii S. Aulchenko (2015).",
+ "Simple multi-trait analysis identifies novel loci associated with growth and obesity measures",
+ "Submitted",
+ "URL http://")
+)
+
+citEntry(entry="Article",
+ title = "Multi-omic-variate analysis identified novel loci associated with N-Glycosylation of human Immunoglobulin G",
+ author = personList(as.person("Xia Shen"),
+ as.person("..."),
as.person("Gordan Lauc"),
- as.person("Jim Wilson"),
- as.person("Yurii Aulchenko")),
+ as.person("James F. Wilson"),
+ as.person("Yurii S. Aulchenko")),
journal = "Submitted",
- year = "2014",
+ year = "2015",
volume = "0",
number = "0",
pages = "0-0",
url = "http://",
textVersion =
- paste("Xia Shen, ..., Gordan Lauc, Jim Wilson, Yurii Aulchenko (2014).",
- "Multi-omic-variate analysis identified the association between 14q32.33 and compound N-Glycosylation of human Immunoglobulin G",
+ paste("Xia Shen, ..., Gordan Lauc, James F. Wilson, Yurii S. Aulchenko (2015).",
+ "Multi-omic-variate analysis identified novel loci associated with N-Glycosylation of human Immunoglobulin G",
"Submitted",
"URL http://")
)
Modified: pkg/MultiABEL/man/MultiABEL.Rd
===================================================================
--- pkg/MultiABEL/man/MultiABEL.Rd 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/man/MultiABEL.Rd 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/MultiABEL.R
\docType{package}
\name{MultiABEL}
\alias{MultiABEL}
@@ -9,9 +10,10 @@
MultiABEL: Multivariate Genome-Wide Association Analyses
}
\details{
-The MultiABEL package performs multivariate genome-wide association studies (GWAS)
-and subsequent analyses. The GWAS module is compatible with different kinds of *ABEL
-data formats.
+Performing multivariate genome-wide association (MVGWA) analyses.
+The modules are compatible with existing *ABEL data formats. The GWA
+analyses can be done on individual level data or on
+single-trait GWA summary statistics only.
For converting data from other formats, see
@@ -46,14 +48,11 @@
\code{\link{snp.subset}}.
}
\author{
-Xia Shen, Yurii Aulchenko
+Xia Shen
}
\references{
-If you use MultiABEL package in your analysis, please cite the following work:
-
-Xia Shen, ..., Gordan Lauc, Jim Wilson, Yurii Aulchenko (2014).
-Multi-omic-variate analysis identified the association between 14q32.33
-and compound N-Glycosylation of human Immunoglobulin G. \emph{Submitted}.
+If you use the MultiABEL package in your analysis, please cite the
+papers in \code{citation("MultiABEL")}.
}
\seealso{
\code{GenABEL}, \code{DatABEL}
Modified: pkg/MultiABEL/man/MultiMeta.Rd
===================================================================
--- pkg/MultiABEL/man/MultiMeta.Rd 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/man/MultiMeta.Rd 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/MultiMeta.R
\name{MultiMeta}
\alias{MultiMeta}
\alias{MultiMeta,}
Modified: pkg/MultiABEL/man/MultiRep.Rd
===================================================================
--- pkg/MultiABEL/man/MultiRep.Rd 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/man/MultiRep.Rd 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/MultiRep.R
\name{MultiRep}
\alias{MultiRep}
\alias{MultiRep,}
@@ -75,7 +76,7 @@
}
}
\author{
-Xia Shen, Yurii Aulchenko
+Xia Shen
}
\references{
Xia Shen, ..., Gordan Lauc, Jim Wilson, Yurii Aulchenko (2014).
Added: pkg/MultiABEL/man/MultiSummary.Rd
===================================================================
--- pkg/MultiABEL/man/MultiSummary.Rd (rev 0)
+++ pkg/MultiABEL/man/MultiSummary.Rd 2015-06-03 21:27:00 UTC (rev 1991)
@@ -0,0 +1,72 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/MultiSummary.R
+\name{MultiSummary}
+\alias{MultiSummary}
+\alias{MultiSummary,}
+\alias{multi.summary}
+\title{Multivariate genome-wide association scan using summary statistics}
+\usage{
+MultiSummary(x, type = "outbred", vars = NULL)
+}
+\arguments{
+\item{x}{A data object of class \code{multi.summary} loaded by the function \code{load.summary}.}
+
+\item{type}{A string gives the type of analysis. Default is \code{"outbred"}, referring to
+general outbred populations, following Hardy-Weinberg equilibrium. \code{"inbred"} refers to
+inbred populations, where no heterzygotes exists, namely, allele frequency = genotype frequency.
+\code{"precise"} refers to precise test statistics, especially when the individual-level data
+are available, for which the argument \code{vars} has to be given.}
+
+\item{vars}{A numeric vector gives the variance of the genotypes at each SNP, coded as 0, 1 and 2.
+Only used when \code{type = "precise"}.}
+}
+\value{
+The function returns a data frame containing the multi-trait GWAS results, where the row names are
+the variants names. The column names are: variant name (\code{Marker}), allele frequency (\code{Freq}),
+the smallest sample size of the traits (\code{N}), effect on the phenotype score (\code{Beta.S}, see reference),
+standard error (\code{SE}), p-value (\code{P}), and the rest the coefficients to construct the phenotype score
+(see reference)
+}
+\description{
+The function performs multivariate GWA analysis using meta-GWAS summary statistics
+}
+\examples{
+\dontrun{
+## download the six example files from:
+## https://www.dropbox.com/sh/hhta45cewvvea2s/AADfj4OXlbroToZAwIii2Buha?dl=0
+## the summary statistics from Randall et al. (2013) PLoS Genet
+## for males only
+## bmi: body mass index
+## hip: hip circumference
+## wc: waist circumference
+## whr: waist-hip ratio
+
+## load the prepared set of independent SNPs
+indep.snps <- as.character(read.table('indep.snps')$V1)
+
+## load summary statistics of the six traits
+stats.male <- load.summary(files = c('bmi.txt', 'height.txt',
+ 'weight.txt', 'hip.txt', 'wc.txt',
+ 'whr.txt'), indep.snps = indep.snps)
+
+## perform multi-trait meta-GWAS
+result <- MultiSummary(stats.male)
+head(result)
+}
+}
+\author{
+Xia Shen
+}
+\references{
+Xia Shen, Xiao Wang, Zheng Ning, Yakov Tsepilov, Masoud Shirali,
+Generation Scotland, Blair H. Smith, Lynne J. Hocking, Sandosh Padmanabhan, Caroline Hayward,
+David J. Porteous, Yudi Pawitan, Chris S. Haley, Yurii S. Aulchenko (2015).
+Simple multi-trait analysis identifies novel loci
+associated with growth and obesity measures. \emph{Submitted}.
+}
+\seealso{
+\code{load.summary}, \code{Multivariate}
+}
+\keyword{meta-analysis}
+\keyword{multivariate,}
+
Property changes on: pkg/MultiABEL/man/MultiSummary.Rd
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: pkg/MultiABEL/man/Multivariate.Rd
===================================================================
--- pkg/MultiABEL/man/Multivariate.Rd 2015-05-27 22:00:29 UTC (rev 1990)
+++ pkg/MultiABEL/man/Multivariate.Rd 2015-06-03 21:27:00 UTC (rev 1991)
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/Multivariate.R
\name{Multivariate}
\alias{Multivariate}
\alias{Multivariate,}
@@ -58,6 +59,7 @@
## converting the same dataset into DatABEL format files
write.table(phdata(ge03d2ex.clean), 'pheno.txt', col.names = TRUE, row.names = TRUE,
quote = FALSE, sep = '\\t')
+geno <- as.double(ge03d2ex.clean)
matrix2databel(geno, 'geno')
## running the multivariate GWAS again
Added: pkg/MultiABEL/man/load.summary.Rd
===================================================================
--- pkg/MultiABEL/man/load.summary.Rd (rev 0)
+++ pkg/MultiABEL/man/load.summary.Rd 2015-06-03 21:27:00 UTC (rev 1991)
@@ -0,0 +1,72 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/load.summary.R
+\name{load.summary}
+\alias{load.summary}
+\title{Loading multiple summary statistics from genome-wide association studies}
+\usage{
+load.summary(files, cor.pheno = NULL, indep.snps = NULL)
+}
+\arguments{
+\item{files}{A vector of file names as strings. Each file name should contain summary statistics of
+one trait to be included in the multi-trait analysis. The columns of the summary statistics have to
+contain \code{'snp'} (marker ID), \code{'a1'} (the first allele), \code{'freq'}
+(frequency of the first allele), \code{'beta'} (effect size), \code{'se'} (standard error), and
+\code{'n'} (sample size).}
+
+\item{cor.pheno}{A #traits x #traits matrix of correlation matrix of the phenotypes, to be used to
+construct the multi-trait test statistic. If \code{NULL},
+this matrix will be estimated from genome-wide summary statistics. If you have partially overlapping
+samples for different traits, shrinkage correlation matrix is recommended (see reference), so in that
+case, unless you know what you are doing, leave this argument as default, i.e. \code{NULL}.}
+
+\item{indep.snps}{A vector of strings containing the names of a set of independent SNPs. This is
+recommended to be generated by LD-pruning the genotype data in a certain cohort. Typically the
+number of SNPs should be more than 10,000 in order to obtain a good estimate of \code{cor.pheno}. If
+\code{cor.pheno = NULL}, this argument cannot be \code{NULL}.}
+}
+\value{
+The function returns a list of class \code{multi.summary}, containing two elements: \code{gwa}
+(the cleaned data to be processed in multi-trait GWAS) and \code{cor.pheno} (user input or estimated).
+}
+\description{
+The function loads multiple meta-GWAS summary statistics, for subsequent multi-trait GWAS.
+Currently, the package only analyzes summary statistics from inverse-Gaussianized continuous traits.
+}
+\examples{
+\dontrun{
+## download the six example files from:
+## https://www.dropbox.com/sh/hhta45cewvvea2s/AADfj4OXlbroToZAwIii2Buha?dl=0
+## the summary statistics from Randall et al. (2013) PLoS Genet
+## for males only
+## bmi: body mass index
+## hip: hip circumference
+## wc: waist circumference
+## whr: waist-hip ratio
+
+## load the prepared set of independent SNPs
+indep.snps <- as.character(read.table('indep.snps')$V1)
+
+## load summary statistics of the six traits
+stats.male <- load.summary(files = list.files(pattern = '*.txt'), indep.snps = indep.snps)
+
+## perform multi-trait meta-GWAS
+result <- MultiSummary(stats.male)
+head(result)
+}
+}
+\author{
+Xia Shen
+}
+\references{
+Xia Shen, Xiao Wang, Zheng Ning, Yakov Tsepilov, Masoud Shirali,
+Generation Scotland, Blair H. Smith, Lynne J. Hocking, Sandosh Padmanabhan, Caroline Hayward,
+David J. Porteous, Yudi Pawitan, Chris S. Haley, Yurii S. Aulchenko (2015).
+Simple multi-trait analysis identifies novel loci
+associated with growth and obesity measures. \emph{Submitted}.
+}
+\seealso{
+\code{MultiSummary}
+}
+\keyword{meta-analysis}
+\keyword{multivariate,}
+
Property changes on: pkg/MultiABEL/man/load.summary.Rd
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: pkg/MultiABEL/src/MultiSummaryLoop.f90
===================================================================
--- pkg/MultiABEL/src/MultiSummaryLoop.f90 (rev 0)
+++ pkg/MultiABEL/src/MultiSummaryLoop.f90 2015-06-03 21:27:00 UTC (rev 1991)
@@ -0,0 +1,38 @@
+!
+! MultiSummaryLoop.f90
+!
+! Created by Xia Shen on 5/29/15.
+!
+
+subroutine MultiSummaryLoop(k, m, nn, f, betamat, R, invR, E0, H, coef, pil, fstat)
+
+ implicit none
+ integer :: i, j, k, m
+ double precision, dimension(m, m) :: R, invR, E0, H, HinvE0
+ double precision, dimension(1, m) :: beta
+ double precision, dimension(m, 1) :: tmp
+ double precision, dimension(k) :: nn, f, pil, fstat
+ double precision, dimension(k, m) :: betamat, coef
+ double precision, dimension(m) :: lambda
+ double precision :: vg
+ do j = 1, k
+ vg = 2*f(j)*(1 - f(j))
+ E0 = nn(j)*R
+ do i = 1, m
+ beta(1,i) = betamat(j,i)
+ end do
+ tmp = matmul(invR, transpose(beta))*vg
+ do i = 1, m
+ coef(j,i) = tmp(i,1)
+ end do
+ H = matmul(transpose(beta), beta)*nn(j)*vg
+ HinvE0 = matmul(H, invR)/nn(j)
+ do i = 1, m
+ lambda(i) = HinvE0(i,i)
+ end do
+ pil(j) = sum(lambda)
+ fstat(j) = pil(j)/m/(1 - pil(j))*(nn(j) - m - 1)
+ end do
+
+end subroutine MultiSummaryLoop
+
Property changes on: pkg/MultiABEL/src/MultiSummaryLoop.f90
___________________________________________________________________
Added: svn:executable
+ *
Added: pkg/MultiABEL/src/symbols.rds
===================================================================
(Binary files differ)
Property changes on: pkg/MultiABEL/src/symbols.rds
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
More information about the Genabel-commits
mailing list