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

Description Usage Arguments Value Examples

View source: R/reportGV.R

Description

This is the main function for the Genetic Value Analysis.

Usage

1
2
3
4
5
6
7
8
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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"]]

rmsharp/nprcmanager documentation built on April 24, 2021, 3:13 p.m.