How can I create more accurate admixture plot like this?
1
0
Entering edit mode
18 months ago
kgwkk2 • 0

enter image description here

enter image description here

I made simple vcf file processing as

plink --vcf Asp_multicall2.vcf.gz --double-id --allow-extra-chr \
--set-missing-var-ids @:# \
--set-missing-var-ids @:# \

for K in 1 2 3 4 5
do
  admixture --cv plink.bed $K | tee log${K}.out
done

As you can see, they grouped six kind of individual strains. But I want to observe every strain individual's result like below. From what stage should I adjust the command? Or suggest me the best way for this kind of data.

admixture vcf plink • 665 views
ADD COMMENT
0
Entering edit mode
18 months ago

Hi there!

There's a way to do this with R. In ADMIXTURE v1.3 manual, they provide an example code for the exact graphic you want.

"The Q estimates are output as a simple matrix, so it is easy to make figures like Figure 1 from our paper using the read.table and plot commands in R. To make the stacked bar-charts that you may have seen elsewhere, use the barplot command. For example, assuming we have the file hapmap3.3.Q to analyze, the following R commands"

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

You can do it also with ggplot2, as shown by Luis Darcy Verde Arregoitia.

ADD COMMENT

Login before adding your answer.

Traffic: 1706 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6