obj_wrapp_all: wrapper for 'obj_offspring_weights_reparam'

Description Usage Arguments Author(s)

View source: R/update_all.R

Description

wrapper for obj_offspring_weights_reparam

Usage

1
2
3
4
5
6
7
obj_wrapp_all(parvec, ocounts, osize, weight_vec, ploidy, p1geno, p2geno,
  allele_freq = 0.5, p1counts = NULL, p1size = NULL, p1weight = NULL,
  p2counts = NULL, p2size = NULL, p2weight = NULL, bound_bias = FALSE,
  bound_od = FALSE, update_bias_val = TRUE, update_seq_error = TRUE,
  update_od_param = TRUE, seq_error_mean = -4.7, seq_error_sd = 1,
  bias_val_mean = 0, bias_val_sd = 0.7, model = c("f1", "s1", "hw",
  "uniform"), is_seq_ninf = FALSE)

Arguments

parvec

A vector of three elements, s, ell, and r. We have s = log(bias_val) = log(d), ell = logit(seq_error) = logit(eps), and r = - logit(od_param) = - logit(tau).

ocounts

The observed counts of the refernce allele for each individual.

osize

The observed number of reads for each individuals.

weight_vec

A vector of weights obtained via the E-step.

ploidy

An integer. The ploidy of the species. This is assumed to be the same for each individual.

p1geno

The genotype of parent 1 if model = "f1" or model = "s1".

p2geno

The genotype of parent 2 if model = "f1". This needs to be null if model = "s1"

allele_freq

The allele-frequency if model = "hw"

p1counts

The number of reference alleles observed from parent 1.

p1size

The number of reads observed from parent 1.

p1weight

The posterior probability that parent 1 is not an outlier.

p2counts

The number of reference alleles observed from parent 2.

p2size

The number of reads observed from parent 2.

p2weight

The posterior probability that parent 2 is not an outlier.

bound_bias

A logical. Should we bound the bias parameter parvec[1] by a somewhat arbitrary value (TRUE) or not (FALSE)?

bound_od

A logical. Should we bound the overdisperion parameter parvec[3] by a very small number (TRUE) or not (FALSE). This is mostly because my code for super super small values of parvec[3] can be unstable.

update_bias_val

A logical. Not used. Here for compatability with grad_wrapp_all.

update_seq_error

A logical. Not used. Here for compatability with grad_wrapp_all.

update_od_param

A logical. Not used. Here for compatability with grad_wrapp_all.

seq_error_mean

The mean of the logit-normal prior on the sequencing error rate, which corresponds to parvec[2]. Set seq_error_sd = Inf to have no penalty on the sequencing error rate. The default is -4.7, which roughly corresponds to a mean sequencing error value of 0.009.

seq_error_sd

The standard deviation of the logit-normal prior on the sequencing error rate, which corresponds to parvec[2]. The default is 1, which at three standard deviations is about a sequencing error rate of 0.15.

bias_val_mean

The prior mean on the log of bias_val (corresponding to parvec[1]). Set bias_val_sd = Inf to have no penalty on the bias parameter.

bias_val_sd

The prior standard deviation on the log of bias_val (corresponding to parvec[1]). Set bias_val_sd = Inf to have no penalty on the bias parameter.

model

The model for the genotype distribution. Should we assume an F1 population ("f1"), an S1 population ("s1"), Hardy-Weinberg equilibrium ("hw"), or a uniform distribution ("uniform")?

is_seq_ninf

Hacky way to get around fact that optim won't allow -Inf in par, even if gr will always be zero for that parameter. How dare they not anticipate my unique situation!

Author(s)

David Gerard


dcgerard/updogAlpha documentation built on May 14, 2019, 3:10 a.m.