View source: R/burden_weighted_matrix.r
| burden.weighted.matrix | R Documentation |
Computes the score matrix for burden tests based on variants' weights
burden.weighted.matrix(x, weights, genomic.region = x@snps$genomic.region)
x |
A bed.matrix |
weights |
A vector containing the weight of each variant |
genomic.region |
A factorcontaining the genomic region of each variant |
For variant i and individual j, the genetic score will be computed as weight of variant i * number of minor alleles for individual j. This function returns a weighted score of rare alleles in the genomic region: if the reference allele is rare, it will be counted in the score instead of the atlernative allele.
A matrix containing the computed genetic score with one row per individual and one column per genomic.region.
CAST, WSS, burden.mlogit
#Import data in a bed matrix
x <- read.bed.matrix( system.file("extdata", "LCT.EUR.b37.bed", package="Ravages") )
#Group variants within known genes
x <- set.genomic.region(x)
#Filter of rare variants: only non-monomorphic variants with
#a MAF lower than 2.5%
#keeping only genomic regions with at least 200 SNP
x1 <- filter.rare.variants(x, filter = "whole", maf.threshold = 0.025, min.nb.snps = 200)
#Compute burden score with weights = 1-maf
score.burden <- burden.weighted.matrix(x1, weights=1-x1@snps$maf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.