Hello,
I am having problems with dropLeaf from TreeTemplateTools, I have pasted the code below and the tree string I which I have been having problems with. I have actually used dropLeaf many times without any problem so perhaps this is a special case? Anyway, let me know if you have any ideas as to fix this problem (it results in a seg fault).
Thanks,
Brian
The Code:
#include<iostream>
#include<Phyl/TreeTemplateTools.h>
#include<Phyl/Newick.h>
using namespace bpp;
using namespace std;
int main(int argc, char *argv[]){
TreeTemplate<Node> *tree1 = NULL;
Newick * newickReader = new Newick(false);
tree1 = newickReader->read(argv[1]);
string temp = "dre";
TreeTemplateTools::dropLeaf(*tree1, temp);
temp = "gga";
TreeTemplateTools::dropLeaf(*tree1, temp);
temp = "mdo";
TreeTemplateTools::dropLeaf(*tree1, temp);
temp = "oaa";
TreeTemplateTools::dropLeaf(*tree1, temp);
temp = "ssc";
TreeTemplateTools::dropLeaf(*tree1, temp);
temp = "tgu";
TreeTemplateTools::dropLeaf(*tree1, temp);
}
The Tree:
(((oaa:0.38830800770711360048,mdo:0.06833436461618398738):0.07431017831670785889,((cfa:0.05372436000736821593,(ecb:0.12918401971375187420,(ssc:0.01535980156066308472,bta:0.04403130599393685618):0.01878831251056608045):0.00354854187567354550):0.01205123970542492685,((mcc:0.00911472247613035261,(ptr:0.00000093905322139818,hsa:0.00000093905322139818):0.00604569949573044874):0.04896365558528310846,(rno:0.03697888001941634223,mmu:0.02910710511220356358):0.11008198985235176370):0.00545621921594109487):0.09994147666185333734):0.10815786457951592769,(gga:0.11821065416660983538,tgu:0.09338483178365644677):0.27376306202588812644,xla:0.81432720005637138083):0.0;