Question: Importing Newick phylogenetic tree with ade4::newick2phylog() fails with moderate size tree
0
gravatar for ido.idobar
13 months ago by
ido.idobar10
ido.idobar10 wrote:

Hi,

I'm trying to use the iNextPD R package to estimate phylogenetic diversity and one of the required input is a phylogenetic tree as a phylog object, which can be generated with the newick2phylog() function from ade4 package.
However, when I try this function with my Newick tree (generated by QIIME), R just process the command for hours and occupies all available RAM without proceeding.
I'm not sure if the problem is with my tree file or the function itself, but it does import properly as a phylo object with read.tree() function from ape package, so if there's a way to convert an ape::phylo object to ade4::phylog object it would be helpful as well.

This is the code that I'm using and the tree file can be downloaded here:

library(ade4)
library(ape)
# importing the tree as a 'phylo' object
tree.phylo <- read.tree("rep_set.tre") # this works
# read the tree as a character string
tree.nw <- scan("rep_set.tre", what="character")
# import the tree as a 'phylog' object
bact.phy <- newick2phylog(tree.nw) # does not finish and leaks memory

Many thanks for your help, Ido

ape newick ade4 R phylogenetic • 413 views
ADD COMMENTlink written 13 months ago by ido.idobar10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1209 users visited in the last hour