Closed methornton closed 4 months ago
Hey Matthew. I started to answer this over at Bioconductor but then found this post here where it's easier to share files etc.
The error message you are getting is indeed not very helpful. It's just saying that the CyREST return obj "res" failed to be returned. This could be caused by a failure at any number of steps. In order to better troubleshoot, it would be helpful to have a test case that I can run locally and debug...
I'll try with a simple graphNEL first. If that works, then I'll need your help recreating (or receiving) your more complex case...
Ok. This simple case works for me. Does it work for you?
createNetworkFromGraph(makeSimpleGraph())
This first test will help isolate the issue to either your setup vs mine or to the complexity of the graphNEL.
Hello! Thank you for your help! Yes. The above works. Please let me know if you would like an rds file that has just the graphNEL. I don't get the error every time, just 90% I can give an rds graphNEL for the error producing and one that worked like your above example.
> library(RCy3)
> cytoscapePing()
You are connected to Cytoscape!
> createNetworkFromGraph(makeSimpleGraph())
Loading data...
Applying default style...
Applying preferred layout...
networkSUID
8745
Hello! Github wont let me attach rds files. I can email them or ftp. I can put them on my webserver. please let me know what is best.
The RDS would be perfect. Email to alex.pico@gladstone.ucsf.edu.
Thanks for the test files. I found the culprit!
The error is occuring during the loadTableData step for node attributes. In particular it's failing on the entry for GO:0005234 where oddsRatio ="inf".
At this point in the script, RCy3 is passing Cytoscape data to fill the Node Table and Cytoscape is specifically attempting to fill a column of Double
values in the oddsRatio column. When it hits the String
value of "Inf" Cytoscape chokes and throws an error back through CyREST to RCy3.
Easiest fix would be to pre-screen your data values to remove these or set these to a really huge number or whatever makes sense for your analysis. Would this work for you?
Will also look into implementing a check on our end to catch and swap these automatically... See #224
Oh yeah. I have seen that before. I figures inf was just a placeholder for that really huge number. I'll have to find a way to replace them in the object. Thank you for finding my issue and your help. I really appreciate it!
Here's a snippet that might work for you if you have you data in a dataframe...
data[] <- lapply(data, function(x){
if (is.numeric(x)) {
max_java <- .Machine$integer.max
min_java <- .Machine$integer.min
x[is.infinite(x) & x > 0] <- max_java
x[is.infinite(x) & x < 0] <- min_java
}
)
Sorry to chime in (was checking this thread out of curiosity), but .Machine$integer.min
doesn't exist, and is therefore NULL
? I guess this is not the intended behavior?
> .Machine$integer.max
[1] 2147483647
> .Machine$integer.min
NULL
>
AFAIK the maximum integer value is 2^31 - 1 = +2147483647, and the minimum integer value is -2^31 + 1 = -2147483648, should it not better be:
max_java <- (2^31) - 1
min_java <- -(2^31) + 1
> as.integer(.Machine$integer.max)
[1] 2147483647
>
> as.integer(2^31)
[1] NA
Warning message:
NAs introduced by coercion to integer range
> as.integer((2^31)-1)
[1] 2147483647
> as.integer(-2^31)
[1] NA
Warning message:
NAs introduced by coercion to integer range
> as.integer(-(2^31)+1)
[1] -2147483647
>
Full output:
> .Machine
$double.eps
[1] 2.220446e-16
$double.neg.eps
[1] 1.110223e-16
$double.xmin
[1] 2.225074e-308
$double.xmax
[1] 1.797693e+308
$double.base
[1] 2
$double.digits
[1] 53
$double.rounding
[1] 5
$double.guard
[1] 0
$double.ulp.digits
[1] -52
$double.neg.ulp.digits
[1] -53
$double.exponent
[1] 11
$double.min.exp
[1] -1022
$double.max.exp
[1] 1024
$integer.max
[1] 2147483647
$sizeof.long
[1] 4
$sizeof.longlong
[1] 8
$sizeof.longdouble
[1] 16
$sizeof.pointer
[1] 8
$sizeof.time_t
[1] 8
$longdouble.eps
[1] 1.084202e-19
$longdouble.neg.eps
[1] 5.421011e-20
$longdouble.digits
[1] 64
$longdouble.rounding
[1] 5
$longdouble.guard
[1] 0
$longdouble.ulp.digits
[1] -63
$longdouble.neg.ulp.digits
[1] -64
$longdouble.exponent
[1] 15
$longdouble.min.exp
[1] -16382
$longdouble.max.exp
[1] 16384
>
@guidohooiveld Good catch! My initial test case only had positive values and we hadn't yet implemented and fully tested this. I would update the snippet to just use -.Machine$integer.max
like below, but your approach works too. Thanks!
data[] <- lapply(data, function(x){
if (is.numeric(x)) {
max_java <- .Machine$integer.max
min_java <- -.Machine$integer.max
x[is.infinite(x) & x > 0] <- max_java
x[is.infinite(x) & x < 0] <- min_java
}
)
Hello! I also posted this in the Bioconductor support forum. I recently updated to Cytoscape 3.10 and the latest RCy3. I am trying to import graphNEL network graphs from 'GOstats' into Cytoscape. Previously I was not having any problems. I'm sure that it is a formatting error. my graphNEL looks like this:
Here is the error:
Is there some package that I need? What is 'res' and how do I specify it. I googled it and I didn't find anything.
When I start up Cytoscape I get no errors, when I try the import I get these errors: