Post processing
Introduction
ASReml includes a post-analysis procedure to calculate functions of
variance components. Its intended use is when the variance components
are either simple variances or are variances
and covariances in an unstructured matrix.
The functions covered are linear combinations of
the variance components (for example, phenotypic variance), a ratio of
two components (for example, heritabilities) and the correlation based
on three components (for example, genetic correlation). The user must
prepare a .pin file. For example
F phenvar 1 + 2 # pheno variance
F genvar 1 * 4 # geno var
H heritability 4 3 # heritability
The .pin file specifies the
functions to be calculated.
The .pin file is run as an independent process either
in the same run of ASReml (ASReml 3 only) or as a subsequent
run of ASReml.
In that process, ASReml reads
the model information from the .asr
and .vvp files and
calculates the requested functions.
These are reported in the .pvc file.
Processing the .pin file as a subsequent run,
the user re-runs ASReml with the -P
command line option specifying the .pin file as the input file.
If the .asr file filename does not match the
.pin file filename,
append the former to the -P option i.e.
ASReml -Pcoopwwt coop.pin
Processing the .pin file within the primary run,
use the VPREDICT
directive.
The calculations are based on the estimated variance parameters
and their variance matrix as represented by the inverse of the
average information matrix. Note that this matrix has zero
values for fixed variance parameters including those near
the parameter space boundary. The algebraic expressions used
are given in the
ASReml User Guide.
Syntax
Functions of the variance components are specified in the .pin file
in lines of the form
letter label coefficients
letter (either
F,
H
or R ) must occur in column 1;
other lines are ignored
F is for linear combinations of variance components,
H is for forming the ratio of two components (a heritability),
R is for forming the correlation based on three components,
label names the result,
coefficients is the list of coefficients for the linear function.
For convenience in preparing
the .pin file,
some users copy the variance component lines from the .asr file
and insert them at the top of the .pin file, being careful
to retain one leading space so that the lines will be just copied
and otherwise ignored as the .pin file is processed.
Combining components
First ASReml extracts the variance components from the .asr file
and their variance matrix from the .vvp file.
Each linear function formed by an F line is added to the list of
components.
Thus, the number of coefficients increases by one each line.
We seek to calculate k + c'v, cov(c'v, v) and var(c'v) where v
is the vector of existing variance components, c is the
vector of coefficients for the linear function and k is an
optional offset which is usually omitted but would be 1 to
represent the residual variance in a probit analysis and 3.289 to
represent the residual variance in a logit analysis.
The general form of the directive is
F label a + b * cb + c + d + m*k
where a,
b,
c
and d are subscripts of existing
components, each with a multiplier ca, cb, cc
and cd (default of 1).
m is one bigger than
the current length of v to flag the special case of
the offset k.
Where matrices are to be combined the form
F label a:b * k + c:d
can be used.
Assuming that the .pin file shown above
corresponds to a simple sire model and that variance component 1
is the sire
and variance component 2 is the residual variance,
F phenvar 1 + 2
forms a third component which is the sum of components 1 and 2,
that is, the phenotypic variance, and
F genvar 1 * 4
forms a fourth component which is the sire variance component
multiplied by 4, that is, the genotypic variance.
Heritability
Heritabilities are requested by lines in the .pin file
beginning with an H. The specific form of the directive in this case is
H label n d
This calculates Vn/Vd and and is standard error
where n and d are integers
pointing to components Vn
and Vd that are to be used as the
numerator and denominator respectively in the heritability calculation.
The expression used is given in the User Guide.
In the example
H heritability 4 3
calculates the heritability by calculating component 4 (from second line
of .pin) / component 3
(from first line of .pin), that is,
genetic variance / phenotypic variance.
Correlation
Correlations are requested by lines in the .pin file
beginning with an R. The specific form of the directive is
R label a ab b
This calculates the correlation r = Vab / SQRT(Va * Vb)
and the associated standard
a, b and ab are
integers indicating the position
of the components to be used.
Alternatively,
R label a:n
calculates the correlation all correlations in the
lower triangular row-wise matrix represented by components a to
n and the associated standard errors. Thus from a bivariate animal model
Components 1:3 constitute the residual matrix
Components 4:6 constitute the genetic matrix
F phenvar 1:3 + 4:6
R phencorr 7 8 9
R gencorr 4:6
might be the .pin file used. Note the two leading comment lines
a leading space.
R phencor 7 8 9
calculates the phenotypic correlation by dividing component 8
by the square roots of components 7 and 9 where components 7, 8 and
9 are created with the 'phenvar'
line of the .pin file, and
R gencor 4:6
calculates the genotypic covariance by dividing component 5
by the square roots of components 4 and 6 where components 4,
5 and 6 are variance components from the analysis.
A more detailed example
Bivariate sire model
sire !I
ywt fat
bsiremod.asd
ywt fat ~ Trait !r Trait.sire
1 2 1
0 # ASReml will count units
Trait 0 US
3*0
Trait.sire 2
Trait 0 US !GP
3*0
sire
The following sample .pin file is a little more complicated.
It relates to the preceding bivariate sire model.
Residual UnStruct 1 26.2197 26.2197 18.01 0 U
Residual UnStruct 1 2.85090 2.85090 9.55 0 U
Residual UnStruct 2 1.71556 1.71556 18.00 0 U
Tr.sire UnStruct 1 16.5262 16.5262 2.69 0 U
Tr.sire UnStruct 1 1.14422 1.14422 1.94 0 U
Tr.sire UnStruct 2 0.132847 0.132847 1.88 0 U
F phenvar 1:3 + 4:6
F addvar 4:6 * 4
H heritA 10 7
H heritB 12 9
R phencorr 7 8 9
R gencor 4:6
The first six lines displays variance component table from the {\tt.asr}
on which the .pin file is based.
1 Residual UnStruct 1 26.2197 26.2197 18.01 0 U
2 Residual UnStruct 1 2.85090 2.85090 9.55 0 U
3 Residual UnStruct 2 1.71556 1.71556 18.00 0 U
4 Tr.sire UnStruct 1 16.5262 16.5262 2.69 0 U
5 Tr.sire UnStruct 1 1.14422 1.14422 1.94 0 U
6 Tr.sire UnStruct 2 0.132847 0.132847 1.88 0 U
7 phenvar 1 42.75 6.297
8 phenvar 2 3.995 0.6761
9 phenvar 3 1.848 0.1183
10 addvar 4 66.10 24.58
11 addvar 5 4.577 2.354
12 addvar 6 0.5314 0.2831
h2ywt = addvar 10/phenvar 7= 1.5465 0.3571
h2fat = addvar 12/phenvar 9= 0.2875 0.1430
phencorr = phenvar /SQR[phenvar *phenvar ]= 0.4495 0.0483
gencor 2 1 = Tr.si 5/SQR[Tr.si 4*Tr.si 6]= 0.7722 0.1537
Return to start