enhancedGraphics app & R programming

14 views
Skip to first unread message

arya...@gmail.com

unread,
Sep 9, 2018, 8:17:57 PM9/9/18
to cytoscape-helpdesk
Hi,

I have a problem with set a chart for nodes of graph in Cytoscape by R coding.
Could you please guide me about it by an sample code?

Thanks,
Y.Aryan

Alex Pico

unread,
Sep 9, 2018, 8:22:13 PM9/9/18
to cytoscape...@googlegroups.com
Hi Y,

Here’s how you’d do it using setVisualPropertyDefault().  Obviously, I’d like to create a dedicated function to make this easier to use, but this should work to make a bar chart, for example, in the meantime:

style.name = 'default'
barchart =  list(cyrange = c(-2.426,3.126), cy_colors = c("#FF00FF","#8000FF","#00FF00"),cy_dataColumns = c("gal1RGexp","gal4RGexp","gal80Rexp"))
style.string = list(visualProperty = "NODE_CUSTOMGRAPHICS_1", value = paste("org.cytoscape.BarChart",toJSON(barchart),sep = ":"))
setVisualPropertyDefault(style.string, style.name)

You need to specify the min and max values in ‘cyrange’ and then pair the colors and columns you want in “cy_colors” and “cy_dataColumns”.  Keep everything else the same and it should set the "Image/Chart 1” in the default style. Ah, and you’ll need to install/library the RJSONIO package for toJSON().

 - 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 post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-helpdesk/1ec4538a-d65d-4463-a8e5-42968df28f08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

yalda Aryan

unread,
Sep 10, 2018, 2:31:09 AM9/10/18
to cytoscape...@googlegroups.com
Hi Alex,

Thank you very much for your help and code.
May you be always prosperous and healthy.

Y.Aryan

You received this message because you are subscribed to a topic in the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cytoscape-helpdesk/M0jk88jN9qY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cytoscape-helpd...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
Reply all
Reply to author
Forward
0 new messages