> ped = asreml.read.table('ped.csv',header=T,sep=',') > head(ped) ID Sire Dam 1 1 0 0 2 2 0 0 3 3 0 0 4 4 0 0 5 5 0 0 6 6 0 0 > dat = asreml.read.table('phe.csv',sep=',',header=T) > head(dat) ID Sire Dam Fam Changdi Sex phe 1 61 1 54 1_54 A M 196.8497 2 62 1 54 1_54 A M 178.1221 3 63 1 54 1_54 A M 163.6030 4 64 1 54 1_54 A M 226.2328 5 65 1 54 1_54 A F 215.7228 6 66 1 54 1_54 A M 153.7567
「整理数据,变为多性状模型的数据格式:」
> dat$phe_A = dat$phe > dat$phe_B = dat$phe > dat[dat$Changdi == 'A',]$phe_B = NA > dat[dat$Changdi == 'B',]$phe_A = NA > head(dat) ID Sire Dam Fam Changdi Sex phe phe_A phe_B 1 61 1 54 1_54 A M 196.8497 196.8497 NA 2 62 1 54 1_54 A M 178.1221 178.1221 NA 3 63 1 54 1_54 A M 163.6030 163.6030 NA 4 64 1 54 1_54 A M 226.2328 226.2328 NA 5 65 1 54 1_54 A F 215.7228 215.7228 NA 6 66 1 54 1_54 A M 153.7567 153.7567 NA > tail(dat) ID Sire Dam Fam Changdi Sex phe phe_A phe_B 14995 15055 5609 5207 5609_5207 B M 253.1178 NA 253.1178 14996 15056 5609 5207 5609_5207 B M 229.0524 NA 229.0524 14997 15057 5609 5207 5609_5207 B F 247.3232 NA 247.3232 14998 15058 5609 5207 5609_5207 B M 285.1402 NA 285.1402 14999 15059 5609 5207 5609_5207 B M 243.7538 NA 243.7538 15000 15060 5609 5207 5609_5207 B F 243.6527 NA 243.6527
> summary(mod3)$varcomp component std.error z.ratio bound %ch trait:vm(ID, ainv)!trait_phe_A:phe_A 327.89751 50.53725 6.488234 P 0.1 trait:vm(ID, ainv)!trait_phe_B:phe_A 0.00001 NA NA F 0.0 trait:vm(ID, ainv)!trait_phe_B:phe_B 330.40559 49.33407 6.697311 P 0.0 units:trait!R 1.00000 NA NA F 0.0 units:trait!trait_phe_A 524.65267 27.71968 18.927086 P 0.0 units:trait!trait_phe_B 607.18007 27.66161 21.950282 P 0.0 > vpredict(mod3,rg ~ V2/sqrt(V1*V3)) Estimate SE rg 3.038136e-08 3.259792e-09