在r包LEA中的结构图中按Q分数对个人进行分组

时间:2019-04-19 18:51:32

标签: r

我已经使用R中的LEA包完成了对SNP数据的结构分析。但是我具有图形输出,这是一个混乱的混乱,因为个人没有按Q分数排列。有谁知道如何通过Q分数沿x轴对个人进行分组?

output = vcf2geno("kobo.vcf", "kobo.geno")

obj.at = snmf(output, K = 1:10, ploidy = 2, entropy = T,
              CPU = 2, project = "new")

qmatrix = Q(obj.at, K =9)

barplot(t(qmatrix), col = c("orange","red","green" , "blue", "pink", "yellow", "grey", "purple"), border = NA, space = 0,
        xlab = "Individuals", ylab = "Admixture coefficients")

这是我得到的: myresults

但是我想重新排列它,使其看起来像这样:expected results enter image description here

Qmatrix的外观

enter image description here

0 个答案:

没有答案