calc_EG: Function to calculate the conditional expected genotype...

Description Usage Arguments Value

Description

Calculate the conditional expected genotype probability given the observed sequencing data D_{ij} from formula E(P(G_{ij}|D_{ij}))=āˆ‘_{g=0}^2 gP(G_{ij}=g|D_{ij}), where P(G_{ij}=g|D_{ij})=P(D_{ij}|G_{ij}=g)*P(G_{ij}=g)/P(D_{ij}). P(D_{ij}|G_{ij}=g) (input M) is from the VCF file or function calc_pobs_ndepth, p(G_{ij}=g) (input p) is output from function calc_EM. All values for P(G_{ij}=g|D_{ij}) are scaled by P(D_{ij}).

Usage

1
calc_EG(M, p, rdv)

Arguments

M

genotype likelihoods with dimension of number of sample times 3 (double), each column is the genotype likelihood P(D_{ij}|G=AA, Aa\ or\ aa) for one locus. It uses output from get_exp_geno or get_exp_MAF for VCF input.

p

genotype frequencies P(G=AA, Aa\ or\ aa) or p(G=0,1,2\ minor\ allele) for each SNP, it is a vector of length 3 and uses the output from function calc_EM.

rdv

read depth for all samples. Dummy variable in calc_EG, listed here to be consitent with calc_EG_general. It is a vector of integers of one with length equal to the number of samples.

Value

a vector with the same length as rdv, containing conditional expectation probability E(P(G_{ij}|D_{ij})).


Struglab/RVS documentation built on May 9, 2019, 3:11 p.m.