./plink --file batch_1.plink --make-bed --out data




for K in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do ./admixture --cv data.bed $K | tee log${K}.out; done

tbl=read.table("data.3.Q")
barplot(t(as.matrix(tbl)), col=rainbow(3),xlab="Individual #",ylab="Ancestry",border=NA)


tbl=read.table("data.6.Q")
barplot(t(as.matrix(tbl)), col=rainbow(3),
xlab="Individual #", ylab="Ancestry", border=NA)

admix <- read.table('data.3.Q')
d <- dist(admix)
h <- hclust(d)
dend <- as.dendrogram(h)
plot(dend)