Open main menu

Genome Analysis Wiki β

RareMETALS

Revision as of 18:06, 24 January 2015 by Dajiang Liu (talk | contribs) (What is new)

rareMETALS is an R-package for performing single or gene-level tests for detecting rare variant associations. For questions regarding the use of this package, please contact Dajiang Liu (dajiang at umich dot edu) or Gonçalo Abecasis (goncalo at umich dot edu). The same methodology is also implemented in command line tools. Please see [1]

Contents

What is new

  • 01/24/2014 Version 5.8 is released, which fixed a serious bug for single variant unconditional association tests with group file. If you happen to run it using version 5.7, the results are likely to be incorrect. Please rerun using version 5.8.
  • 01/04/2014 Version 5.7 is released, which added metrics for heterogeneity of genetic effects, including I2 and Q for single variant association statistics
  • 12/09/2014 Version 5.6 is released, which added function conditional.rareMETALS.range.group, and fixed a minor issue for estimating sample sizes.
  • 11/19/2014 Version 5.5 is released, which fixes a few bugs on the version 5.4.
  • 11/09/2014 Version 5.4 is posted with the following change 1.) Allowing for performing conditional analysis for multiple candidate variants 2.) add option correctFlip to rareMETALS.single.group, rareMETALS.range.group allowing for options to discard sites with non-matching ref or alt alleles. Default is TRUE
  • 09/08/2014 Version 5.2 is posted. One change in version 5.0 and 5.1 is reverted, which could lead to undesirable effect. It improves on some border line cases as compared to Versions 4.7 - 4.9. But in general, version 5.2 and 4.7-4.9 should give very comparable results. Please update to the latest version. I would expect that version 5.2 should run stably for all models under all circumstances.
  • 08/21/2014 Version 4.9 is posted. A bug is fixed for VT test. While the p-values and statistics were correct, the number of sites and the beta estimate could sometimes be incorrect in version 4.8. Now it is fixed. Please download the newest version. Thanks!
  • 08/18/2014 Version 4.8 is posted. A bug for recessive model analysis is fixed. Additive and dominant models should remain unaffected. Thanks!
  • 08/06/2014 Version 4.7 is posted, where a few minor bugs were fixed. Thanks to Heather Highland and Xueling Sim for careful testing!! Please update. Thanks!
  • 07/15/2014 Fixed a bug in conditional.rareMETALS.single and conditional.rareMETALS.range; Please update. Thanks!
  • 06/27/2014 Updated to version 4.0: Many updates are implemented, including support for group files in both single variant and gene-level association test; checks for allele flips based upon variant frequency, the detection of possible allele flips using a novel statistic based upon variations of allele frequency between studies;

Where to download

The R package can be downloaded from rareMETALS_5.7.tar.gz. It will be eventually released on the Comprehensive R-archive Network. To perform gene-level association test, you will also need refFlat_hg19.txt.gz, which is the gene definition modified from refFlat.

How to install

To install the package, please use "R CMD INSTALL rareMETALS_4.0.tar.gz" command.

Supported Functionalities

  • Marginal analysis of single variant or gene-level association test
  • Conditional analysis of single variant or gene-level association, for variants (gene) where there are covariance information available between candidate variants and known variants.
  • Estimates of genetic effects and locus genetic variance

Preparing Input Files for rareMETALS

  1. Generate summary level statistic files: Summary statistics files can be generated by rvtests [2] or rare-metal-worker [3]
  2. Annotate your summary level statistics: In order to perform gene-level association test, summary level statistics file have to be annotated first. The default program for performing annotations is ANNO (by Xiaowei Zhan). The usage of the program can be found at [4]
  3. Compress and Index Summary Statistics: Files rareMETALS R-package takes compressed and tabix-indexed files as input for performing meta-analysis

Performing single variant association analysis

  • Single variant association analysis statistics can be calculated using the following function in the package:
 rareMETALS.single(score.stat.file, cov.file, range, alternative = c("two.sided", "greater", "less"), ix.gold = 1, callrate.cutoff = 0, hwe.cutoff = 0)
  • Input parameters are described below:
    • score.stat.file is the vector of file names for single variant score statistics.
    • cov.file is the vector of files of covariance matrices for single variant score statistics
    • range is a tabix [5]-like range (e.g. 1:12345-23456). All variants in the specified region will be analyzed
    • alternative specifies alternative hypothesis to be tested. The default is two.sided.
    • ix.gold is the index to be used for choosing a "gold standard" population, in case flips of alleles are observed, and the gold standard population can be used to correct for the flips
    • callrate.cutoff specifies the call rate cutoffs that will be used. All sites with call rates lower than the cutoff will be labelled as missing.
    • hwe.cutoff specifies the cutoffs for call rate, All sites with call rate lower than the cutoff will be labeled as missing.
  • Output is a dataframe that consist of the following fields:
    • pos: Variant physical position
    • ref: Reference allele
    • alt: Alternative allele
    • no.sample: Number of samples
    • p.value: P-values
    • statistic: Test statistic (score statistic)
    • maf: Minor allele frequency
    • beta1.est: Beta estimates
    • beta1.sd: The standard deviation for beta estimates
    • hsq.est: Locus genetic variance estimates
    • direction.by.study: Direction of genetic effects by study
    • anno: Annotation for variants

Perform single variant association test using a group file

Summary level statistics collected in meta-analysis can often be messy, messier for lower frequency variants than for common variants. To correct for the right alleles, and make sure that ref/alt alleles from each study are properly aligned, it is often desirable to specify a group file. To do so, our function rareMETALS.single.group can be used. See the R help for details.


Performing gene level association test

  • Gene-level association test can be performed using the following function:
 rareMETALS.gene(ANNO, score.stat.file, cov.file, gene, test = "GRANVIL",maf.cutoff, no.boot = 10000, alternative = c("two.sided", "greater",
 "less"), alpha = 0.05, ix.gold = 1, out.digits = 4, callrate.cutoff = 0, hwe.cutoff = 0, gene.file = "refFlat_hg19.txt.gz")
  • Input parameters are described below:
    • ANNO is the annotation information for variants. Possible choices include Nonsynonymous, Stop_Gain, Stop_Loss, Synonymous, Essential_Splice_Site, or any logical combination of them, such as "Nonsynonymous|Stop_Gain|Stop_Loss"
    • score.stat.file is the vector of file names for single variant score statistics.
    • cov.file is the vector of files of covariance matrices for single variant score statistics
    • gene is the gene name such as PCSK9
    • no.boot is the number of bootstraps performed for evaluating significance, such as 10,000. If you choose to use analytic evaluation, please specify no.boot=0
    • alternative specifies alternative hypothesis to be tested. The default is two.sided.
    • ix.gold is the index to be used for choosing a "gold standard" population, in case flips of alleles are observed, and the gold standard population can be used to correct for the flips
    • out.digits is the number of digits in the output, which is used to prettify output.
    • callrate.cutoff specifies the call rate cutoffs that will be used. All sites with call rates lower than the cutoff will be labelled as missing.
    • hwe.cutoff specifies the cutoffs for call rate, All sites with call rate lower than the cutoff will be labeled as missing.
    • gene.file is a resource to locate gene region
  • Output: The output res.out consist of the following fields:
    • gene.name.out: gene names
    • p.value.out: P-value
    • statistic.out: Score statistics for meta-analysis
    • no.site.out: Number of variant sites in the gene.
    • beta1.est.out: Estimates for beta.
    • beta1.sd.out: Standard deviation for the beta estimates
    • maf.cutoff.out: The minor allele frequency cutoffs used to analyze the data
    • direction.burden.by.study.out: Direction of meta-analysis burden statistics across different studies
    • direction.meta.single.var.out: Direction of meta-analysis statistics for single variant test. It may be useful for inspecting if any of the variant in the gene have opposite effects etc.
    • pos.ref.alt.out: Position, reference and alternative alleles for each variant position in the gene

Perform gene-level test with a group file

Similar to single variant analysis, it is often desirable to use a group file to properly align alleles across different studies. To do so, please use our function == Perform single variant association test using a group file == Summary level statistics collected in meta-analysis can often be messy, messier for lower frequency variants than for common variants. To correct for the right alleles, and make sure that ref/alt alleles from each study are properly aligned, it is often desirable to specify a group file. To do so, our function rareMETALS.range.group can be used. See R help for details.


Performing conditional analysis for single variant tests

  • We provide functions for performing single variant conditional meta-analysis. For variants within the sliding window, the conditional analysis is exact, in the sense that they are equal to conditional analysis results obtained using individual level data.
  • The following function can be used:
conditional.rareMETALS.single.basic(candidate.variant,score.stat.file,cov.file,known.variant.vec,maf.cutoff,no.boot=0,alternative=c('two.sided','greater','less'),
alpha=0.05,ix.gold=1,out.digits=4,callrate.cutoff=0,hwe.cutoff=0,gene.file="refFlat_hg19.txt.gz",p.value.known.variant.vec="N/A",
anno.known.variant.vec="N/A",anno.candidate.variant="N/A")
  • Input parameters are described below:
    • candidate variant: the chromosomal position for the candidate variant to be tested, e.g. "1:12345";
    • score.stat.file is the vector of file names for single variant score statistics.
    • cov.file is the vector of files of covariance matrices for single variant score statistics
    • known.variant.vec is the vector of chromosomal positions for known variants. Examples include c("1:12345","1:1234567");
    • alternative specifies alternative hypothesis to be tested. The default is two.sided.
    • ix.gold is the index to be used for choosing a "gold standard" population, in case flips of alleles are observed, and the gold standard population can be used to correct for the flips
    • callrate.cutoff specifies the call rate cutoffs that will be used. All sites with call rates lower than the cutoff will be labelled as missing.
    • hwe.cutoff specifies the cutoffs for call rate, All sites with call rate lower than the cutoff will be labeled as missing.
    • anno.known.variant.vec: Annotation information for known variant. It is optional. If the annotation is not present, please use "NA". Note that the quotation mark is a must.
    • anno.candidate.variant: Annotation information for candidate variant. It is optional and can be ignored
  • Output is a dataframe that consist of the following fields:
    • pos.single.out: Chromosomal position for candidate variants
    • ref.single.out: Referrence allele
    • alt.single.out: Alternative allele
    • p.value.single.out: P values
    • maf.single.out: Minor allele frequencies
    • beta1.est.single.out: Estimates of alternative allele effects
    • beta1.sd.single.out: Standard deviation for beta estimates
    • direction.single.out: Direction of effects
    • anno.single.out: Annotation information for candidate variants
    • pos.ref.alt.known.single.out: Position/ref/alt alleles for known variants
    • p.value.known.single.out: p-values for known variants
    • anno.known.single.out: annotation for known variants