Learn R Programming

RVPedigree (version 0.0.3)

compute.weights: Compute/create matrix with genotype weights

Description

Compute/create matrix with genotype weights

Usage

compute.weights(G, weights)

Arguments

G
matrix of genotypes (genetic variants as columns, individuals as rows) as output by the Get.G function.
weights
optional numeric vector of genotype weights. If this option is not specified, the beta distribution is used for weighting the variants, with each weight given by $w_i = dbeta(f_i, 1, 25)^2$, with $f_i$ the minor allele frequency (MAF) of variant $i$. This default is the same as used by the SKAT package. This vector is used as the diagonal of the $m \times m$ matrix $W$, with $m$ the number of variants.

Value

Matrix with genotype weights.

Details

If the weights parameter (a numeric vector) is given, this function will return a matrix with that vector as the diagonal. If the weights parameter is not given (equal to NULL) the genotype weights will be calculated using the beta distribution (see the explanation of the weights parameter).