TreeBASE / treebase

Source code for TreeBASE web application and database
http://www.treebase.org
BSD 3-Clause "New" or "Revised" License
9 stars 2 forks source link

Invalid NexML output #195

Open ghost opened 14 years ago

ghost commented 14 years ago

Downloading a Study as NexML can result in an invalid XML file.

The Study I tried was 1144 ( http://www.treebase.org/treebase-web/search/study/summary.html?id=1144 ).

I tried the online validator and the Java parser and both report the file as invalid. The problem seems to be the OTUs groups and the the tree blocks referencing the OTUs. The file for 1144 contains two OTUs (otus304719 and otus304819) and two tree blocks. The first tree block ( trees306715 ) references the OTUs otus304819, but contains a node that references an OTU ( otu304721 ) from the other OTUs group (otus304719). It should istead reference to otu304821.

The essential parts: <nex:nexml> <otus about="#otus304719" id="otus304719" label="TaxonLabelSet11490"> <otu about="#otu304721" id="otu304721" label="Megadyptes antipodes"></otu> </otus> <otus about="#otus304819" id="otus304819" label="TaxonLabelSet11489"> <otu about="#otu304821" id="otu304821" label="Megadyptes antipodes"></otu> </otus> <trees about="#trees306715" id="trees306715" label="Tb6842" otus="otus304819"> <tree> <node about="#node306728" id="node306728" label="Megadyptes antipodes" otu="otu304721"></node> </tree> </trees> <trees about="#trees306934" id="trees306934" label="Tb6843" otus="otus304719"> <tree> <node about="#node306947" id="node306947" label="Megadyptes antipodes" otu="otu304721"></node> </tree> </trees> </nex:nexml>

Reported by: thasso

ghost commented 14 years ago

suggested fix

Original comment by: thasso

ghost commented 14 years ago

I uploaded a patch as a first suggestion. Looks like the treeblock gets its OTUs reference but the treecreation was actually searching all OTUs when looking for taxon references. I just passed on the TreesBlock OTUs to the tree creation and looking for references only in that OTUs.

Note that the whole project compiles, but the patch is untested. Is there an easy way to get a test database running ?

Original comment by: thasso