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 <- as.bed.matrix(x=LCT.matrix.bed, fam=LCT.matrix.fam, bim=LCT.snps)
# Group variants within known genes
x <- set.genomic.region(x)
# Filter variants with maf (computed on whole sample) < 0.025
# keeping only genomic region with at least 10 SNPs
x1 <- filter.rare.variants(x, filter = "whole", maf.threshold = 0.025, min.nb.snps = 10)
#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.