Skip to content
New issue

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

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

Already on GitHub? # to your account

Support for JSON "Infinity" values for double and integers #99

Open
AlexanderPico opened this issue May 16, 2019 · 1 comment
Open

Support for JSON "Infinity" values for double and integers #99

AlexanderPico opened this issue May 16, 2019 · 1 comment

Comments

@AlexanderPico
Copy link
Member

Currently, a "Infinity" values within attribute lists of doubles or integers lead to an error:

"Could not parse the input JSON for updating table because: Non-standard token 'Infinity': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow\n at [Source: org.glassfish.jersey.message.internal.EntityInputStream@78b71950; line: 13, column: 24]"

R encodes infinity as Inf. The conversion to JSON appears to be working as it translate these to Infinity. But I suspect the conversion to Java is failing. Java has Double.POSITIVE_INFINITY, but I'm not sure Cytoscape handles this well. I'm not sure in general how we want to handle infinity in Cytoscape.

In the meantime, this means folks coming from Python, R and other scripting languages have to consciously avoid infinity when working with CyREST. Not ideal...

Here's an example that I ran via Swagger to reproduce the error. It assumes you have a network with these GO term nodes in it already...

RCy3::cyrestPUT, HTTP Error Code: 500
 url=http://localhost:1234/v1/networks/3476/tables/defaultnode
 body={
 "key": "id",
"dataKey": "id",
"data": [
{
 "id": "GO:0005215",
"pvalue": 2.606047e-15,
"oddsRatio": 3.502064
},
{
 "id": "GO:0008556",
"pvalue": 2.632002e-15,
"oddsRatio":   Infinity
}
]}
@dotasek
Copy link
Contributor

dotasek commented Oct 2, 2019

I'm digging into the code right now to find out how well Cytoscape does this.

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

No branches or pull requests

2 participants