tmuetze / Bioconductor_RCy3_the_new_RCytoscape

Update RCytoscape to work for Cytoscape 3.0 and higher using CyREST
16 stars 10 forks source link

graph error with 99.6 #13

Closed m-grimes closed 9 years ago

m-grimes commented 9 years ago

This issue was posted under 99.2 and persists under 99.6. A graph is created in Cy but node and edge attributes are lost and an error is returned. Some functions work (see below) but return new errors that I have not seen before like .

k1.g2 A graphNEL graph with directed edges Number of Nodes = 56 Number of Edges = 44

k1.w2 <- CytoscapeWindow("Case 1 CCCN", k1.g2) Cytoscape window named 'Case 1 CCCN' does not exist yet nodes have no label attribute -- adding default labels New window named "Case 1 CCCN" was created in Cytoscape. displayGraph(k1.w2) estimated displayGraph time: 1.0 seconds adding 56 nodes... sending 56 node(s) sendNodes completed adding 44 edges... transforming (44) graph edges to nodePairTable sending 44 edges adding node attributes... [1] "Gene.Name" Error in getAllNodes(cw) : error in evaluating the argument 'obj' in selecting a method for function 'getAllNodes': Error: object 'cw' not found layoutNetwork(k1.w2, "kamada-kawai") sessionInfo() R version 3.2.0 (2015-04-16) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.10.3 (Yosemite)

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] parallel stats4 grid stats graphics grDevices utils datasets [9] methods base

other attached packages: [1] RCy3_0.99.6 ...

getAllNodes(k1.w2) [1] "BCR p 177" "EPHA2 p 575" "EPHA2 p 593"
[4] "PRKDC p 2609" "MAPK13 p 182" "PRKCD p 313"
[7] "CTNNB1 p 716" "PRPF4B p 839" "EGFR p 869"
[10] "EGFR p 1197" "EGFR p 1110" "EGFR p 995"
[13] "MAP4K4 p 467" "CDK1 p 19" "CDK1 p 14"
[16] "ERBB3 p 1248" "ERBB3 p 1269" "BRAF p 447"
[19] "ARHGAP35 p 1106" "FRK p 46" "MET p 1021"
[22] "MET p 1252" "DYRK2 p 309" "MAPK14 p 182"
[25] "TYK2 p 292" "TNK2 p 905" "TNK2 p 937"
[28] "MAPK1 p 187" "EPHB4 p 774" "MAPK3 p 204"
[31] "PTK6 p 447" "LYN p 32" "LYN p 306"
[34] "LYN p 397" "APP p 626" "CDKL5 p 171"
[37] "MAPK7 p 82" "DDR1 p 484" "ICK p 159"
[40] "EPHA2 p 892;897" "EPHA2 p 593;594" "MAPK14 p 180;182"
[43] "PRPF4B p 839;849" "DYRK1A p 312;315" "PEAK1 p 635;641"
[46] "CDK1 p 14;15" "TNK2 p 937;938" "PTK2B p 579;580"
[49] "RUNX1 ack 39" "GTF2F1 ack 407" "TRIM25 kme 437"
[52] "ZNF326 rme 175" "BTF3 rme 19" "ILF3 rme 609"
[55] "YBX1 rme 192" "FUBP1 rme 358;360;362"

selectNodes(k1.w2, k1.cf[k1.cf$nodeType=="transcription factor", "Peptide.Name"], preserve=FALSE) setNodeShapeDirect(k1.w2, getSelectedNodes(k1.w2),rep("PARALLELOGRAM", length(getSelectedNodes(k1.w2)))) Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1807] Date: 2015-05-19 08:22 Status: 200 Content-Type:

Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1819] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1835] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1849] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1851] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1852] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1853] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1854] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1855] Date: 2015-05-19 08:22 Status: 200 Content-Type: Response [http://localhost:1234/v1/networks/1789/views/1799/nodes/1856] Date: 2015-05-19 08:22 Status: 200 Content-Type: Warning message: In if (new.shapes %in% getNodeShapes(obj)) { : the condition has length > 1 and only the first element will be used rep("PARALLELOGRAM", length(getSelectedNodes(k1.w2)) - ) [1] "PARALLELOGRAM" "PARALLELOGRAM" "PARALLELOGRAM" "PARALLELOGRAM" "PARALLELOGRAM" [6] "PARALLELOGRAM" "PARALLELOGRAM" "PARALLELOGRAM" "PARALLELOGRAM" "PARALLELOGRAM"
tmuetze commented 9 years ago

I corrected the first error. It is a typo instead of obj, we accidentally wrote cw (the standard Cytoscape example window that we use for testing).

The statement: "Response [http://localhost:1234" seems to be a left over from previous print statements (as part of testing) that are removed in my version and the line runs fine as well. Would you mind sending me the R script you are using along with the underlying data, so I could try to see what happened?

The function getSelectedNodeCount gives you the number of selected nodes directly.