phylotastic / phylotastic-portal

Web tool (ruby on rails) providing access to phylotastic services for acquiring species trees.
https://github.com/phylotastic/phylotastic/wiki
1 stars 3 forks source link

tree is not shown up if there is no image of a given species #134

Closed ducvan0212 closed 8 years ago

ducvan0212 commented 8 years ago

Can you check your draw function when I display a picture of a species in leaves of tree? I think the problem is that there are some species that do not have image to be displayed so it create error in your draw function

abusalehmdtayeen commented 8 years ago

@ducvan0212 , Yes, you were right. I have fixed the issue. Now if there is no image for any species it will show an image with message "Image Not Available".

ducvan0212 commented 8 years ago

Now, tree is completely not shown up @abusalehmdtayeen

abusalehmdtayeen commented 8 years ago

@ducvan0212 , The underlying web service hung up possibly because of some unmatched exception. I have restarted it. It is working now. Can you send me the last input newick string and operation you tried before the tree stopped showing up. The web service is still in testing phase. I need to track down this type of exceptions.

ducvan0212 commented 8 years ago

It works now so I dont think you can get again the exeption. Anyway, here are the last 3 trees I checked with ETE

=> "{\"status_code\": 200, \"message\": \"Success\", \"newick\": \"(((((Acer_tataricum_subsp._ginnala_ott403798,Acer_platanoides_ott948919)Acer_ott948922,Ailanthus_altissima_ott30793)Sapindales_ott229288,Alliaria_petiolata_ott440662),Achyranthes_japonica_ott3944625)Pentapetalae_ott5316182,Allium_vineale_ott894665);\"}"

=> "{\"status_code\": 200, \"message\": \"Success\", \"newick\": \"(Equus_primigenius_ott3614857,Equus_kiang_ott641400)Equus_ott541951;\"}"

=> "{\"status_code\": 200, \"message\": \"Success\", \"newick\": \"((((Nesolagus_netscheri_ott152814,Nesolagus_timminsi_ott3611227)Nesolagus_ott152817,Poelagus_marjorita_ott963429,Romerolagus_diazi_ott923736,(Pronolagus_crassicaudatus_ott880862,Pronolagus_randensis_ott568360,Pronolagus_saundersiae_ott667751,Pronolagus_rupestris_ott568267)Pronolagus_ott880861,Brachylagus_idahoensis_ott923726,Bunolagus_monticularis_ott923729,Caprolagus_hispidus_ott144983,Pentalagus_furnessi_ott673127,Oryctolagus_cuniculus_ott864596,(Lepus_callotis_ott638198,Lepus_californicus_ott923732,Lepus_sinensis_ott636670,Lepus_timidus_ott167565,Lepus_alleni_ott638208,Lepus_granatensis_ott29167,Lepus_saxatilis_ott747873,Lepus_yarkandensis_ott192736,Lepus_flavigularis_ott836256,Lepus_starcki_ott29157,Lepus_brachyurus_ott673130,Lepus_hainanus_ott426408,Lepus_insularis_ott90802,Lepus_microtis_ott5553964,Lepus_coreanus_ott575440,Lepus_townsendii_ott747875,Lepus_comus_ott542002,Lepus_europaeus_ott864607,Lepus_oiostolus_ott114754,Lepus_corsicanus_ott29165,Lepus_mandshuricus_ott525087,Lepus_arcticus_ott638196,Lepus_othus_ott167569,Lepus_peguensis_ott3611221,Lepus_americanus_ott923734,Lepus_habessinicus_ott29169,Lepus_capensis_ott864613,Lepus_tolai_ott426231,Lepus_tibetanus_ott3611223,Lepus_fagani_ott3611222,Lepus_nigricollis_ott3611220)Lepus_ott864610,(Sylvilagus_graysoni_ott3611217,Sylvilagus_cognatus_ott3611210,Sylvilagus_dicei_ott3611218,Sylvilagus_mansuetus_ott3611209,Sylvilagus_varynaensis_ott3611219,Sylvilagus_insonus_ott3611216,Sylvilagus_aquaticus_ott989147,Sylvilagus_brasiliensis_ott634572,Sylvilagus_obscurus_ott956330,Sylvilagus_bachmani_ott634755,Sylvilagus_nuttallii_ott956328,Sylvilagus_palustris_ott5553966,Sylvilagus_robustus_ott1038023,Sylvilagus_audubonii_ott532394,Sylvilagus_cunicularis_ott923037,Sylvilagus_floridanus_ott864591,Sylvilagus_transitionalis_ott393434)Sylvilagus_ott864604)Leporidae_ott644258,(Aix_sponsa_ott765195,Mareca_strepera_ott30856)),(((((Acer_tataricum_subsp._ginnala_ott403798,Acer_platanoides_ott948919)Acer_ott948922,Ailanthus_altissima_ott30793)Sapindales_ott229288,Alliaria_petiolata_ott440662),Achyranthes_japonica_ott3944625)Pentapetalae_ott5316182,Allium_vineale_ott894665))Eukaryota_ott304358;\"}"

abusalehmdtayeen commented 8 years ago

@ducvan0212 : I forgot to tell you one thing that you should take care of on your end. The tree viewer web service can accept the species names in newick string with underscore and ottids and draw the tree. But when you will try to view images or EOL links it will not be able to get image or link data because of the underscore and ottids. You need to remove the ottids and replace the underscore with spaces before sending the newick string to the tree viewer web service.

ducvan0212 commented 8 years ago

Abu, check this tree. @hdliv can not see it in ete

((((((((((Elodea canadensis,Egeria densa)Hydrocharitaceae,(Butomopsis latifolia,Alisma triviale)Alismataceae),Zostera marina,((Lemna gibba,Wolffia arrhiza),Dracunculus vulgaris))Alismatales,(((Zizania aquatica,(Poa alpina,Deschampsia cespitosa)Poeae Chloroplast Group 2 (Poeae type)),Carex hirta),Typha latifolia)Poales),((((((Micranthes aprica,Saxifraga oppositifolia)Saxifragaceae,Myriophyllum spicatum),Sinapis arvensis),(Helianthus annuus,Ipomoea carnea))Pentapetalae,(Papaver dahlianum,Cocculus carolinus))eudicotyledons,Ceratophyllum demersum)),(Nymphaea alba,Nuphar advena)Nymphaeaceae),(((Salvinia minima,Azolla caroliniana),(Polypodium vulgare,(Ceratopteris thalictroides,Anogramma leptophylla)Pteridaceae)Polypodiales),Equisetum ramosissimum)Moniliformopses)Euphyllophyta,Palhinhaea cernua)Tracheophyta,((((Taxiphyllum barbieri,Leptodictyum riparium),Hookeria lucens),Calomnion complanatum),Sphagnum angustifolium)Bryophyta)Embryophyta,Ceratophyllum demersum)Eukaryota;

abusalehmdtayeen commented 8 years ago

@ducvan0212 @hdliv , I checked the newick string for which you can't see the tree. The ETE module gives a newick parse error while reading it. That is why it can not draw the tree. I have contacted the ETE developer regarding this issue. I am waiting for his response. As soon as the problem is resolved, I will let you guys know.

abusalehmdtayeen commented 8 years ago

@ducvan0212 @hdliv , Currently ETE does not support any taxon name which includes parenthesis. For example, in the above newick string there is a taxon called "Poeae Chloroplast Group 2 (Poeae type)". The presence of this type of taxon causes problems while parsing the newick string since parenthesis is a reserved character for newick standard. The solution that the ETE developer suggested for now is to remove the parenthesis from this type of taxon names. So if you convert "Poeae Chloroplast Group 2 (Poeae type)" to "Poeae Chloroplast Group 2 Poeae type" there will be no problem parsing the newick string and the tree will be drawn in ETE.

ducvan0212 commented 8 years ago

But how can i know if ( is for newick format separator or it is a part of name of species?

abusalehmdtayeen commented 8 years ago

@ducvan0212 , honestly I don't have a good solution about this issue right now. I can suggest one approach which is not that good I know. May be when this type of newick strings don't work, you can ask the user to check for reserved characters using a message and allow them to edit the newick. Discuss with @hdliv, whether he can give any better solution.

ducvan0212 commented 8 years ago

@hdliv @abusalehmdtayeen I dont think allowing user to update newick format is reasonable. It is hard to check a big chunk of text by your naked eyes and what if user wrongly updates the newick text? It creates more complexity than its convenience

arlin commented 8 years ago

@ducvan0212, the answer to the question about how to recognize whether "(" is in a name or is part of the Newick tree is to have a proper lexical parser. The parser will tokenize a Newick string according to some rules, and the rules typically would allow for any character within a quoted string. Therefore, the long-term solution in this case is to fix the ETE parser so that it will parse names correctly. I don't know what is the best short-term solution.

ducvan0212 commented 8 years ago

@arlin should I add a small line of text to indicate this case and explain why tree can not be displayed in tree visualization page?

abusalehmdtayeen commented 8 years ago

@ducvan0212 , I will modify the tree viewer service to send you an error message when this type of newick parsing error occurs.

abusalehmdtayeen commented 8 years ago

@ducvan0212 , I have modified the tree viewer service to catch this type of error. Now it will send you error message regarding newick parsing error. It will be shown in the designated area for the tree image. You don't need to add anything in your end.

arlin commented 8 years ago

thanks, I can see that this works. closing.