如何解决 Circos SVG 错误放置文本的问题?

发布于 2024-12-20 17:36:00 字数 1441 浏览 0 评论 0原文

我有以下 Circos 图,我将其渲染为 SVG 文件,然后转换为 PNG,为了便于说明:

Circos diagram

围绕外缘的文本标签的方向正确,从 12 点钟到 9 点钟点钟方向,向外,远离灰色弧线。

在 9 和 12 之间,文本标签向内,与灰色弧线重叠。这是预料之外的。

这是一个特写镜头,用于澄清问题:

在此处输入图像描述

如果我从 Circos 输出 PNG,而不是 SVG ,标签绘制正确,但随后我无法在 Adob​​e Illustrator 或 Inkscape 中标记矢量格式的 SVG 图形。所以我需要 SVG 输出。

以下是与添加标签相关的 circos.conf 文件的片段:

<image>
dir = /tmp
file = circos.png
png = yes
radius = 3000p
background = white
angle_offset = -176
</image>

...

<plots>
<plot>
type                           = text
color                          = black
file                           = factorList.txt
r0                             = 1r
r1                             = 1r+200p
label_size                     = 12p
label_font                     = condensedbold
padding                        = 0p
rpadding                       = 0p
label_snuggle                  = yes
max_snuggle_distance           = 1r
snuggle_sampling               = 2
snuggle_tolerance              = 0.25r
snuggle_link_overlap_test      = yes 
snuggle_link_overlap_tolerance = 2p
snuggle_refine                 = yes
</plot>
</plots>

我不确定可以应用哪些其他选项来尝试解决此问题。我的问题是:我应该在这个或另一个配置文件中尝试什么来修复 SVG 输出?谢谢你的建议。

I have the following Circos diagram, which I rendered as an SVG file and then converted to PNG, for the purposes of illustration:

Circos diagram

The text labels that circle the outer rim are oriented correctly from 12 o'clock to 9 o'clock, oriented outwards, away from the grey arcs.

Between 9 and 12, the text labels are oriented inwards, overlapping the grey arc. This is not expected.

Here's a close-up, to clarify the issue:

enter image description here

If I output a PNG from Circos, instead of SVG, the labels are drawn correctly, but then I lose the ability to mark up the vector-formatted SVG figure in Adobe Illustrator or Inkscape. So I need the SVG output.

Here's a snippet of the circos.conf file relevant to the addition of the labels:

<image>
dir = /tmp
file = circos.png
png = yes
radius = 3000p
background = white
angle_offset = -176
</image>

...

<plots>
<plot>
type                           = text
color                          = black
file                           = factorList.txt
r0                             = 1r
r1                             = 1r+200p
label_size                     = 12p
label_font                     = condensedbold
padding                        = 0p
rpadding                       = 0p
label_snuggle                  = yes
max_snuggle_distance           = 1r
snuggle_sampling               = 2
snuggle_tolerance              = 0.25r
snuggle_link_overlap_test      = yes 
snuggle_link_overlap_tolerance = 2p
snuggle_refine                 = yes
</plot>
</plots>

I'm not sure what other options I can apply to try to resolve this. My question is: What should I try in this or another configuration file, which fixes the SVG output? Thanks for your advice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘羡 2024-12-27 17:36:00

也许你可以尝试这个选项:

label_rotate = no

我认为上面的布局是由 snuggle 选项引起的,还要检查你的conf文件并确保plot(type=text)的所有“r0”和“r1”都大于1r。

这是 circos 课程示例

Maybe you can try this option:

label_rotate = no

And I think the layout above caused by the snuggle option ,and also check your conf file and be sure all the "r0" and "r1" of plot(type=text) are bigger than 1r .

Here is the circos lessonss example

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文