Reputation: 1665
I am trying to create png images from dnd file for better understanding of dnd file.I have seen some software which convert dnd files to image format and I have around 2000 dnd file and I want to convert those file into image file for better understanding
Is it possible to create phylogenetic tree image from clusterw dnd file?
one example of the dnd file is like bellow:
(
(
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;
Upvotes: 1
Views: 2714
Reputation: 8164
you may use ape library in R, dnd file is a type of Newick format
install.packages("ape")
library(ape)
MyTree <- read.tree("my_file.dnd")
png("my_file.png")
plot(MyTree)
dev.off()
you get:
or, if you prefer use phytools library, Note: before, you must first remove line breaks to input file
((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;
install.packages("phytools")
library(phytools)
MyTree <- read.newick("my_file.dnd")
png("my_file2.png")
plot(MyTree)
dev.off()
you get
Upvotes: 5