# Linear Models for the Prediction of Animal Breeding Values, 3rd Edition.

# Raphael Mrode

# Example 11.2 p183

간단한 설명은 다음 포스팅을 참고한다.

2020/12/19 - [Animal Breeding/R for Genetic Evaluation] - Mixed Linear Model(SNP-BLUP Model) for Computing SNP Effects, unweighted analysis

 

Mixed Linear Model for Computing SNP Effects(SNP-BLUP Model), unweighted analysis

# Linear Models for the Prediction of Animal Breeding Values, 3rd Edition. # Raphael Mrode # Example 11.2 p183 SNP effect를 임의 효과로 다루어 SNP effect를 추정한다. 각 SNP effect의..

bhpark.tistory.com

Data

13 0 0 1 558 9 0.00179211 1.3571429 -0.3571429 0.2857143 0.2857143 -0.2857143 -1.2142857 -0.1428571 0.07142857 -0.1428571 1.2142857
14 0 0 1 722 13.4 0.00138504 0.3571429 -0.3571429 -0.7142857 -0.7142857 -0.2857143 0.7857143 -0.1428571 0.07142857 -0.1428571 -0.7857143
15 13 4 1 300 12.7 0.00333333 0.3571429 0.6428571 1.2857143 0.2857143 0.7142857 -1.2142857 -0.1428571 0.07142857 -0.1428571 1.2142857
16 15 2 1 73 15.4 0.01369863 -0.6428571 -0.3571429 1.2857143 0.2857143 -0.2857143 -0.2142857 -0.1428571 0.07142857 0.8571429 0.2142857
17 15 5 1 52 5.9 0.01923077 -0.6428571 0.6428571 0.2857143 1.2857143 -0.2857143 -1.2142857 -0.1428571 0.07142857 -0.1428571 1.2142857
18 14 6 1 87 7.7 0.01149425 0.3571429 0.6428571 -0.7142857 0.2857143 -0.2857143 0.7857143 -0.1428571 0.07142857 0.8571429 0.2142857
19 14 9 1 64 10.2 0.01562500 -0.6428571 -0.3571429 0.2857143 0.2857143 -0.2857143 0.7857143 -0.1428571 0.07142857 0.8571429 -0.7857143
20 14 9 1 103 4.8 0.00970874 -0.6428571 0.6428571 0.2857143 -0.7142857 -0.2857143 -0.2142857 -0.1428571 0.07142857 0.8571429 -0.7857143

1 ~ 3 : animal, sire, dam

4 : general mean

5 : EDC(using weight)

6 : Fat DYD

7 : EDC 역수

8 - 17 : SNP1 ~ SNP10의 coding하고 평균을 0으로 scaling한 값

(7 - 17 컬럼은 원래의 자료에서 계산을 하여 입력하여야 한다.)

* 계산 방법은 위 포스팅을 참고

 

Renumf90 Parameter File

# Parameter file for program renf90; it is translated to parameter
# file for BLUPF90 family programs.
DATAFILE
snp_data2.txt
TRAITS
6
FIELDS_PASSED TO OUTPUT
 
WEIGHT(S)
7
RESIDUAL_VARIANCE
245
EFFECT
4 cross alpha
EFFECT
4 cross alpha
RANDOM
diagonal
RANDOM_REGRESSION
data
RR_POSITION
8 9 10 11 12 13 14 15 16 17
(CO)VARIANCES
9.96 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 9.96 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 9.96 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 9.96 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 9.96 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 9.96 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 9.96 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 9.96 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 9.96 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 9.96
OPTION solv_method FSPAK

 

가중치로 7열을 주었다.

나머지는 설명은 다음 포스팅 참조

2020/12/19 - [Animal Breeding/BLUPF90] - blupf90으로 Mixed Linear Model(SNP-BLUP Model) for Computing SNP Effects(unweighted analysis) 풀기

 

blupf90으로 Mixed Linear Model(SNP-BLUP Model) for Computing SNP Effects(unweighted analysis) 풀기

# Linear Models for the Prediction of Animal Breeding Values, 3rd Edition. # Raphael Mrode # Example 11.2 p183 간단한 설명은 다음 포스팅을 참고한다. 2020/12/19 - [Animal Breeding/R f..

bhpark.tistory.com

 

Renumf90 실행 화면

 

renumf90 실행 로그

 RENUMF90 version 1.145
 renumf90_snpblup_snp_w.par
 datafile:snp_data2.txt
 traits:           6
 R
   245.0    

 Processing effect  1 of type cross     
 item_kind=alpha     

 Processing effect  2 of type cross     
 item_kind=alpha     
 Reading (CO)VARIANCES:          10 x          10

 Maximum size of character fields: 20

 Maximum size of record (max_string_readline): 800

 Maximum number of fields for input file (max_field_readline): 100

 Pedigree search method (ped_search): convention

 Order of pedigree animals (animal_order): default

 Order of UPG (upg_order): default

 Missing observation code (missing): 0

 hash tables for effects set up
 first 3 lines of the data file (up to 70 characters)
    13 0 0 1 558 9 0.00179211 1.3571429 -0.3571429 0.2857143 0.2857143 -0.
    14 0 0 1 722 13.4 0.00138504 0.3571429 -0.3571429 -0.7142857 -0.714285
    15 13 4 1 300 12.7 0.00333333 0.3571429 0.6428571 1.2857143 0.2857143
 read            8  records
 table with            1  elements sorted
 added count
 Effect group            1  of column            1  with            1  levels
 table expanded from        10000  to        10000  records
 table with            1  elements sorted
 added count
 Effect group            2  of column            1  with            1  levels
 table expanded from        10000  to        10000  records
 wrote statistics in file "renf90.tables"

 Basic statistics for input data  (missing value code is '0')
 Pos  Min         Max         Mean        SD                 N
   6    4.8000      15.400      9.8875      3.7434           8

 random effect   2
 type:diag      

 Wrote parameter file "renf90.par"
 Wrote renumbered data "renf90.dat" 8 records

 

renumf90 실행 결과로 생성된 파일

renf90.dat

 9 0.00179211 1.3571429 -0.3571429 0.2857143 0.2857143 -0.2857143 -1.2142857 -0.1428571 0.07142857 -0.1428571 1.2142857 1 1
 13.4 0.00138504 0.3571429 -0.3571429 -0.7142857 -0.7142857 -0.2857143 0.7857143 -0.1428571 0.07142857 -0.1428571 -0.7857143 1 1
 12.7 0.00333333 0.3571429 0.6428571 1.2857143 0.2857143 0.7142857 -1.2142857 -0.1428571 0.07142857 -0.1428571 1.2142857 1 1
 15.4 0.01369863 -0.6428571 -0.3571429 1.2857143 0.2857143 -0.2857143 -0.2142857 -0.1428571 0.07142857 0.8571429 0.2142857 1 1
 5.9 0.01923077 -0.6428571 0.6428571 0.2857143 1.2857143 -0.2857143 -1.2142857 -0.1428571 0.07142857 -0.1428571 1.2142857 1 1
 7.7 0.01149425 0.3571429 0.6428571 -0.7142857 0.2857143 -0.2857143 0.7857143 -0.1428571 0.07142857 0.8571429 0.2142857 1 1
 10.2 0.01562500 -0.6428571 -0.3571429 0.2857143 0.2857143 -0.2857143 0.7857143 -0.1428571 0.07142857 0.8571429 -0.7857143 1 1
 4.8 0.00970874 -0.6428571 0.6428571 0.2857143 -0.7142857 -0.2857143 -0.2142857 -0.1428571 0.07142857 0.8571429 -0.7857143 1 1

 

renf90.par

# BLUPF90 parameter file created by RENUMF90
DATAFILE
 renf90.dat
NUMBER_OF_TRAITS
           1
NUMBER_OF_EFFECTS
          11
OBSERVATION(S)
    1
WEIGHT(S)
           2
EFFECTS: POSITIONS_IN_DATAFILE NUMBER_OF_LEVELS TYPE_OF_EFFECT[EFFECT NESTED]
 13         1 cross 
 3          1 cov 14
 4          1 cov 14
 5          1 cov 14
 6          1 cov 14
 7          1 cov 14
 8          1 cov 14
 9          1 cov 14
 10          1 cov 14
 11          1 cov 14
 12          1 cov 14
RANDOM_RESIDUAL VALUES
   245.00    
 RANDOM_GROUP
     2     3     4     5     6     7     8     9    10    11
 RANDOM_TYPE
 diagonal     
 FILE
                                                                                
(CO)VARIANCES
   9.9600       0.0000       0.0000       0.0000       0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000    
   0.0000       9.9600       0.0000       0.0000       0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000    
   0.0000       0.0000       9.9600       0.0000       0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000       9.9600       0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000       0.0000       9.9600       0.0000       0.0000    
   0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000       0.0000       0.0000       9.9600       0.0000    
   0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000       0.0000       0.0000       0.0000       9.9600    
   0.0000       0.0000       0.0000    
   0.0000       0.0000       0.0000       0.0000       0.0000       0.0000       0.0000    
   9.9600       0.0000       0.0000    
   0.0000       0.0000       0.0000       0.0000       0.0000       0.0000       0.0000    
   0.0000       9.9600       0.0000    
   0.0000       0.0000       0.0000       0.0000       0.0000       0.0000       0.0000    
   0.0000       0.0000       9.9600    
OPTION solv_method FSPAK

 

가중치 열이 2열로 재배치.

 

위에서 생성된 renf90.dat와 renf90.par를 이용하여 blupf90 실행

blupf90 실행 화면

 

blupf90 실행 로그

renf90.par
     BLUPF90 ver. 1.68

 Parameter file:             renf90.par
 Data file:                  renf90.dat
 Number of Traits             1
 Number of Effects           11
 Position of Observations      1
 Position of Weight (1)        2
 Value of Missing Trait/Observation           0

EFFECTS
 #  type                position (2)        levels   [positions for nested]
    1  cross-classified      13         1
    2  covariable             3         1    14
    3  covariable             4         1    14
    4  covariable             5         1    14
    5  covariable             6         1    14
    6  covariable             7         1    14
    7  covariable             8         1    14
    8  covariable             9         1    14
    9  covariable            10         1    14
   10  covariable            11         1    14
   11  covariable            12         1    14

 Residual (co)variance Matrix
  245.00    

 correlated random effects     2  3  4  5  6  7  8  9 10 11
 Type of Random Effect:      diagonal
 trait   effect    (CO)VARIANCES
  1       2     9.960       0.000       0.000       0.000       0.000       0.000       0.000       0.000       0.000       0.000    
  1       3     0.000       9.960       0.000       0.000       0.000       0.000       0.000       0.000       0.000       0.000    
  1       4     0.000       0.000       9.960       0.000       0.000       0.000       0.000       0.000       0.000       0.000    
  1       5     0.000       0.000       0.000       9.960       0.000       0.000       0.000       0.000       0.000       0.000    
  1       6     0.000       0.000       0.000       0.000       9.960       0.000       0.000       0.000       0.000       0.000    
  1       7     0.000       0.000       0.000       0.000       0.000       9.960       0.000       0.000       0.000       0.000    
  1       8     0.000       0.000       0.000       0.000       0.000       0.000       9.960       0.000       0.000       0.000    
  1       9     0.000       0.000       0.000       0.000       0.000       0.000       0.000       9.960       0.000       0.000    
  1      10     0.000       0.000       0.000       0.000       0.000       0.000       0.000       0.000       9.960       0.000    
  1      11     0.000       0.000       0.000       0.000       0.000       0.000       0.000       0.000       0.000       9.960    

 REMARKS
  (1) Weight position 0 means no weights utilized
  (2) Effect positions of 0 for some effects and traits means that such
      effects are missing for specified traits
 

 * The limited number of OpenMP threads = 4

 * solving method (default=PCG):FSPAK               
 
 Data record length =           14
 # equations =           11
 G
  9.9600      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000    
  0.0000    
  0.0000      9.9600      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000    
  0.0000    
  0.0000      0.0000      9.9600      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000    
  0.0000    
  0.0000      0.0000      0.0000      9.9600      0.0000      0.0000      0.0000      0.0000      0.0000    
  0.0000    
  0.0000      0.0000      0.0000      0.0000      9.9600      0.0000      0.0000      0.0000      0.0000    
  0.0000    
  0.0000      0.0000      0.0000      0.0000      0.0000      9.9600      0.0000      0.0000      0.0000    
  0.0000    
  0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      9.9600      0.0000      0.0000    
  0.0000    
  0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      9.9600      0.0000    
  0.0000    
  0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      9.9600    
  0.0000    
  0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000      0.0000    
  9.9600    
 read            8  records in   0.1718750      s,                      66 
  nonzeroes
 finished peds in   0.1718750      s,                      66  nonzeroes
 left hand side
      0.0003     -0.0001      0.0001      0.0001      0.0001     -0.0001     -0.0000     -0.0000      0.0000      0.0002      0.0001
     -0.0001      0.1005     -0.0000     -0.0001     -0.0001      0.0000      0.0000      0.0000     -0.0000     -0.0001      0.0000
      0.0001     -0.0000      0.1005     -0.0000      0.0000     -0.0000     -0.0001     -0.0000      0.0000      0.0000      0.0001
      0.0001     -0.0001     -0.0000      0.1006      0.0000     -0.0000     -0.0001     -0.0000      0.0000      0.0001      0.0000
      0.0001     -0.0001      0.0000      0.0000      0.1006     -0.0000     -0.0001     -0.0000      0.0000      0.0000      0.0001
     -0.0001      0.0000     -0.0000     -0.0000     -0.0000      0.1004     -0.0000      0.0000     -0.0000     -0.0000      0.0000
     -0.0000      0.0000     -0.0001     -0.0001     -0.0001     -0.0000      0.1006      0.0000     -0.0000      0.0001     -0.0002
     -0.0000      0.0000     -0.0000     -0.0000     -0.0000      0.0000      0.0000      0.1004     -0.0000     -0.0000     -0.0000
      0.0000     -0.0000      0.0000      0.0000      0.0000     -0.0000     -0.0000     -0.0000      0.1004      0.0000      0.0000
      0.0002     -0.0001      0.0000      0.0001      0.0000     -0.0000      0.0001     -0.0000      0.0000      0.1006     -0.0001
      0.0001      0.0000      0.0001      0.0000      0.0001      0.0000     -0.0002     -0.0000      0.0000     -0.0001      0.1006
 right hand side:
    0.00   -0.00    0.00    0.00    0.00   -0.00   -0.00   -0.00    0.00    0.00
    0.00
 solution:
    9.12    0.00   -0.00    0.00   -0.00    0.00    0.00    0.00   -0.00    0.00
   -0.00
 solutions stored in file: "solutions"

 

blupf90 실행 결과 : solutions

trait/effect level  solution
   1   1         1          9.12441059
   1   2         1          0.00004354
   1   3         1         -0.00440133
   1   4         1          0.00439877
   1   5         1         -0.00104827
   1   6         1          0.00048476
   1   7         1          0.00229456
   1   8         1          0.00000000
   1   9         1         -0.00000000
   1  10         1          0.00179833
   1  11         1         -0.00125139

 

실행 결과가 책과 다른데 이것은 책에서 EDC의 역수가 EDC를 가중치로 주어 방정식을 푼 것으로 보인다. 이 결과를 이용한 DGV 계산은 생략한다.

 

+ Recent posts