how can i view protein and rna in different color or shape

64 views
Skip to first unread message

Sachin

unread,
Feb 15, 2017, 5:41:37 AM2/15/17
to cytoscape-app-dev
Hi all
 
i want to view the protein and rna nodes into different color or shape or style.

How can i view the node of protein and rna in different color or shape in the network view. using a code.


Thank you.

Barry Demchak

unread,
Feb 16, 2017, 2:35:46 PM2/16/17
to cytoscape-app-dev
Hi --

This is a normal question for an app developer to ask ... thanks for asking it. I'd like to point you to two important resources for this question and many others likely to come up. This is a list of many questions and answers like yours:


Additionally, the App Ladder references this and other useful materials ... if you're not following the App Ladder development process, I can recommend it:


Does this help??

srikanth bezawada

unread,
Feb 16, 2017, 2:52:03 PM2/16/17
to Sachin, cytoscape-app-dev
Hi Sachin,

You can try this.

CyNetworkView netView; // Get CyNetworkView
List<CyNode> proteinNodes; // Fill this list with protein nodes
List<CyNode> rnaNodes; // Fill with rna nodes List<CyNode> nodeList; // all the nodes in the current network for(CyNode node : nodeList) {
if(rnaNodes.contains(node)) {
netView.getNodeView(node).setVisualProperty(BasicVisualLexicon.NODE_FILL_COLOR, Color.ORANGE);
netView.getNodeView(node).setVisualProperty(BasicVisualLexicon.NODE_SHAPE, NodeShapeVisualProperty.OCTAGON);
}
}


// Similarly for edges, as given below
// netView.getEdgeView(edge).setVisualProperty(BasicVisualLexicon.EDGE_STROKE_UNSELECTED_PAINT, Color.ORANGE);

Thanks,
Srikanth.

--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-dev+unsubscribe@googlegroups.com.
To post to this group, send email to cytoscape-app-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-app-dev/6ef7e462-acd1-4899-8db0-5c984cc9a319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sachin

unread,
Feb 17, 2017, 1:10:45 AM2/17/17
to cytoscape-app-dev, sach...@gmail.com
Thank you..Srikanth


Sachin

unread,
Feb 17, 2017, 1:12:17 AM2/17/17
to cytoscape-app-dev
Thank you. Barry..

javad t

unread,
Jul 19, 2021, 6:02:23 PM7/19/21
to cytoscape-app-dev
  Hi  Srikanth,
I'm new to cytoscape and I'm trying to build a ceRNA network app for cytoscape.
In my app, I read 7 files from user about mRNA, circRNA, lncRNA and miRNA's expression data and their interactions.
I did some work on files and now I hava all nodes and edges needed for my ceRNA network. 

I need different shapes for each  mRNA, circRNA, miRNA and lncRNA nodes.

now I have problem for creating nodes, edges and finally my network.

How can I create nodes and edges in cytoscape app (depend on user input file, I have many nodes and edges)?
Can you please help me or introduce some documentation or sample codes?

Thank you,
Javad


On Thursday, February 16, 2017 at 11:22:03 PM UTC+3:30 srikanth.5283 wrote:
Hi Sachin,

You can try this.

CyNetworkView netView; // Get CyNetworkView
List<CyNode> proteinNodes; // Fill this list with protein nodes
List<CyNode> rnaNodes; // Fill with rna nodes List<CyNode> nodeList; // all the nodes in the current network for(CyNode node : nodeList) {
if(rnaNodes.contains(node)) {
netView.getNodeView(node).setVisualProperty(BasicVisualLexicon.NODE_FILL_COLOR, Color.ORANGE);
netView.getNodeView(node).setVisualProperty(BasicVisualLexicon.NODE_SHAPE, NodeShapeVisualProperty.OCTAGON);
}
}


// Similarly for edges, as given below
// netView.getEdgeView(edge).setVisualProperty(BasicVisualLexicon.EDGE_STROKE_UNSELECTED_PAINT, Color.ORANGE);

Thanks,
Srikanth.

On Wed, Feb 15, 2017 at 2:41 PM, Sachin <sach...@gmail.com> wrote:
Hi all
 
i want to view the protein and rna nodes into different color or shape or style.

How can i view the node of protein and rna in different color or shape in the network view. using a code.


Thank you.

--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages