Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

induced subtree request by id fails for genus Id #11

Closed
jhpoelen opened this issue Sep 25, 2014 · 9 comments
Closed

induced subtree request by id fails for genus Id #11

jhpoelen opened this issue Sep 25, 2014 · 9 comments

Comments

@jhpoelen
Copy link

For some reason, induced subtree can be retrieved using ott ids c(357968, 867416, 939325) , but not c(357968, 867416, 939325, 462102) .

This succeeds:

> rotl::tol_induced_subtree(ott_ids = c(357968, 867416, 939325))

Phylogenetic tree with 3 tips and 1 internal nodes.

Tip labels:
[1] "Blastophaga_nipponica_ott939325" "Blastophaga_psenes_ott357968"   
[3] "Blastophaga_quadrupes_ott867416"
Node labels:
[1] "Blastophaga_ott462102"

Unrooted; no branch lengths.
> 

but this fails:

> rotl::tol_induced_subtree(ott_ids = c(357968, 867416, 939325, 462102))
Error: HTTP failure: 500
Index: 32, Size: 32

Is this an opentree or rotl issue?

@josephwb
Copy link
Contributor

Seems like an OpenTree problem:

curl -X POST http://devapi.opentreeoflife.org/v2/tree_of_life/induced_subtree -H "Content-Type:application/json" -d '{"ott_ids":[357968,867416,939325,462102]}'
{
  "message" : "Index: 32, Size: 32",
  "exception" : "IndexOutOfBoundsException",
  "fullname" : "java.lang.IndexOutOfBoundsException",
  "stacktrace" : [ "java.util.ArrayList.rangeCheck(ArrayList.java:635)", "java.util.ArrayList.get(ArrayList.java:411)", "opentree.GraphExplorer.getDraftTreeMRCAForNodes(GraphExplorer.java:360)", "opentree.GraphExplorer.extractDraftSubtreeForTipNodes(GraphExplorer.java:468)", "opentree.plugins.tree_of_life.induced_subtree(tree_of_life.java:315)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:57)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:168)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:300)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)" ]
}

I hope to get this fixed today.

@jhpoelen
Copy link
Author

Thanks!

@jhpoelen
Copy link
Author

jhpoelen commented Oct 7, 2014

I've attempted to reproduce the issue, hoping to close this issue. Here's what I got:

> rotl::tol_induced_subtree(ott_ids = c(357968, 867416, 939325))

Phylogenetic tree with 3 tips and 1 internal nodes.

Tip labels:
[1] "Blastophaga_nipponica_ott939325" "Blastophaga_psenes_ott357968"   
[3] "Blastophaga_quadrupes_ott867416"
Node labels:
[1] "Blastophaga_ott462102"

Unrooted; no branch lengths.

Similar to previous result.

However:

> rotl::tol_induced_subtree(ott_ids = c(357968, 867416, 939325, 462102))
Error: HTTP failure: 500
The node Node[1846303] does not seem to be in the draft tree.

@josephwb Is this expected behavior? I was hoping that asking for subtree /w missing ott id would create subtree and perhaps indicate that some ott id was ignored because it wasn't in the draft tree.

@josephwb
Copy link
Contributor

josephwb commented Oct 9, 2014

@jhpoelen No, this is not expected behaviour. A subtree should be returned, together with warnings if ids were 1) not in the synthetic tree or 2) altogether invalid ids. e.g. [edited, as there was a paste error in the curl call]:

curl -X POST http://api.opentreeoflife.org/v2/tree_of_life/induced_subtree -H "content-type:application/json" -d '{"ott_ids":[357968, 867416, 939325, 9999999]}'
{
  "subtree" : "(Blastophaga_nipponica_ott939325,Blastophaga_psenes_ott357968,Blastophaga_quadrupes_ott867416)Blastophaga_ott462102;",
  "ott_ids_not_in_tree" : [ ],
  "ott_ids_not_in_graph" : [ 9999999 ],
  "node_ids_not_in_graph" : [ ],
  "node_ids_not_in_tree" : [ ]
}

I believe what you are getting stems from an ongoing issue where one query node is the ancestor of another (can you confirm this? I can check, of course, but you probably know).

Anyway, definitely not an rOTL issue.

@jhpoelen
Copy link
Author

jhpoelen commented Oct 9, 2014

@josephwb from earlier example in this thread, the first three ott ids are tips (i.e. 357968, 867416, 939325) and the last one is a node (i.e. 462102) and wasp genus Blastophaga . Hope this helps.

@josephwb
Copy link
Contributor

josephwb commented Oct 9, 2014

Ok, thanks. I have fixed this bug (not yet deployed), but am working on fixing another.

@fmichonneau
Copy link
Member

hi @josephwb

Did your fix get deployed? This still seems to fail on the OTL side (i.e., no subtree is being returned).

curl -X POST http://devapi.opentreeoflife.org/v2/tree_of_life/induced_subtree -H "Content-Type:application/json" -d '{"ott_ids":[357968,867416,939325,462102]}'
{
  "message" : "The node Node[1992344] does not seem to be in the draft tree.",
  "exception" : "UnsupportedOperationException",
  "fullname" : "java.lang.UnsupportedOperationException",
  "stacktrace" : [ "opentree.GraphExplorer.getTreeTipRootPathMap(GraphExplorer.java:326)", "opentree.GraphExplorer.extractDraftSubtreeForTipNodes(GraphExplorer.java:530)", "opentree.plugins.tree_of_life.induced_subtree(tree_of_life.java:333)", "java.lang.reflect.Method.invoke(Method.java:497)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:57)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:168)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:300)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "java.lang.reflect.Method.invoke(Method.java:497)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)" ]
}

@josephwb
Copy link
Contributor

This works.

@jhpoelen
Copy link
Author

jhpoelen commented Apr 18, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants