0

我有来自 4 个采样位置的 20 个 DNA 序列,每个位置 5 个。我想使用 R 制作单倍型网络。这是我的脚本

library("ape")
library("pegas")
read.dna("fiksya.fasta", format="fasta") -> Naso
Naso
NasoHaps <- haplotype(Naso)
NasoHaps

NasoNet <- haploNet(NasoHaps)
plot(NasoNet, size=attr(NasoNet,"freq"), scale.ratio = 0.2, cex = 0.5)

ind.hap<-with(
  stack(setNames(attr(NasoHaps, "index"), rownames(NasoHaps))),
  table(hap=ind, pop=rownames(Naso)[values])
  )
ind.hap

hapcol <- c("Padang", "Padang_Pariaman", "Pariaman", "Solok")

plot(NasoNet, size=attr(NasoNet, "freq"), scale.ratio = 0.2, cex = 0.7, labels = TRUE, pie = ind.hap, show.mutation = 1, font = 2,
     fast = TRUE, legend= F, col.link= "blue") 
legend('bottomleft', colnames(ind.hap), 
       col=rainbow(ncol(ind.hap)), text.col=2:5, pch=0, cex=1)

输出是这样的

在此处输入图像描述

我想改变单倍型网络的位置,设置图片的大小(我希望它会比现在更大),并根据自己的喜好改变颜色。

有谁知道该怎么做?请帮我。谢谢你。

4

0 回答 0