!MX script for a univariate X chromosome QTL model from Chapter 11 #loop $file 1 11 1 #define maxsib 8 !largest sibship in this case 8 X-chromsome linkage script !the coefficient of X chromosome relatedness is automatically computed using !the sex of the siblings !complete random inactivation is assumed Calc NGroups=2 Begin Matrices ; ! Path Coefficients A full 1 1 free ! Shared Additive genetic residual B full 1 1 free ! Male X Residual C full 1 1 free ! Male X QTL D full 1 1 free ! Male Non-Shared residual E full 1 1 free ! Female Non-Shared residual H full 1 1 ! to contain .5 End Matrices ; Ma H .5 Begin Algebra ; !Variance Components F=A*A'; ! Shared Additive genetic residual G=B*B'; ! Male X Residual I=C*C'; ! Male X QTL J=D*D'; ! Male Non-Shared residual K=E*E'; ! Female Non-Shared residual L=H.B; ! Female QTL PC M=H.C; ! Female X Residual PC N=L*L'; ! Female X Residual O=M*M'; ! Female X QTL P=L*B'; ! OS X Residual Q=M*C'; ! OS X QTL End Algebra ; !some starting values Start .3 A 1 1 Start .6 D 1 1 E 1 1 Start .2 B 1 1 End DZ Data Group Data NI=53 Missing=-9.00 Rec File =x$file`.dat Labels fam phen1 phen2 phen3 phen4 phen5 phen6 phen7 phen8 age1 age2 age3 age4 age5 age6 age7 age8 sex1 sex2 sex3 sex4 sex5 sex6 sex7 sex8 p12 p13 p14 p15 p16 p17 p18 p23 p24 p25 p26 p27 p28 p34 p35 p36 p37 p38 p45 p46 p47 p48 p56 p57 p58 p67 p68 p78 Select phen1 phen2 phen3 phen4 phen5 phen6 phen7 phen8 age1 age2 age3 age4 age5 age6 age7 age8 sex1 sex2 sex3 sex4 sex5 sex6 sex7 sex8 p12 p13 p14 p15 p16 p17 p18 p23 p24 p25 p26 p27 p28 p34 p35 p36 p37 p38 p45 p46 p47 p48 p56 p57 p58 p67 p68 p78 ; Defintion_variables age1 age2 age3 age4 age5 age6 age7 age8 sex1 sex2 sex3 sex4 sex5 sex6 sex7 sex8 p12 p13 p14 p15 p16 p17 p18 p23 p24 p25 p26 p27 p28 p34 p35 p36 p37 p38 p45 p46 p47 p48 p56 p57 p58 p67 p68 p78 ; Begin Matrices ; B Stand maxsib maxsib ! pihats ! Precomputed Variance Components C Computed 1 1 =F1 ! Shared Additive genetic residual D Computed 1 1 =G1 ! Male X Residual E Computed 1 1 =I1 ! Male X QTL F Computed 1 1 =J1 ! Male Non-Shared residual G Computed 1 1 =K1 ! Female Non-Shared residual H Computed 1 1 =N1 ! Female X Residual I Computed 1 1 =O1 ! Female X QTL J Computed 1 1 =P1 ! OS X Residual K Computed 1 1 =Q1 ! OS X QTL ! Means L Full 1 2 free ! Beta Age Sex M Full 1 1 free ! Means N Full 1 maxsib ! Age ! To compute sex-pair Coefficients S Full 1 maxsib ! Sex M=1 F=0 U Unit 1 maxsib ! to make Sex M=0 F=1 T Stand maxsib maxsib ! .5 on off diagonals - also used for Shared A residual V Stand maxsib maxsib ! .75 on off diagonals End Matrices; Specify B p12 p13 p23 p14 p24 p34 p15 p25 p35 p45 p16 p26 p36 p46 p56 p17 p27 p37 p47 p57 p67 p18 p28 p38 p48 p58 p68 p78 ; Specify S sex1 sex2 sex3 sex4 sex5 sex6 sex7 sex8 Specify N age1 age2 age3 age4 age5 age6 age7 age8 Value .5 T 2 1 - T maxsib 7 Value .75 V 2 1 - V maxsib 7 Start 3 m 1 1 Begin Algebra ; O = U-S ; ! Sex M=0 F=1 P = S'*S ; ! Male pair coefficients Q = O'*O ; ! Female pair coefficents R = S'*O ; ! OS pair coefficents End Algebra ; Means M@U+(L*(N_S)); Covariances (C@T) + (F@(\v2d(S))+G@(\v2d(O))) + ! Shared and Non-Shared Residuals (((D@P).T)+((J@R).T)+((H@Q).V)) + ! X Residual adjusted for sex-pairing (B.((E@P)+(K@R)+(I@Q))) ; ! X QTL adjusted for sex-pairings Exit #End Loop