如何将 clusterw .dnd 文件转换为图像(png)文件?

Ari*_*nda 1 bioinformatics

我正在尝试从 dnd 文件创建 png 图像,以便更好地理解 dnd 文件。我见过一些将 dnd 文件转换为图像格式的软件,我有大约 2000 个 dnd 文件,我想将这些文件转换为图像文件以便更好地理解

是否可以从 clusterw dnd 文件创建系统发育树图像?

dnd 文件的一个示例如下所示:

(
(
A:0.336889,
(
(
B:0.204161,
(
(
(
C:0.112841,
(
D:0.0605849,
E:0.0605849):0.112841):0.133598,
(
F:0.0946236,
G:0.0946236):0.133598):0.148107,
H:0.148107):0.204161):0.285724,
I:0.285724):0.336889):0.338734,
J:0.338734):0.338734;
Run Code Online (Sandbox Code Playgroud)

Jos*_* M. 5

你可以在R中使用ape库,dnd文件是Newick格式的一种

install.packages("ape")

library(ape)
MyTree <- read.tree("my_file.dnd")
png("my_file.png")
plot(MyTree)
dev.off()
Run Code Online (Sandbox Code Playgroud)

你得到:

系统发育树

或者,如果您更喜欢使用phytools 库,请注意:在此之前,您必须首先删除输入文件的换行符

((A:0.336889,((B:0.204161,(((C:0.112841,(D:0.0605849,E:0.0605849):0.112841):0.133598,(F:0.0946236,G:0.0946236):0.133598):0.1 48107,H :0.148107):0.204161):0.285724,I:0.285724):0.336889):0.338734,J:0.338734):0.338734;
install.packages("phytools")

library(phytools)
MyTree <- read.newick("my_file.dnd")
png("my_file2.png")
plot(MyTree)
dev.off()
Run Code Online (Sandbox Code Playgroud)

你得到

系统发育树2