burden.weighted.matrix: Score matrix for burden tests

View source: R/burden_weighted_matrix.r

burden.weighted.matrixR Documentation

Score matrix for burden tests

Description

Computes the score matrix for burden tests based on variants' weights

Usage

burden.weighted.matrix(x, weights, genomic.region = x@snps$genomic.region)

Arguments

x

A bed.matrix

weights

A vector containing the weight of each variant

genomic.region

A factorcontaining the genomic region of each variant

Details

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.

Value

A matrix containing the computed genetic score with one row per individual and one column per genomic.region.

See Also

CAST, WSS, burden.mlogit

Examples

#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)

Ravages documentation built on April 1, 2023, 12:08 a.m.