cytoscape / RCy3

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

"Degree" calculation looks strange #204

Closed Guerande29 closed 1 year ago

Guerande29 commented 1 year ago

Hello, I got the network with WGCN, use RCy3 to import the networks to cytoscape. Then I do the network analysis to get the "degree", but something is strange. I get the same degree for the whole table and I don't understand if I'm doing something wrong in cytoscape or in the R studio code.

Any ideas about it? thank you so much

R version 4.2.3 (2023-03-15 ucrt) -- "Shortstop Beagle" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)

cytoscapeVersionInfo () apiVersion cytoscapeVersion "v1" "3.10.0"

edges have these colums: fromNode toNode weight direction fromAltName toAltName

image

nodes have these columns: nodeName altName nodeAttr[nodesPresent, ]

image

code:

library(RCy3) cytoscapePing () # make sure cytoscape is open cytoscapeVersionInfo ()

cytoscapeVersion "3.10.0"

################################################################################# ####### Module paleturquoise ############ #################################################################################

use the connection with Cytoscape through the 'RCy3' package

loading file from cyt

edge <- read.delim("merge_CytoscapeInput-edges-paleturquoise.txt") colnames(edge)

it need to modify colnames

colnames(edge) <- c("source", "target", "weight", "direction","fromAltName", "toAltName")

node <- read.delim("merge_CytoscapeInput-nodes-paleturquoise.txt") colnames(node)

it need to modify colnames

colnames(node) <- c("id" , "altName", "node_attributes")

createNetworkFromDataFrames(node,edge[1:273,], title="paleturquoise network", collection="DataFrame paleturquoise")

use other pre-set visual style

setVisualStyle('Marquee')

set up my own style

style.name = "myStyle" defaults <- list(NODE_SHAPE="ellipse", NODE_SIZE=30, EDGE_TRANSPARENCY=120, NODE_LABEL_POSITION="W,E,c,0.00,0.00") nodeLabels <- mapVisualProperty('node label','id','p') nodeFills <- mapVisualProperty('node fill color','node_attributes','d',c("A","B"), c("#FF9900","#66AAAA")) arrowShapes <- mapVisualProperty('Edge Target Arrow Shape','interaction','d',c("activates","inhibits","interacts"),c("Arrow","T","None")) edgeWidth <- mapVisualProperty('edge width','weight','p')

createVisualStyle(style.name, defaults, list(nodeLabels,nodeFills,arrowShapes,edgeWidth)) setVisualStyle(style.name)

Cytoscape: selecting ntw - Tools - Analyze network - (my graph is indirected) -

Table results:

image

Thank you very much

AlexanderPico commented 1 year ago

Answered here: https://support.bioconductor.org/p/9152344/