Learn R Programming

nprcgenekeepr (version 1.0.5)

reportGV: Generates a genetic value report for a provided pedigree.

Description

This is the main function for the Genetic Value Analysis.

Usage

reportGV(
  ped,
  guIter = 5000,
  guThresh = 1,
  pop = NULL,
  byID = TRUE,
  updateProgress = NULL
)

Arguments

ped

The pedigree information in data.frame format

guIter

Integer indicating the number of iterations for the gene-drop analysis. Default is 5000 iterations

guThresh

Integer indicating the threshold number of animals for defining a unique allele. Default considers an allele "unique" if it is found in only 1 animal.

pop

Character vector with animal IDs to consider as the population of interest. The default is NULL.

byID

Logical variable of length 1 that is passed through to eventually be used by alleleFreq(), which calculates the count of each allele in the provided vector. If byID is TRUE and ids are provided, the function will only count the unique alleles for an individual (homozygous alleles will be counted as 1).

updateProgress

Function or NULL. If this function is defined, it will be called during each iteration to update a shiny::Progress object.

Value

A dataframe with the genetic value report. Animals are ranked in order of descending value.

Examples

Run this code
# NOT RUN {
library(nprcgenekeepr)
examplePedigree <- nprcgenekeepr::examplePedigree
breederPed <- qcStudbook(examplePedigree, minParentAge = 2,
                         reportChanges = FALSE,
                         reportErrors = FALSE)
focalAnimals <- breederPed$id[!(is.na(breederPed$sire) &
                                  is.na(breederPed$dam)) &
                                is.na(breederPed$exit)]
ped <- setPopulation(ped = breederPed, ids = focalAnimals)
trimmedPed <- trimPedigree(focalAnimals, breederPed)
probands <- ped$id[ped$population]
ped <- trimPedigree(probands, ped, removeUninformative = FALSE,
                    addBackParents = FALSE)
geneticValue <- reportGV(ped, guIter = 50, # should be >= 1000
                         guThresh = 3,
                         byID = TRUE,
                         updateProgress = NULL)
trimmedGeneticValue <- reportGV(trimmedPed, guIter = 50, # should be >= 1000
                                guThresh = 3,
                                byID = TRUE,
                                updateProgress = NULL)
rpt <- trimmedGeneticValue[["report"]]
kmat <- trimmedGeneticValue[["kinship"]]
f <- trimmedGeneticValue[["total"]]
mf <- trimmedGeneticValue[["maleFounders"]]
ff <- trimmedGeneticValue[["femaleFounders"]]
nmf <- trimmedGeneticValue[["nMaleFounders"]]
nff <- trimmedGeneticValue[["nFemaleFounders"]]
fe <- trimmedGeneticValue[["fe"]]
fg <- trimmedGeneticValue[["fg"]]
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab