Key options

Genotype formats

The VCF genofile allows to specify multiple genotype formats for each marker. RABBIT assumes that all markers are biallelic; multiallelic markers can be either deleted (delmultiallelic=true) or transformed into biallelic markers by pooling multiple alternative alleles. RABBIT allows three kinds of genotype formats:

  • GT: discrete genotype such as "0/1" for unphased genotypes and "0|1" for phased genotype.
  • AD: allelic depth in form of "r0,r1", where r0 is the number of reads for allele 0 and r1 is the number of reads for allele 1.
  • GP: genotype probability. It can be either in form of "p00, p01, p11", where p00, p01, and p11 denote the probabilities of being genotype "0/0", "0/1", and "1/1", respectively; or in form of "p00, p11" for inbred lines with only two possible homozygous genotypes (model=depmodel for magicimpute).

RABBIT has a keyword argument formatpriority for functions requiring genofile as an argument. Specify formatpriority as a vector of formats with descreasing priorities. To optimize the performance, the default value of formatpriority varies with function.

Functionformatpriority
magicfilter["AD","GT"]
magicmap["GT","AD"]
magicimpute["AD","GT"]
magicreconstruct["GP","AD","GT"]
formatpriority
  • Specify formatpriority like this --formatpriority "[AD, GT]" for running in a command, and formatpriority = ["AD", "GT"] for running in julia REPL.
  • magiccall and magicimpute export both posterior genotype probabilities ("GP") and discrete genotypes ("GT").
  • magicmap performs raw genotype calling for "AD" if skipping magiccall for sequence data. The raw genotype calling assumes a pre-specified error rate, and it performs well for almost homozygous populations, but not for sequence data from heterozygous populations.

Likelihood parameters

Genotype likelihood denotes the probability of observed genotypic data given hidden states and parameters. The parameters include foundererror, offspringerror, baseerror, allelicbias, allelicoverdispersion, and allelicdropout. See the section Statistical Framework.

RABBIT has three keyword arguments likelaram, priorlikeparam, softthreshlikeparam, and threshlikeparam, which have struct types LikeParam, PriorLikeParam, SoftThreshLikeParam, and TreshLikeParam, respectively, and each of the structs has field names for the six likelihood parameters.

LikeParam

MagicBase.LikeParamType
LikeParam

keyword-based struct for the parameters of likelihood function.

LikeParam() is equivalent to LikeParam(foundererror=0.005, offspringerror=nothing, peroffspringerror=0.0, baseerror=0.001, allelicbias=nothing, allelicoverdispersion=nothing, allelicdropout=0.0). The peroffspringerror refers to error rate per offspring, and the other parameters refer to error rate per marker.

If genotype format is not "AD", parameters baseerror, allelicbias, allelicoverdispersion, and allelicdropout are irrelevant.

If model="depmodel", parameters allelicbias, allelicoverdispersion, and allelicdropout are irrelevant.

If there exists keyarg isinfererror and isinfererror = true, the parameters with values being nothing will be inferred and the other parameters will be fixed. If isinfererror = false, LikeParam() is equivalent to LikeParam(foundererror=0.005, offspringerror=0.005, peroffspringerror=0.0, baseerror=0.001, allelicbias=0.5, allelicoverdispersion=0.0, allelicdropout=0.0).

PriorLikeParam

MagicBase.PriorLikeParamType
PriorLikeParam

keyword-based struct for the priors of the likelihood parameters.

Fields

foundererror::Union{Nothing,Distribution} = nothing: prior distribution of founder error rate. If nothing, it is given by Beta(1,1/merr-1) where merr is the mean among markers in the previous iteration.

offspringerror::Union{Nothing,Distribution} = nothing: prior distribution of offspring error rate If nothing, it is given by Beta(1,1/merr-1) where merr is the mean among markers in the previous iteration.

peroffspringerror::Union{Nothing,Distribution} = nothing: prior distribution of error rate per offspring If nothing, it is given by Beta(1,1/merr-1) where merr is the mean among offspring in the previous iteration.

baseerror::Union{Nothing,Distribution} = nothing: prior distribution of sequence base error rate If nothing, it is given by Beta(1,1/merr-1) where merr is the mean among markers in the previous iteration.

allelicbias::Union{Nothing,Distribution} = nothing: prior distribution of allele balance mean. If nothing, it is given by Beta(1.01,1.01).

allelicoverdispersion::Union{Nothing,Distribution} = nothing: prior distribution of allele balance overdispersion If nothing, it is given by Exponential(merr) where merr is the mean among markers in the previous iteration.

allelicdropout::Union{Nothing,Distribution} = nothing: prior distribution of allele dropout rate If nothing, it is given by Beta(1,1/merr-1) where merr is the mean among markers in the previous iteration.

SoftThreshLikeParam

MagicBase.SoftThreshLikeParamType
SoftThreshLikeParam

keyword-based struct for the thresholds of the likelihood parameters. In magiccall and magicimpute, markers with the inferred parameter values being greater than the thresholds will be deleted only if they are also outerliers. In magicimpue, offspring with the inferred parameter values being greater than the thresholds will be excluded only if they are also outerliers.

SoftThreshLikeParam() is equivalent to SoftThreshLikeParam(foundererror=0.025, offspringerror=0.025, peroffspringerror=0.025, baseerror=0.01, allelicbias=0.67, allelicoverdispersion=0.5, allelicdropout=0.01).

ThreshLikeParam

MagicBase.ThreshLikeParamType
ThreshLikeParam

keyword-based struct for the thresholds of the likelihood parameters. In magiccall and magicimpute, markers with the inferred parameter values being greater than the thresholds will be deleted. In magicimpue, offspring with the inferred parameter values being greater than the thresholds will be excluded.

ThreshLikeParam() is equivalent to ThreshLikeParam(foundererror=0.25, offspringerror=0.25, peroffspringerror=0.25, baseerror=0.05, allelicbias=0.9, allelicoverdispersion=1.0, allelicdropout=0.1).