Hi There,

I’m currently wanting to make some changes to some phylogenies in R by reading 
in the newick text as a string, rather than as a phylo object.  The reason is 
that the trees are large (~10,000 tips and another set with ~5000 tips) and I 
must make changes to a complete set of these tree (i.e. 10,000 trees).  
Currently, these trees have node labels, which I’d like to remove.  

Essentially what I’d like to do is substitute “)?:” with “):” or simply delete 
"?", where “?" is any and all characters that occur between the “close” 
parenthesis and the colon.  So far I found I could use the function ’sub’ but 
I’d like to make the replacements in one fell swoop, without knowing what the 
node labels are in advance.  Also the sub function seems to only replace the 
first occurrence of the pattern rather than all matches in a string.  Any 
suggestions would be greatly appreciated!  Thank you!

best,
Karen

_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

Reply via email to