cytoscape / RCy3

New version of RCy3, redesigned and collaboratively maintained by Cytoscape developer community
MIT License
49 stars 20 forks source link

Cytoscape crashes when group nodes are moved in subnetworks #29

Closed m-grimes closed 5 years ago

m-grimes commented 6 years ago

While testing the group functions I ran across this reproducible problem: if sub-networks are created using collapseGroup, and the nodes are rearranged in any way in those sub-networks, Cytoscape will hang if the expandGroup command is run. Here is what I did.

net.edges <- data.frame(source=c('ALK', 'ALK', 'ALK', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTTN', 'CTTN', 'CTTN', 'IRS1', 'IRS1', 'IRS1', 'ALK p Y1096', 'CTNND1 p Y193', 'CTNND1 p Y193', 'CTNND1 p Y228', 'CTNND1 p Y904', 'CTNND1 p Y217', 'CTNND1 p Y241', 'CTNND1 p Y248', 'ALK p Y1078', 'ALK p Y1096', 'ALK p Y1586', 'IRS1 p Y941', 'ALK', 'CTNND1', 'CTNND1', 'CTTN', 'IRS1'), target=c('ALK p Y1078', 'ALK p Y1096', 'ALK p Y1586', 'CTNND1 p Y193', 'CTNND1 p Y217', 'CTNND1 p Y228', 'CTNND1 p Y241', 'CTNND1 p Y248', 'CTNND1 p Y302', 'CTNND1 p Y904', 'CTTN p Y154', 'CTTN p Y162', 'CTTN p Y334', 'IRS1 p Y632', 'IRS1 p Y941', 'IRS1 p Y989', 'ALK p Y1586', 'CTNND1 p Y228', 'CTNND1 p Y302', 'CTNND1 p Y302', 'CTTN p Y154', 'CTTN p Y162', 'CTTN p Y162', 'CTTN p Y334', 'IRS1 p Y632', 'IRS1 p Y989', 'IRS1 p Y989', 'IRS1 p Y989', 'IRS1', 'CTTN', 'IRS1', 'NPM1', 'NPM1'), interaction=c('peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'positive correlation', 'Physical interactions, experiments', 'controls-state-change-of, controls-transport-of, Pathway, Physical interactions, experiments', 'Predicted', 'experiments, Physical interactions', 'experiments, Physical interactions'), Weight=c(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 0.8060606, 0.7575758, 0.7454545, 0.9393939, 0.8949096, 0.7329699, 0.7553845, 0.7866191, 0.775, 0.6969697, 0.7818182, 0.8424242, 0.6123365, 2.115272, 0.002461723, 0.3354451, 0.5661711), Alt.Weight=c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.8060606, 0.7575758, 0.7454545, 0.9393939, 0.8949096, 0.7329699, 0.7553845, 0.7866191, 0.775, 0.6969697, 0.7818182, 0.8424242, 0.6123365, 2.115272, 0.002461723, 0.3354451, 0.5661711))

net.cf <- data.frame(id=c('ALK', 'ALK p Y1078', 'ALK p Y1096', 'ALK p Y1586', 'CTNND1', 'CTNND1 p Y193', 'CTNND1 p Y217', 'CTNND1 p Y228', 'CTNND1 p Y241', 'CTNND1 p Y248', 'CTNND1 p Y302', 'CTNND1 p Y904', 'CTTN', 'CTTN p Y154', 'CTTN p Y162', 'CTTN p Y334', 'IRS1', 'IRS1 p Y632', 'IRS1 p Y941', 'IRS1 p Y989', 'NPM1'), Gene.Name=c('ALK', 'ALK', 'ALK', 'ALK', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTTN', 'CTTN', 'CTTN', 'CTTN', 'IRS1', 'IRS1', 'IRS1', 'IRS1', 'NPM1'), nodeType=c('receptor tyrosine kinase', 'receptor tyrosine kinase', 'receptor tyrosine kinase', 'receptor tyrosine kinase', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'SH3 protein', 'SH3 protein', 'SH3 protein', 'SH3 protein', 'undefined', 'undefined', 'undefined', 'undefined', 'RNA processing protein'), Total=c(-209.4885, -11.15512, -7.712652, -9.917654, -783.7109, 0, -16.63529, 0, -95.21879, -35.03751, 0, -74.77153, -172.7889, -67.19445, -14.73001, -55.37009, -401.1118, -6.4122, -6.388159, -5.171309, 1.580289), parent=c('', 'ALK', 'ALK', 'ALK', '', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', 'CTNND1', '', 'CTTN', 'CTTN', 'CTTN', '', 'IRS1', 'IRS1', 'IRS1', ''), Node.ID=c('gene', 'peptide', 'peptide', 'peptide', 'gene', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'peptide', 'gene', 'peptide', 'peptide', 'peptide', 'gene', 'peptide', 'peptide', 'peptide', 'gene'))

net3.suid <- createNetworkFromDataFrames(net.cf, net.edges, title=paste("Example", 1+length(getNetworkList())), collection = "Keys")

genes <- net.cf[grep("gene", net.cf$Node.ID), "id"]
sapply(genes, function(x) createGroup(x, nodes=net.cf[grep(x, net.cf$Gene.Name), "id"], nodes.by.col = "id"))
collapseGroup(genes)

NOW go into other networks labelled "Network_N" and move one or more nodes. Or try to expand the group while in one of those windows. Sometimes this error shows up:

RCy3::commandsPOST, HTTP Error Code: 500 url=http://localhost:1234/v1/commands/group/expand body={ "groupList": "ALK,CTNND1,CTTN,IRS1,NPM1", "network": "SUID:173" } Error in commandsPOST(paste0("group expand groupList=\"", group.list, : java.lang.NullPointerException

OR: (after ESC):

Error in curl::curl_fetch_memory(url, handle = handle) : Operation was aborted by an application callback

. After that, try to do anything - Cytoscape is hung! Several pages of java errors show up on the Terminal console. I'll just paste the first and last few here:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Exception: null http://35.197.44.209 GpmlReaderFactoryImpl java.lang.NullPointerException at org.cytoscape.task.internal.group.AbstractGroupTask.getGroupSetString(AbstractGroupTask.java:145) at org.cytoscape.task.internal.group.CollapseGroupTask.lambda$getResults$0(CollapseGroupTask.java:120) .... at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:748)

sessionInfo() R version 3.5.0 (2018-04-23) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.5 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] BiocStyle_2.8.2 BiocInstaller_1.30.0 igraph_1.2.1 gplots_3.0.1 RColorBrewer_1.1-2
[6] dplyr_0.7.5 plyr_1.8.4 RCy3_2.0.3 devtools_1.13.5 knitr_1.20
loaded via a namespace (and not attached): [1] Rcpp_0.12.17 pillar_1.2.3 compiler_3.5.0 bindr_0.1.1 base64enc_0.1-3
[6] bitops_1.0-6 tools_3.5.0 digest_0.6.15 jsonlite_1.5 evaluate_0.10.1
[11] memoise_1.1.0 tibble_1.4.2 pkgconfig_2.0.1 rlang_0.2.1 graph_1.58.0
[16] curl_3.2 yaml_2.1.19 parallel_3.5.0 bindrcpp_0.2.2 stringr_1.3.1
[21] withr_2.1.2 httr_1.3.1 gtools_3.5.0 caTools_1.17.1 rprojroot_1.3-2
[26] stats4_3.5.0 tidyselect_0.2.4 glue_1.2.0 R6_2.2.2 XML_3.98-1.11
[31] rmarkdown_1.10 RJSONIO_1.3-0 gdata_2.18.0 purrr_0.2.5 magrittr_1.5
[36] backports_1.1.2 htmltools_0.3.6 BiocGenerics_0.26.0 assertthat_0.2.0 KernSmooth_2.23-15 [41] stringi_1.2.3

AlexanderPico commented 6 years ago

Hi Mark. If this is still problematic, can you provide a more details for your test case. I can run the lines provided just fine and expand/collapse and move nodes around, no problems. But I don't know how to

go into other networks labelled "Network_N" and move one or more nodes. Or try to expand the group while in one of those windows

What exactly do you mean here? Can you provide code to run or steps to follow?

m-grimes commented 6 years ago

Alex

I'll reply by email since GitHub doesn't like .Rmd files. The code in the attached vignette now works perfectly. But if in Cytoscape any nodes are moved in subnetworks (Network; Network_1, etc.) the subsequent attempts to do any operations causes both R and Cytoscape to hang. Cytoscape won't even quit, has to be forced to quit. Can you reproduce this?

Thanks much,

Mark

University of Montana

On 30 Jun 2018, at 13:29, Alexander Pico wrote:

Hi Mark. If this is still problematic, can you provide a more details for your test case. I can run the lines provided just fine and expand/collapse and move nodes around, no problems. But I don't know how to

go into other networks labelled "Network_N" and move one or more nodes. Or try to expand the group while in one of those windows

What exactly do you mean here? Can you provide code to run or steps to follow?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/cytoscape/RCy3/issues/29#issuecomment-401561450

AlexanderPico commented 6 years ago

This is working fine for me. I can get through the script, move nodes around (by click and drag) and then collapseGroup(). I expanded/collapsed and moved nodes a bunch of times in different orders and couldn't reproduce the error.

Try the latest version of RCy3 by running:

install.packages("BiocManager")
BiocManager::install("RCy3")

_You should see version RCy32.0.81 (skipped a few numbers on accident!)

Maybe there is a relevant fix?

Otherwise, we should confirm you Cytoscape version and then maybe disable apps you have installed. These (rarely) can cause odd bugs.

m-grimes commented 6 years ago

Did you try moving nodes in the sub-networks, not the main network?

Mark

University of Montana

On 2 Jul 2018, at 12:40, Alexander Pico wrote:

This is working fine for me. I can get through the script, move nodes around (by click and drag) and then collapseGroup(). I expanded/collapsed and moved nodes a bunch of times in different orders and couldn't reproduce the error.

Try the latest version of RCy3 by running:

install.packages("BiocManager")
BiocManager::install("RCy3")

Maybe there is a relevant fix?

Otherwise, we should confirm you Cytoscape version and then maybe disable apps you have installed. These (rarely) can cause odd bugs.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/cytoscape/RCy3/issues/29#issuecomment-401896391

AlexanderPico commented 6 years ago

Yes.

AlexanderPico commented 5 years ago

Ok. Last guess on this one... Go to Edit>Preferences>Group Preferences and UNCHECK "Show collapsed group nodes as Nested Networks". That is what generates the "Network_N" subnetworks and likely the cause of the errors. Nested networks is a feature that should have never existed in Cytoscape (in my opinion) and no good comes from using them. Try "Compound Node" view if you want to see the children nodes. See screenshot.

screen shot 2018-09-13 at 9 57 05 pm
m-grimes commented 5 years ago

Alex

You have identified the problem: the nested networks makes for pretty grouped node icons but the nests can't be touched - some sort of java beehive is unleashed. I was able to reproduce the crash and avoid the crash by turning off "Show collapsed node as Nested Network." Enable attribute aggregation had no effect either way.

THanks!

Mark

On 13 Sep 2018, at 23:00, Alexander Pico wrote:

Ok. Last guess on this one... Go to Edit>Preferences>Group Preferences and UNCHECK "Show collapsed group nodes as Nested Networks". That is what generates the "Network_N" subnetworks and likely the cause of the errors. Nested networks is a feature that should have never existed in Cytoscape (in my opinion) and no good comes from using them. Try "Compound Node" view if you want to see the children nodes. See screenshot.

<img width="634" alt="screen shot 2018-09-13 at 9 57 05 pm" src="https://user-images.githubusercontent.com/1418193/45530609-71669a00-b7a0-11e8-8399-1717c1de78bb.png">

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/cytoscape/RCy3/issues/29#issuecomment-421231582