possible bug in TreeTemplateTools::dropLeaf??

15 views
Skip to first unread message

Brian

unread,
Nov 9, 2012, 7:16:46 AM11/9/12
to biopp-he...@googlegroups.com
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;


Julien Yann Dutheil

unread,
Nov 9, 2012, 2:35:13 PM11/9/12
to biopp-he...@googlegroups.com
Dear Brian,

I did not look at your code yet, but may I ask which version of bpp you are using? Did you update recently from git or are you using the stable version?

All the best,

Julien.




--
You received this message because you are subscribed to the Google Groups "Bio++ Usage Help Forum" group.
To post to this group, send email to biopp-he...@googlegroups.com.
To unsubscribe from this group, send email to biopp-help-for...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/biopp-help-forum/-/dqi21M02kkoJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Julien Y. Dutheil, Ph-D
0 (+49) 6421 178 530

§ Max Planck Institute for Terrestrial Microbiology
Department of Organismic Interactions
Marburg -- GERMANY

§ Intitute of Evolutionary Sciences - Montpellier
University of Montpellier 2 -- FRANCE

Brian Caffrey

unread,
Nov 9, 2012, 2:53:25 PM11/9/12
to biopp-he...@googlegroups.com
Hi Julien,

I have used the most recent stable version, but have also tried all the way back to bpp-phyl-1.9 in case it was a new update and those versions of dropLeaf don't seem to be any different.
Thanks,
Brian

Julien Yann Dutheil

unread,
Nov 9, 2012, 2:58:48 PM11/9/12
to biopp-he...@googlegroups.com
Ok, we did some recent changes in the node classes, so I was just wondering if that could be linked. Could you please report this issue on the bug tracker http://biopp.univ-montp2.fr/bug ?

Thanks a lot,

Julien.

Brian Caffrey

unread,
Nov 9, 2012, 3:01:26 PM11/9/12
to biopp-he...@googlegroups.com
Sure!

Brian Caffrey

unread,
Nov 9, 2012, 5:03:29 PM11/9/12
to biopp-he...@googlegroups.com
Actually Julien,

I can't seem to submit a bug report. I've tried to register but it never sent me a confirmation email. Otherwise I can't find how without registering, 

Thanks,
Brian

Nicolas Rochette

unread,
Nov 12, 2012, 11:53:51 AM11/12/12
to biopp-he...@googlegroups.com
Hi Brian,

I had a look at your problem, but I could not reproduce it.

By compiling the bit of code you pasted against Bio++2.0 or Bio++dev and trying it on your tree, all I get is a "leaf not found" error, which is expected as the tree does not have a "dre" leaf. Then if I remove this step then the others succeed.

The code did not compile against Bio++1.9 ; it appears that there were typos in the dropLeaf code at that time, eg. "hasfather" instead of "hasFather"...

Did you manage to solve your problem by yourself ?

Regards,

Nicolas Rochette


On 11/09/2012 11:03 PM, Brian Caffrey wrote:

Brian

unread,
Nov 12, 2012, 1:46:58 PM11/12/12
to biopp-he...@googlegroups.com
Hi Nicolas,

I actually pasted in the wrong tree, here it is below, it results in the following error below even though the leaf is on the tree, it happens when preforming the last dropLeaf in the code I sent.
Any advice?
Thanks,
Brian

Error:
terminate called after throwing an instance of 'bpp::NodeNotFoundException'
Abort trap: 6



(gga:9.39053e-07,(((dre:0.0487635,(mdo:0.0624847,((cfa:0.0207586,(ecb:0.0390012,mcc:0.0307221):0.0105208):0.0253745,((ssc:0.043482,bta:0.00738174):0.016072,rno:0.0897778):0.00154362):0.0259034):0    .0    135715):0.138601,((hsa:9.39053e-07,ptr:0.00157837):0.00492508,mmu:0.00931183):0.0346261):0.0441433,tgu:0.0154105):0.015199,oaa:0.38895);

Brian Caffrey

unread,
Nov 12, 2012, 1:58:02 PM11/12/12
to biopp-he...@googlegroups.com
Sorry again, there may have been some spacing problems there. I pasted that from vim, here it is fixed:


(gga:9.39053e-07,(((dre:0.0487635,(mdo:0.0624847,((cfa:0.0207586,(ecb:0.0390012,mcc:0.0307221):0.0105208):0.0253745,((ssc:0.043482,bta:0.00738174):0.016072,rno:0.0897778):0.00154362):0.0259034):0.0135715):0.138601,((hsa:9.39053e-07,ptr:0.00157837):0.00492508,mmu:0.00931183):0.0346261):0.0441433,tgu:0.0154105):0.015199,oaa:0.38895);


--
You received this message because you are subscribed to the Google Groups "Bio++ Usage Help Forum" group.
To post to this group, send email to biopp-he...@googlegroups.com.
To unsubscribe from this group, send email to biopp-help-for...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/biopp-help-forum/-/YH0_AC3eexkJ.

Julien Yann Dutheil

unread,
Nov 12, 2012, 4:04:00 PM11/12/12
to biopp-he...@googlegroups.com
Hi Brian, Nicolas,

There is currently a pb with the mailserver of the Bio++ server. Brian, I can see your account have been created, but the email could not be send. Currently trying to figure out the pb :s

Best,

J.

Nicolas Rochette

unread,
Nov 13, 2012, 3:59:31 AM11/13/12
to biopp-he...@googlegroups.com
Got it: there's a "brother->removeFather();" missing at :
http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/TreeTemplateTools_8h_source.html#l00234 ('root' is deleted but 'brother' still has a father.)

The easiest for you Brian would be to modify your version of the lib (it will take time for the bug to be corrected in the stable version).

Unless you've got your BppMantis account already (?), I will make a laconic bug report.

Regards,

Nicolas


Le 12/11/2012 22:04, Julien Yann Dutheil a écrit :

Brian Caffrey

unread,
Nov 13, 2012, 6:03:32 AM11/13/12
to biopp-he...@googlegroups.com
Hi Nicolas,

I didn't get an account yet so could you submit the bug report. Thanks for finding the bug.
Best,
Brian


Julien Yann Dutheil

unread,
Nov 13, 2012, 7:47:46 AM11/13/12
to biopp-he...@googlegroups.com
Hi Brian,

You should have received an email allowing you to reset your password on the Mantis DB.

cheers,

J.

Brian Caffrey

unread,
Nov 14, 2012, 5:20:17 AM11/14/12
to biopp-he...@googlegroups.com
Hi again guys,

sorry to bother you again, whilst the fix that nicolas suggested did indeed fix the problem I seem to have found another, if you use the code and tree below.
Thanks again for any advice,
Brian

tree:
(mdo:0.341047,(((xtr:0.0800882,xla:0.0711461):0.474126,(dre:0.738551,(tgu:0.133031,gga:0.108055):0.140276):0.134208):0.158312,(ecb:0.127131,((bta:0.128399,ssc:0.0694253):0.0340822,((mmu:0.0253198,rno:0.0510045):0.154632,(mcc:0.0334542,(ptr:0.00380363,hsa:0.00304675):0.0258442):0.0796651):0.0294166):0.017416):0.202895):0.0367128,oaa:1.1994);

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 tem = TreeTemplateTools::treeToParenthesis(*tree1, false);
cerr << "treestring=" << tem << endl;
string temp = "xla";    

cerr << "\nRemoving: xla\n";

TreeTemplateTools::dropLeaf(*tree1, temp);


delete newickReader;
delete tree1;
}

Nicolas Rochette

unread,
Nov 14, 2012, 7:58:05 AM11/14/12
to biopp-he...@googlegroups.com
This problem comes from Newick::read() and has already been corrected in the development version, but I do not know when or how exactly.

Julien ?

Best,
Nicolas


On 11/14/2012 11:20 AM, Brian Caffrey wrote:

Brian Caffrey

unread,
Nov 14, 2012, 10:55:46 AM11/14/12
to biopp-he...@googlegroups.com
Thanks Nicolas,

I have updated the version I am using on this machine to the latest version and it works now
Brian


Reply all
Reply to author
Forward
0 new messages