Learn R Programming

MultiMeta (version 0.1)

multi_meta: Meta-analysis of multivariate GWAS results

Description

multi_meta returns the meta-analysis results for multivariate GWAS across different cohorts.

Usage

multi_meta(files = c(), N = c(), output.file = "Meta_Results.txt", size.chunks = 5e+06, min.pop = 2, sep = "\t")

Arguments

files
A vector containing the names of the results files to meta-analyse. These can be outputs from GEMMA multivariate analysis or similar (see Details). Furthermore they can be single-chromosome or genome-wide results.
N
A vector containing sample sizes for each of the above files. This parameter is optional and is only required for computing the overall allele frequency.
output.file
The name of the output file.
size.chunks
Size of each chunk to be read and processed. Default is 5,000,000 (5 Mb). This size will require very low memory usage. Increase this parameter if more memory is allocated or if the number of cohorts is limited. Read more about the chunks in Details.
min.pop
Minimum number of populations required per SNP to compute meta-analysis. Default is 2, it can be any number up to the total number of cohorts analysed.
sep
Separator for reading input files.

Details

This function applies an inverse-variance based method to meta-analyse multivariate GWAS results. In particular, given n different cohorts, for which p phenotypes have been tested for genome-wide association, the results for each cohort will have p different effect size coefficients i.e. beta values (one per each phenotype) and a variance/covariance pxp matrix representing beta's variances and covariances. In particular, the function is built to consider the output from the GEMMA software multivariate association testing. If your output is not produced with GEMMA, the function works on any results file containing the following column names:
  • chr Chromosome
  • ps Position
  • rs SNP name
  • allele1 Effect allele
  • allele0 Non-effect allele
  • af Effect-allele frequency
  • beta_1, beta_2, ..., beta_p Effect sizes for each of the p traits
  • Vbeta_1_1, Vbeta_1_2, ..., Vbeta_1_p, Vbeta_2_2, ..., Vbeta_2_p, ..., Vbeta_p_p variance-covariance matrix entries (diagonal and upper triangle values only, since this matrix is symmetric)

The function divides input files into chunks based on position. Only one chunk at a time is read and analysed; thus a limited amount of data is loaded in the workspace at one given time. Default chunk dimension is 5 Mb for which low memory is required (

Examples

Run this code
file1=system.file("extdata", "Example_file_1.txt", package="MultiMeta")
file2=system.file("extdata", "Example_file_2.txt", package="MultiMeta")
multi_meta(files=c(file1,file2), N=c(1200,600), sep=" ",
output.file="Output_from_running_example.txt")

Run the code above in your browser using DataLab