使用 pegas 绘制单倍型网络时的突变 step/symbol 大小

Mutation step/symbol size when plotting haplotype networks with pegas

我一直在想办法让代表单倍型网络突变步骤的小圆圈变大。无论出于何种原因,我认为所有正常的方式似乎都不起作用。似乎无论我做什么,符号仍然很小。我错过了什么?

这是示例代码的基本位:

data(woodmouse)
h <- haplotype(woodmouse)
net <- haploNet(h)
plot(net, size=attr(net,"freq")*3,bg=pal,labels=F, fast=F, legend=F, 
      show.mutation=T,threshold=0)
# using scale.ratio = 1, the mutations are visisble
plot(net, size=attr(net,"freq")*3,bg=pal,labels=F, fast=F, legend=F, 
      show.mutation=T,threshold=0,scale.ratio=3)
# but using scale.ratio=3, they get tiny / disappear

您可以在此处看到突变,但如果我将 scale.ratio 设置为更大的值(对我自己的数据的要求),它们基本上就会消失。

我试过将更大的 cex 传递给绘图(不起作用)以及使用 par 全局设置 cex(由于某种原因使整个绘图变小)。

看起来圆圈是随着线缩放的,但我不知道如何控制。有可能吗?我错过了一些很明显的东西吗?

cex 控制字体大小,对图形大小没有帮助。来自 haploNetplot.haploNet 函数的帮助页面:

?haploNet

size: a numeric vector giving the diameter of the circles representing the haplotypes: this is in the same unit than the links and eventually recycled.
scale.ratio: the ratio of the scale of the links representing the number of steps on the scale of the circles representing the haplotypes. It may be needed to give a value greater than one to avoid overlapping circles.

这意味着 links 的大小(圆圈表示单倍型之间的突变)与单倍型的大小相关。要相对放大 link 大小,您需要找到两个参数的合适组合。

set.seed(123)
net <- haploNet(haplotype(woodmouse[sample(15, size = 50, replace = TRUE), ]))

par(mfrow=c(1,2))
plot(net, size=attr(net,"freq"), labels=F, fast=F, legend=F, 
   show.mutation=T, threshold=0, scale.ratio=1)
plot(net, size=attr(net,"freq")*.2, labels=F, fast=F, legend=F, 
   show.mutation=T, threshold=0, scale.ratio=.2)

haploNet 扩大圆圈大小会面临圆圈重叠和可见突变数量不正确的风险。使用可视化的自由裁量权,如果出现问题,请考虑 TCS 软件中的单倍型网络计算,其中未采样的突变显示为垂直条或来自 Fluxus 的 Network 具有比例 link 长度。