model{
# AAF part
for (i in 1:nSNP){
#likelihood
z[i] ~ dbetabin(a[mixture[i]],b[mixture[i]],N[i])
mixture[i] ~ dcat(p[1:Nclust])
}

#prior
a[1] <- mu*kappa
b[1] <- (1-mu)*kappa
mu <- m 
kappa ~ dgamma(1,0.1)
a[2] <- 1
b[2] <- 1
p[1] <- 0.99
p[2] <- 0.01

# coverage part
for (i in 1:nSites){
# likelihood
N_cov[i] ~ dnegbin(p_cov,r_cov)
}
#prior
p_cov <- r_cov/(r_cov+m_cov)
r_cov ~ dgamma(0.01,0.01)
m_cov <- m0
}
