Learn R Programming

updog (version 1.1.3)

compute_all_log_bb: Calculates the log-density for every individual by snp by dosage level.

Description

Calculates the log-density for every individual by snp by dosage level.

Usage

compute_all_log_bb(refmat, sizemat, ploidy, seq, bias, od)

Arguments

refmat

A matrix of reference counts. The rows index the individuals and the columns index the SNPs.

sizemat

A matrix of total counts. The rows index the individuals and the columns index the SNPs. Should have the same dimensions as refmat.

ploidy

The ploidy of the species. To estimate the ploidy, re-run mupdog at various ploidy levels and choose the one with the largest ELBO. This assumes that the ploidy is the same for all individuals in the sample.

seq

A vector of initial sequencing errors. Should be the same length as the number of columns of refmat (number of SNPs). Must be between 0 and 1.

bias

A vector of initial bias parameters. Should be the same length as the number of columns of refmat (number of SNPs). Must be greater than 0.

od

A vector of initial overdispersion parameters. Should be the same length as the number of columns of refmat (number of SNPs). Must be between 0 and 1.

Value

A three dimensional array. The rows index the individuals, the columns index the SNPs, and the third dimension indexes the genotypes. This is the log-likelihood for each individual/snp/genotype combination.