edges style and outline color

136 views
Skip to first unread message

Steven Blanchard

unread,
Jun 6, 2022, 4:50:18 PM6/6/22
to cytoscape-helpdesk
Hello,

I create a metabolic network with networkx and then the results are exported in gml format to be visualized in CytoScape.
The arguments outline for nodes and style for edges do not seem to be taken into account by cytoscape.

Are these arguments not used by cytoscape for the gml format or should I give them otherwise?


My gml files :
graph [
  directed 1
  node [
    id 0
    label "CPD-12118"
    graphics [
      fill "blue"
      type "rectangle"
      x 2720.1
      y 18.0
    ]
    common_name "demethylmenaquinol-9"
  ]
  node [
    id 1
    label "RXN-9204_L2R"
    graphics [
      fill "purple"
      type "octagon"
      outline "black"
      x 2720.1
      y 90.0
    ]
    name "RXN-9204"
    common_name "RXN-9204_L2R"
  ]
  edge [
    source 0
    target 1
    graphics [
      fill "green"
      targetArrow "standard"
      style "dotted"
    ]
  ]
]

Thanks,
Regards,

Steven

Alex Pico

unread,
Jun 6, 2022, 4:57:16 PM6/6/22
to Cytoscape Helpdesk
Hi Steven,

I pasted you gml into a file and imported it into Cytoscape and got a styled network. It appears to match the code (at first glance). Are you seeing the same thing? Is there a specific attribute that is not working?

 - Alex





--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-helpdesk/318f911a-3c01-4839-b102-1d1bf753094bn%40googlegroups.com.

Alex Pico

unread,
Jun 6, 2022, 5:00:07 PM6/6/22
to Cytoscape Helpdesk
Ah, you mentioned “outline” for nodes and “style” for edges. I had to reread that sentence a few times to understand it :)

Let me dig further...

 - Alex






On Jun 6, 2022, at 1:57 PM, Alex Pico <alex...@gladstone.ucsf.edu> wrote:

Hi Steven,

I pasted you gml into a file and imported it into Cytoscape and got a styled network. It appears to match the code (at first glance). Are you seeing the same thing? Is there a specific attribute that is not working?

 - Alex


<Screen Shot 2022-06-06 at 1.54.21 PM.png>


Alex Pico

unread,
Jun 6, 2022, 5:11:02 PM6/6/22
to Cytoscape Helpdesk
Ok. In order for the node border (or outline) to show, you also have to specify a width, e.g.:

      outline "black"
      width 5.0

I tried a few things to get edge “style” to work, but nothing worked. You can control thickness with “width” and color (as you’ve done) with “fill”, but that’s it.

 - Alex




Alex Pico

unread,
Jun 6, 2022, 5:28:40 PM6/6/22
to Cytoscape Helpdesk
And if you’re working with networkx in Python, then I’d recommend our https://pypi.org/project/py4cytoscape/ package, which lets you control all aspects of Cytoscape (including all style options) from your Python script.

My typical workflow is thus to convert from networkx (or graphNEL or igraph, etc) to Cytoscape with only the nodes, edges and attributes. And then I do all the layout and styling in Cytoscape. This works in Python or R (using https://bioconductor.org/packages/release/bioc/html/RCy3.html). 

 - Alex






On Jun 6, 2022, at 2:10 PM, Alex Pico <alex...@gladstone.ucsf.edu> wrote:

Ok. In order for the node border (or outline) to show, you also have to specify a width, e.g.:

      outline "black"
      width 5.0

I tried a few things to get edge “style” to work, but nothing worked. You can control thickness with “width” and color (as you’ve done) with “fill”, but that’s it.

 - Alex


<Screen Shot 2022-06-06 at 2.08.41 PM.png>


Steven Blanchard

unread,
Jun 7, 2022, 2:32:52 AM6/7/22
to cytoscape-helpdesk
Thanks you for all your reply.
I will try our advices.

Steven
Reply all
Reply to author
Forward
0 new messages