How do I change color/shape of source nodes and target nodes

3 358 vues
Accéder directement au premier message non lu

Phil

non lue,
5 oct. 2009, 16:38:4505/10/2009
à cytoscape-helpdesk
Dear Cytoscape,

I would like to have my source nodes be a different shape or color
than my target nodes.

How do I do that ?

Best,

Phil

Alexander Pico

non lue,
5 oct. 2009, 17:17:4805/10/2009
à cytoscape...@googlegroups.com
Hi Phil,

What you want to do is create an attribute (e.g., called "node_type") and
then annotate your nodes with "source" or "target". You can then assign
these attribute values to any visual property that pleases you (e.g., node
shape or color).

There are a few approaches you could take to perform the annotation,
depending on exactly what you are working with:

1. Create an attribute table in excel and then import it.
2. Create the attribute directly in the DataPanel and then use filters to
select sources and targets separately. Here are the steps for this approach:
A. Go to the Filters tab in the Panel 1
B. Create a new Topology Filter: use the defaults and click Apply. You
should see all nodes selected.
C. Create new Edge Interaction Filter: use your Topology Filter and
click Apply. Again, you should now see all edges selected.
D. Create new Node Interaction Filter: use Edge Filter and select either
"source" or "target" and click apply. This will give you a way to select
nodes based on whether they are a source or a target.
E. When selected, you can use the Attribute Batch Editor to set all
"node_type" attributes to "source" or "target".

Convoluted but gets the job done. Note: Depending on your network, you may
have nodes that are *both* sources and targets via different interactions.
In this case you may want to use two separate attributes that you can assign
to different visual properties, or specify "source", "target", or "both",
and use three different shapes or colors.

- Alex

Moffitt Cancer Center

non lue,
6 oct. 2009, 10:46:0406/10/2009
à cytoscape-helpdesk
Would you happen to have an excel file that demonstrates how exactly
you would annotate the attributes? If so, can you copy/paste it here?
In the manual it gives some examples of what cytoscape can do, but it
does not tell you how to create it. Below you state "create an excel
file for attributes." How exactly is that done? How would you specify
color? What goes in what cell in the speadsheet? If you wouldn't mind,
could you spell it out for me? I have been struggling a lot with this
over the past week!

Thanks!

michael

Peng-Liang Wang

non lue,
6 oct. 2009, 12:42:2806/10/2009
à cytoscape...@googlegroups.com
Hi,
 
The easiest way is to use the filter to select the Source/Target/Both and define a new attribute 'node_type'. If you find this is hard, then use NodeAttribute file manually.

Here is an sample NoteAttribute file, http://cytoscape.org/nature.protocols/galGeneNames.csv

In your file, your file should have the column header like

node_id      node_type
YHR051W  Source
YHR124W Target

Use Import->Node Attribute to import the new Node attribute.

As soon as you have this new attribute, you can then use visual style to map the node_type attribute to what ever visual style you like.
 
 
Peng

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message