In [1]:
using DataFrames,JWAS,JWAS.Datasets
In [2]:
phenofile = Datasets.dataset("testMT","phenotype.txt")
pedfile = Datasets.dataset("testMT","pedigree.txt");
In [3]:
;cat $phenofile
In [4]:
;cat $pedfile
In [5]:
data=readtable(phenofile)
Out[5]:
In [22]:
R = [10.0 2.0
2.0 1.0]
G = [20.0 1.0
1.0 2.0];
In [23]:
model_equations = "BW = intercept + age + sex + Animal;
CW = intercept + age + sex + Animal";
In [24]:
model = build_model(model_equations,R);
In [25]:
set_covariate(model,"age");
In [26]:
ped = get_pedigree(pedfile);
In [27]:
set_random(model,"Animal", ped,G)
In [28]:
out = runMCMC(model,data,chain_length=1000,printout_frequency=500,output_samples_frequency=10);
In [29]:
keys(out)
Out[29]:
In [30]:
out["MCMC samples for residual covariance matrix"]
Out[30]:
In [31]:
phenofile = Datasets.dataset("testMT","maternal.txt")
data=readtable(phenofile)
Out[31]:
In [32]:
model_equations = "BW = intercept + age + sex + Animal+ dam;
CW = intercept + age + sex + Animal";
In [33]:
model = build_model(model_equations,R);
set_covariate(model,"age");
In [34]:
# order is BW:Animal, BW:Dam, CW: Animal
G0 = [5 1 0.1
1 1 0.01
0.1 0.01 0.5]
set_random(model,"Animal dam", ped,G0)
In [35]:
out=runMCMC(model,data,chain_length=1000,printout_frequency=500);
In [36]:
keys(out)
Out[36]: