Learn R Programming

nprcgenekeepr (version 1.0.5)

calcFG: Calculates Founder Genome Equivalents

Description

Part of the Genetic Value Analysis

Usage

calcFG(ped, alleles)

Arguments

ped

the pedigree information in datatable format. Pedigree (req. fields: id, sire, dam, gen, population). It is assumed that the pedigree has no partial parentage

alleles

dataframe contains an AlleleTable. This is a table of allele information produced by geneDrop().

Value

The founder genome equivalents, FG = 1 / sum( (p ^ 2) / r where p is average number of descendants and r is the mean number of founder alleles retained in the gene dropping experiment.

Examples

Run this code
# NOT RUN {
## Example from Analysis of Founder Representation in Pedigrees: Founder
## Equivalents and Founder Genome Equivalents.
## Zoo Biology 8:111-123, (1989) by Robert C. Lacy

library(nprcgenekeepr)
ped <- data.frame(
id = c("A", "B", "C", "D", "E", "F", "G"),
sire = c(NA, NA, "A", "A", NA, "D", "D"),
dam = c(NA, NA, "B", "B", NA, "E", "E"),
stringsAsFactors = FALSE
)
ped["gen"] <- findGeneration(ped$id, ped$sire, ped$dam)
ped$population <- getGVPopulation(ped, NULL)
pedFactors <- data.frame(
  id = c("A", "B", "C", "D", "E", "F", "G"),
  sire = c(NA, NA, "A", "A", NA, "D", "D"),
  dam = c(NA, NA, "B", "B", NA, "E", "E"),
  stringsAsFactors = TRUE
)
pedFactors["gen"] <- findGeneration(pedFactors$id, pedFactors$sire,
                                    pedFactors$dam)
pedFactors$population <- getGVPopulation(pedFactors, NULL)
alleles <- geneDrop(ped$id, ped$sire, ped$dam, ped$gen, genotype = NULL,
                    n = 5000, updateProgress = NULL)
allelesFactors <- geneDrop(pedFactors$id, pedFactors$sire, pedFactors$dam,
                           pedFactors$gen, genotype = NULL, n = 5000,
                           updateProgress = NULL)
fg <- calcFG(ped, alleles)
fgFactors <- calcFG(pedFactors, allelesFactors)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab