multidog_to_g: Converts multidog output to a format usable for seg_multi()...

View source: R/multi.R

multidog_to_gR Documentation

Converts multidog output to a format usable for seg_multi() and multi_lrt()

Description

Converts multidog output to a format usable for seg_multi() and multi_lrt()

Usage

multidog_to_g(
  mout,
  ploidy,
  type = c("off_gl", "all_gl", "off_g", "all_g"),
  p1 = NULL,
  p2 = NULL
)

Arguments

mout

The output of multidog().

ploidy

The ploidy.

type
"off_gl"

Genotype likelihoods of offspring but not parents. This is the typical choice if you used the "f1", "f1pp", "s1", or "s1pp" options when genotyping.

"all_gl"

Genotype likelihoods of offspring and parents. This is only done if you did not use the "f1", "f1pp", "s1", or "s1pp" options when genotyping. If this is the case, then you need to specify which individuals are the parents.

"off_g"

Genotypes, assuming that they are known. You used the "f1", "f1pp", "s1", or "s1pp" option when genotyping.

"all_g"

Genotypes, assuming that they are known. You did not use the "f1", "f1pp", "s1", or "s1pp" option when genotyping. If this is the case, then you need to specify which individuals are the parents.

p1

The first (or only) parent name if using type = "all_gl" or type = "all_g".

p2

The second parent name if using type = "all_gl" or type = "all_g". Omit if you used the "s1" or "s1pp" models when genotyping.

Value

A list with the following elements

g

Either a matrix of counts, where the columns index the genotype and the rows index the loci (type = "all_g" or type = "off_g"). Or an array of genotype (natural) log-likelihoods where the rows index the loci, the columns index the individuals, and the slices index the genotypes (type = "all_gl" or type = "off_gl").

p1

Either a vector of known parental genotypes (type = "off_gl", type = "all_g" or type = "off_g"). Or a matrix of genotype (natural) log-likelihoods where the rows index the loci and the columns index the genotypes (type = "all_gl").

p2

Either a vector of known parental genotypes (type = "off_gl", type = "all_g" or type = "off_g"). Or a matrix of genotype (natural) log-likelihoods where the rows index the loci and the columns index the genotypes (type = "all_gl"). This will be NULL if you (i) used "s1" or "s1pp" models in updog and used either type = "off_g" or type = "off_gl" or (ii) used type = "all_g" or type = "all_gl" and only specified p1 but not p2.

Author(s)

David Gerard

Examples

multidog_to_g(
  mout = ufit,
  ploidy = 4,
  type = "all_g",
  p1 = "indigocrisp",
  p2 = "sweetcrisp")
multidog_to_g(
  mout = ufit,
  ploidy = 4,
  type = "all_gl",
  p1 = "indigocrisp",
  p2 = "sweetcrisp")
multidog_to_g(mout = ufit2, ploidy = 4, type = "off_g")
multidog_to_g(mout = ufit2, ploidy = 4, type = "off_gl")
multidog_to_g(mout = ufit3, ploidy = 4, type = "off_g")
multidog_to_g(mout = ufit3, ploidy = 4, type = "off_gl")



segtest documentation built on July 1, 2025, 1:07 a.m.