| AlphaPart {AlphaPart} | R Documentation |
AlphaPart.R
Description
A function to partition breeding values by a path variable. The partition method is described in García-Cortés et al., 2008: Partition of the genetic trend to validate multiple selection decisions. Animal : an international journal of animal bioscience. DOI: doi: 10.1017/S175173110800205X
Usage
AlphaPart(x, pathNA, recode, unknown, sort, verbose, profile,
printProfile, pedType, colId, colFid, colMid, colPath, colBV,
colBy, center, scaleEBV)
Arguments
x |
data.frame , with (at least) the following columns:
individual, father, and mother identif ication, and year of birth;
see arguments |
pathNA |
Logical, set dummy path (to "XXX") where path information is unknown (missing). |
recode |
Logical, internally recode individual, father and,
mother identification to |
unknown |
Value(s) used for representing unknown (missing)
parent in |
sort |
Logical, initially sort |
verbose |
Numeric, print additional information: |
profile |
Logical, collect timings and size of objects. |
printProfile |
Character, print profile info on the fly
( |
pedType |
Character, pedigree type: the most common form is
|
colId |
Numeric or character, position or name of a column holding individual identif ication. |
colFid |
Numeric or character, position or name of a column holding father identif ication. |
colMid |
Numeric or character, position or name of a column
holding mother identif ication or maternal grandparent identif
ication if |
colPath |
Numeric or character, position or name of a column holding path information. |
colBV |
Numeric or character, position(s) or name(s) of column(s) holding breeding Values. |
colBy |
Numeric or character, position or name of a column holding group information (see details). |
center |
Logical, if |
scaleEBV |
a list with two arguments defining whether is
appropriate to center and/or scale the
|
Details
Pedigree in x must be valid in a sense that there
are:
no directed loops (the simplest example is that the individual identification is equal to the identification of a father or mother)
no bisexuality, e.g., fathers most not appear as mothers
father and/or mother can be unknown (missing) - defined with any "code" that is different from existing identifications
Unknown (missing) values for breeding values are propagated down the
pedigree to provide all available values from genetic
evaluation. Another option is to cut pedigree links - set parents to
unknown and remove them from pedigree prior to using this function -
see pedSetBase function. Warning is issued
in the case of unknown (missing) values.
In animal breeding/genetics literature the model with the underlying
pedigree type "IPP" is often called animal model, while the
model for pedigree type "IPG" is often called sire - maternal
grandsire model. With a combination of colFid and
colMid mother - paternal grandsire model can be accomodated as
well.
Argument colBy can be used to directly perform a summary
analysis by group, i.e., summary(AlphaPart(...),
by="group"). See summary.AlphaPart for
more. This can save some CPU time by skipping intermediate
steps. However, only means can be obtained, while summary
method gives more flexibility.
Value
An object of class AlphaPart, which can be used in
further analyses - there is a handy summary method
(summary.AlphaPart works on objects of
AlphaPart class) and a plot method for its output
(plot.summaryAlphaPart works on objects of
summaryAlphaPart class). Class AlphaPart is a
list. The first length(colBV) components (one for each trait
and named with trait label, say trt) are data frames. Each
data.frame contains:
-
xcolumns from initial datax -
trt_paparent average -
trt_wMendelian sampling term -
trt_path1, trt_path2, ...breeding value partitions
The last component of returned object is also a list named
info with the following components holding meta information
about the analysis:
-
pathcolumn name holding path information -
nPnumber of paths -
lPpath labels -
nTnumber of traits -
lTtrait labels -
warnpotential warning messages associated with this object
If colBy!=NULL the resulting object is of a class
summaryAlphaPart, see
summary.AlphaPart for details.
If profile=TRUE, profiling info is printed on screen to spot
any computational bottlenecks.
References
Garcia-Cortes, L. A. et al. (2008) Partition of the genetic trend to validate multiple selection decisions. Animal, 2(6):821-824. doi: 10.1017/S175173110800205X
See Also
summary.AlphaPart for summary
method that works on output of AlphaPart,
pedSetBase for setting base population,
pedFixBirthYear for imputing unknown
(missing) birth years, orderPed in
pedigree package for sorting pedigree
Examples
## Small pedigree with additive genetic (=breeding) values
ped <- data.frame( id=c( 1, 2, 3, 4, 5, 6),
fid=c( 0, 0, 2, 0, 4, 0),
mid=c( 0, 0, 1, 0, 3, 3),
loc=c("A", "B", "A", "B", "A", "A"),
gen=c( 1, 1, 2, 2, 3, 3),
trt1=c(100, 120, 115, 130, 125, 125),
trt2=c(100, 110, 105, 100, 85, 110))
## Partition additive genetic values
tmp <- AlphaPart(x=ped, colBV=c("trt1", "trt2"))
print(tmp)
## Summarize by generation (genetic mean)
summary(tmp, by="gen")
## Summarize by generation (genetic variance)
summary(tmp, by="gen", FUN = var)
## There are also two demos
demo(topic="AlphaPart_deterministic", package="AlphaPart",
ask=interactive())
demo(topic="AlphaPart_stochastic", package="AlphaPart",
ask=interactive())