calc_EG_general: More general function to calculate the conditional expected...

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}). It is called from generate_seqdata.

Usage

1
calc_EG_general(M, p, rdv)

Arguments

M

genotype likelihoods with dimension of number of sample by 3 (double), each column is the genotype likelihood P(D_{ij}|G=AA, Aa\ or\ aa) for one locus; uses output from calc_pobs_ndepth for simulation data.

p

genotype frequencies P(G=AA, Aa\ or\ aa) for each variant; output from function calc_EM.

rdv

read depth for all samples, should be a vector of integer with length equal to number of samples.

Value

a vector of containing conditional expected genotype probability. Length should be the same as rdv.


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