FePhyFoFum / phyx

phylogenetics tools for linux (and other mostly posix compliant) computers
blackrim.org
GNU General Public License v3.0
111 stars 17 forks source link

pxrr does not work when root edge present #137

Closed josephwb closed 3 years ago

josephwb commented 3 years ago

[Submitted by zhangqiong]

Working with this tree:

((Hsinensis:0.00699791,(Eurya_acuminatissima:0.0835567,(((SCwallichii:0.00136009916772134249,SCsericans:0.00141386)34:0.00815149,(Falatamaha:0.00671644043733485296,(Lgrandis:0.00412921003436183924,Glasianthus:0.01518895745936422147)99:0.00486958391019317802)94:0.00127025718921492943)100:0.01747225291781624376,(((PAmultisepala:0.00365334,Tchampioni:0.00132095)92:0.00185297,Pyoblongicarpa:0.00439602406472616378)99:0.00356576568831727496,(((Paxillaris:0.00330613,Phainanensis:0.0033232)100:0.00478620036552010464,L_fruticosa:0.01591355197683665471)55:0.00077860035722394677,(Aoblata:0.00749197588443350181,((szechuanensis:0.00198329,((amplexifolia:0.00331048293113049433,huana:0.0016512)19:0.00000100000050002909,Cfluviatilis:0.00530477)2:0.00000100000050002909)49:0.000331115,(Cyungkiangensis:0.0053169,tsingpienensis:0.00390286)93:0.00132573824062239909)98:0.00339835620774759121)45:0.00032091731443947716)70:0.00147512627596211102)100:0.02885341291361050511)96:0.00518918801976389534)95:0.01502963600235036543)100:0.00294092040782343656);

Trying to reroot or just unroot gives the error:

./pxrr -t rr.tre -g Eurya_acuminatissima
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)

I've gone through previous releases and the same error is always printed.

When I do:

pxcltr -t rr.tre | pxrr -g Eurya_acuminatissima

things work, which makes me think the annotations are to blame. However, when I add annotations to other trees, things work, so I have no idea what is going on...

josephwb commented 3 years ago

Ah ok this tree somehow has a root edge (despite seemingly been reconstructed with RAxML). So, not an issue with annotations: pxcltr removes annotations, knuckles, and root edges all at once. So, bad input, I suppose. But we can deal with this.

josephwb commented 3 years ago

Extended pxcltr to allow specific properties to be removed (not just all) with 67de1ec3de4092a168ef27e876d8a21a15bb568b. I'll put a quick check for a root edge in pxrr so we don't run into this again.

josephwb commented 3 years ago

Check implemented with a0fc9ef9d9e25cb743e79b75fdf0f7083831827f. I suppose we could do this automatically, but really we should not be encountering this type of tree often.