[Phylobase-commits] r833 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 11 18:00:24 CET 2012
Author: francois
Date: 2012-01-11 18:00:24 +0100 (Wed, 11 Jan 2012)
New Revision: 833
Modified:
pkg/R/readNCL.R
Log:
between brackets annotations at nodes are not being removed by NCL (as generated by BEAST), they are now being removed by phylobase before parsing the tree strings
Modified: pkg/R/readNCL.R
===================================================================
--- pkg/R/readNCL.R 2011-03-24 20:05:33 UTC (rev 832)
+++ pkg/R/readNCL.R 2012-01-11 17:00:24 UTC (rev 833)
@@ -130,10 +130,13 @@
if (!experimental) {
for (i in 1:length(ncl$trees)) {
if (length(grep(":", ncl$trees[i]))) {
- listTrees[[i]] <- tree.build(ncl$trees[i])
+ ## remove comments from the string, they are not being removed if they are part of the node labels
+ tStr <- gsub("\\[.*?\\]", "", ncl$trees[i])
+ listTrees[[i]] <- tree.build(tStr)
}
else {
- listTrees[[i]] <- clado.build(ncl$trees[i])
+ tStr <- gsub("\\[.*?\\]", "", ncl$trees[i])
+ listTrees[[i]] <- clado.build(tStr)
}
}
listTrees <- lapply(listTrees, function(tr) {
More information about the Phylobase-commits
mailing list