calc_Mr: Function to calcualte likelihood P(D|G) for simulating data,...

Description Usage Arguments Value

Description

This function calculates a likelihood matrix P(D|G) given a vector of error rates and a vector of sequence reads, where D is the sequencing data and G is the true genotype. It uses function calc_psingle to calculate the likelihood for each read given one possible genotype (AA, Aa or aa). It is a more general case of calc_pobs_ndepth with an additional param rdv, and called from generate_seqdata.

Usage

1
calc_Mr(error, vect_row_reads, ndepth = 1, rdv)

Arguments

error

vector of base call error rates; Uses the same error input in the seq_call function but concatenate all error values over all samples.

vect_row_reads

row vector of sequence reads consisting of 'A','G','T' or 'C', same as output from function seq_call, but concatenated over all samples in same fashion as error.

ndepth

read depth (integer), it eaquals to the length of error or vect_row_reads, or sum of vector rdv

rdv

integer vector of read depths concatenated for all samples.

Value

a matrix (M) with 3 columns representing P(read|AA), P(read|Aa) and P(read|aa), where row dimensions equal length(error)=length(vect_row_reads).


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