Learn R Programming

vbdm (version 0.0.1)

burdenPlot: plotting function for rare variant vbdm test

Description

This function produces a plot depicting the phenotype distribution, the distribution of carriers of the rare alleles, and also can include the posterior probaiblity of association as estimated by the vbdm algorithm.

Usage

burdenPlot(y, G, annotation = rep('missense',ncol(G)), title='',
          order='mean', legend='keep', type='lines',
          post=NULL, name.snp=NULL)

Arguments

y
A vector of continuous phenotypes.
G
A matrix of genotypes that are encoded as 0, 1, or 2.
annotation
A vector of SNP annotations for the columns of G. The default is 'missense'. Possible annotations are 'missense', 'nonsense','splice', and 'synonymous'. Default is for all variants to be
title
An optional title for the plot.
order
How the variants should be ordered in the bottom quadrant of the plot. Possible options include order='mean' which orders based on the mean phenotypic value of carriers of the rare variants, order='MAF' which orders the variants
legend
If legend='keep' then a legend is depicted with variant annotations.
type
If type='lines' then the range of phenotype values for carriers are shown with a horizontal lines, with phenotypic values at the vertical tick marks. If type='points' then the phenotypic values are shown with points.
post
Optional vector of posterior probabilities from vbdm result.
name.snp
Optional vector of snp names.

See Also

vbdm, vbdmR

Examples

Run this code
#generate some test data
library(vbdm)
set.seed(1)
n <- 1000
m <- 30
G <- matrix(rbinom(n*m,2,.01),n,m);
beta1 <- rbinom(m,1,.2)
y <- G%*%beta1+rnorm(n,0,2)
res <- vbdm(y=y,G=G,scaling=FALSE);
bp<-burdenPlot(y=y,G=G,post=res$pvec,name.snp=1:30);

Run the code above in your browser using DataLab