Learn R Programming

ebGenotyping (version 2.0.1)

estep: E step

Description

This function calculates the E step of ECM algorithm for the model described in 'An Empirical Bayes Method for Genotyping and SNP detection Using Multi-sample Next-generation Sequencing Data'.

Usage

estep(mu, delta, pm1, p0, dat, cvg)

Arguments

mu
a vetor of the same length as number of positions: the position effect.
delta
a vetor of the same length as number of samples: the sample effect.
pm1
a single value,which is larger than 0 and less than 1: the probability of RR.
p0
a single value,which is larger than 0 and less than 1: the probability of RV.
dat
a n*m matrix: the ith row, jth column of the matrix represents the non-reference counts of ith sample at jth position.
cvg
a n*m matrix: the ith row, jth column of the matrix represents the depth of ith sample at jth position.

Value

zRR
a n*m matrix: the posterior probabilities of genotype RR for n samples at m positions
zRV
a n*m matrix: the posterior probabilities of genotype RV for n samples at m positions
zVV
a n*m matrix: the posterior probabilities of genotype VV for n samples at m positions

Details

The value of mu and delta must satisfy that each element of outer(delta,mu,"+") must less than zero. This is the requirement of the model described in paper "Genotyping for Rare Variant Detection Using Next-generation Sequencing Data."

References

Na You and Gongyi Huang.(2016) An Empirical Bayes Method for Genotyping and SNP detection Using Multi-sample Next-generation Sequencing Data.