In [1]:
srand(314)
using(Distributions)
d = Binomial(2,0.5)
nObs = 10
nMarkers = 100
X = float(rand(d,(nObs,nMarkers)))
α = randn(nMarkers)
a = X*α
stdGen = std(a)
a = a/stdGen
y = a + randn(nObs);
In [2]:
include("../0.deprecated_BR/BR.jl")
Out[2]:
In [3]:
using QTL
In [4]:
input=InputParameters()
input.method = "BayesC"
input.varGenotypic = 1.0
input.varResidual = 1.0
input.probFixed = 0.95
input.chainLength = 50000
input.centering = true
input.outFreq = 5000
input.estimatePi = true
MCMCinfo(input)
In [5]:
beta2=BR.runBR(input,genotype=X,phenotype=y)
Out[5]:
In [6]:
srand(314)
using(Distributions)
d = Binomial(2,0.5)
nObs = 10
nMarkers = 100
X = float(rand(d,(nObs,nMarkers)))
α = randn(nMarkers)
a = X*α
stdGen = std(a)
a = a/stdGen
y = a + randn(nObs);
In [7]:
include("../0.deprecated_oldJWAS/oldJWAS.jl")
using oldJWAS
myOption=Dict()
myOption["run"] = "BayesC"
myOption["seed"] = 123
myOption["chainLength"] = 50000
myOption["probFixed"] = 0.95
myOption["estimatePi"] = "yes"
myOption["estimateScale"] = "no"
myOption["varGenotypic"] = 1
myOption["varResidual"] = 1
output = runJWAS(myOption,X,y)
Out[7]:
In [8]:
beta1=output["posterior mean of marker effects"];
beta1
Out[8]:
In [9]:
[beta1 beta2]
Out[9]:
In [10]:
cor(X*beta1,X*beta2)
Out[10]:
In [11]:
using DataFrames
In [12]:
#writedlm("geno.txt",X)
In [13]:
test=DataFrame(y=y)
Out[13]:
In [14]:
include("../../../MMEModule.jl/src/MMEModule.jl")
Out[14]:
In [15]:
using MMEModule
In [16]:
varRes=1.0
mme = MMEModule.build_model("y = intercept",varRes);
In [17]:
MMEModule.addMarkers(mme,"geno.txt",1.0,header=false,separator='\t');
In [18]:
output=MMEModule.runMCMC(mme,test,chain_length=100000,
printout_frequency=5000,methods="BayesC",Pi=0.95,
estimatePi=true)
Out[18]:
In [19]:
keys(output)
Out[19]:
In [20]:
beta3=output["Posterior Mean of Location Parameters"]
Out[20]:
In [21]:
beta3=output["Posterior Mean of Marker Effects"]
Out[21]:
In [22]:
[beta1 beta2 beta3]
Out[22]:
In [26]:
cor(X*beta2,X*beta1)
Out[26]:
In [27]:
cor(X*beta2,X*beta3)
Out[27]:
In [28]:
using oldJWAS
myOption=Dict()
myOption["run"] = "BayesB"
myOption["seed"] = 123
myOption["chainLength"] = 50000
myOption["probFixed"] = 0.95
myOption["estimatePi"] = "no"
myOption["estimateScale"] = "no"
myOption["varGenotypic"] = 1
myOption["varResidual"] = 1
output = runJWAS(myOption,X,y)
Out[28]:
In [29]:
output2=MMEModule.runMCMC(mme,test,chain_length=100000,
printout_frequency=5000,methods="BayesB",Pi=0.95)
Out[29]:
In [30]:
beta1=output["posterior mean of marker effects"];
beta2=output2["Posterior Mean of Marker Effects"];
In [31]:
cor(beta1,beta2)
Out[31]:
In [32]:
cor(X*beta1,X*beta2)
Out[32]: