# BLUPF90

### Site Tools

how_to_fit_haplotype_effects

This is an old revision of the document!

How to include haplotype effects in BLUPF90

Including haplotypic effects is quite complicated because, for each record yi we have two copies of the haplotype (i.e. it is like having two herd effects). However they are logically the same. Most programs are not prepared to having two columns in the data file referring to the same, cross-classified effect.

I have found a way of dealing with this playing with addresses and nested regressions in BLUPf90. This is very similar to the tricks used to fit competitive models. Let’s look at the example:

y = μ + h1 + h2 + t + e

Where h is an haplotypic effect (3 levels) and t is a cross-classified effect (5 levels). I have prepared a small example.

106 1 1 0 1 1   1 2 3
111 1 1 1 0 1   1 2 3
108 1 1 0 1 3   1 2 3
113 1 1 1 0 3   1 2 3
91  1 0 0 2 1   1 2 3
99  1 0 1 1 4   1 2 3
98  1 0 1 1 3   1 2 3
115 1 1 1 0 5   1 2 3
113 1 1 1 0 3   1 2 3
93  1 0 0 2 3   1 2 3

The first column is y, the second µ, 3rd-5th is the number of copies of the haplotype of interest, the 6th column is the effect t with 5 levels. The “1 2 3” indicate which is the haplotype associated to the number of copies in 3rd-5th columns. Note, for instance, that the 5th record has 2 copies of the third haplotype. The par file is thus:

DATAFILE
data
NUMBER_OF_TRAITS
1
NUMBER_OF_EFFECTS
5
OBSERVATION(S)
1
WEIGHT(S)
EFFECTS: POSITIONS_IN_DATAFILE NUMBER_OF_LEVELS TYPE_OF_EFFECT[EFFECT NESTED]
2 1 cross
3 0 cov 7
4 0 cov 8
5 3 cov 9
6 5 cross
RANDOM_RESIDUAL VALUES
1

So, what we do is, first, indicate to which level of the haplotype effect the covariable in the 3rd-4th column refers to (7-9). Second, to put a number of levels of “0” in all but the last level of the haplotype, so that we cheat the function address and it does not realise that this is another effect (technically we produce an “offset” of 0). We could even make this effect random (as in competition effect models), as follows:

EFFECTS: POSITIONS_IN_DATAFILE NUMBER_OF_LEVELS TYPE_OF_EFFECT[EFFECT NESTED]
# mean
2       1 cross
# triple
3 0 cov 7
4 0 cov 8
5 3 cov 9
# cinco
6 5 cross
RANDOM_RESIDUAL VALUES
1
RANDOM_GROUP
4
RANDOM_TYPE
diagonal
FILE

(CO)VARIANCES
1

This remains to be tested…

how_to_fit_haplotype_effects.1337075342.txt.gz · Last modified: 2012/05/15 09:49 by andres