Cytoscape - Different columns of weights to Source node and Target Node

418 views
Skip to first unread message

Alperen Taciroglu

unread,
Dec 31, 2015, 10:59:10 AM12/31/15
to cytoscape-discuss

I have a data of four columns. One is target column, the other one is source column. Other two columns are meant to be weights (that will alter the size of the nodes). One weight column is for target nodes and the other weight column is for source nodes.

When I load the data to cytoscape (using cytoscape 3.3.0), I label columns as Target Node, Source Node, Target Node Attribute and Source Node Attribute respectively. However my columns mix up in the tabel panel as name and shared name. And I cannot change the size of the target nodes and source nodes according to their weight columns in the control panel, style tab.

I also would like to color target nodes and source nodes differently to separate them. Can anyone help me out with this ? Thanks in advance.


P.S - I posted this question to Stackoverflow also. 

http://stackoverflow.com/questions/34529043/cytoscape-different-columns-of-weights-to-source-node-and-target-node

Scooter Morris

unread,
Dec 31, 2015, 1:23:30 PM12/31/15
to cytoscap...@googlegroups.com
On 12/31/15 2:57 AM, Alperen Taciroglu wrote:

I have a data of four columns. One is target column, the other one is source column. Other two columns are meant to be weights (that will alter the size of the nodes). One weight column is for target nodes and the other weight column is for source nodes.

When I load the data to cytoscape (using cytoscape 3.3.0), I label columns as Target Node, Source Node, Target Node Attribute and Source Node Attribute respectively. However my columns mix up in the tabel panel as name and shared name. And I cannot change the size of the target nodes and source nodes according to their weight columns in the control panel, style tab.

That is exactly what is supposed to happen.  name and shared name refer to the name of a node -- there is no way to distinguish between a Source Node and a Target Node since a single node could be both source and target.  As far as the weight columns -- when you import them, what does Cytoscape list as the type of the column?  It has to be a numeric type in order to be able to use it for a passthrough or a continuous map.

I also would like to color target nodes and source nodes differently to separate them. Can anyone help me out with this ? Thanks in advance.

You would need to add another column with the particular type of node and then use that in a discrete color map to choose your colors.

-- scooter
--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.

Alperen Taciroglu

unread,
Jan 2, 2016, 9:40:09 AM1/2/16
to cytoscape-discuss
Thanks a lot for your reply. 

My weight columns are listed as double. I dont understand how will I select a specific column (say Target Nodes) and change the size of the Target Nodes only according to this double type (weight) column. And I need to do the same for the source nodes as well.

Target Nodes Source Nodes                        Source Attributes            Target Attributes   Source - color?
FAM102A hsa-miR-665 -6.7320388073 216.9489152057   hsa-miR-665
FAM102A hsa-miR-20a-5p -865.2636165143 216.9489152057   hsa-miR-20a-5p
FAM102A hsa-miR-140-5p -11.0025726429 216.9489152057   hsa-miR-140-5p
....
..
I couldnt quite understand how to change the color of the Target and Source nodes either. Am I supposed to add an exact same column (like in the Source - color column) to change the specific nodes ? Thanks a lot

Scooter Morris

unread,
Jan 2, 2016, 9:58:39 AM1/2/16
to cytoscap...@googlegroups.com
Hi Alperen,
    OK, first, you need to name your Source Attributes and Target Attributes columns something like Weight and you only need one color column:

Target Nodes      Source Nodes      Weight          Weight          Target
FAM102A           hsa-miR-665     -6.7320388073     216.9489152057  1
FAM102A           hsa-miR-20a-5p  -865.2636165143   216.9489152057  1
FAM102A           hsa-miR-140-5p  -11.0025726429    216.9489152057  1

When you import them, you'll need to designate which Weight Column goes to the source nodes and which go to the target, and the same with the Target column.  Then they will get appropriately assigned.  If you assign "Target" to be a Target Attribute, then only the Target Nodes will have 1.  You can then use a discrete mapper to color any nodes with a 1 there to a color and all other nodes to another color.

-- scooter

Alperen Taciroglu

unread,
Jan 2, 2016, 12:01:21 PM1/2/16
to cytoscape-discuss
I am sorry for asking questions repeatedly.
I could successfully change the size of the target or source column but not both of them at the same time. I was also able to find a discrete mapper option under Node/Style/Fill color but that colors all of the nodes at the same time. Not target and source nodes separately unfortunately. If you havent got tired of answering my questions I would appreciate a little bit more help. Thanks

Scooter Morris

unread,
Jan 2, 2016, 4:29:48 PM1/2/16
to cytoscap...@googlegroups.com
On 01/02/2016 09:01 AM, Alperen Taciroglu wrote:
I am sorry for asking questions repeatedly.
I could successfully change the size of the target or source column but not both of them at the same time. I was also able to find a discrete mapper option under Node/Style/Fill color but that colors all of the nodes at the same time. Not target and source nodes separately unfortunately. If you havent got tired of answering my questions I would appreciate a little bit more help. Thanks
No problem.  Note that I used "Weight" twice.  You need to wind up with a single column named Weight (even though you have two in the input).  You'll make one column to your Source Nodes and one column to your Target Nodes.  That way all nodes will have a single value and you can use that for your node size.  As far as Color, you need something to use for the discrete mapper, which is why I added the "Target" column.  You should configure that as a "Target node attribute".  When it's imported, all of your target nodes will have "1" in that column and all of your source nodes will be blank.   You can use that column for your discrete mapper.

-- scooter

Alperen Taciroglu

unread,
Jan 5, 2016, 4:21:15 AM1/5/16
to cytoscape-discuss
Thanks a lot. Great help
Reply all
Reply to author
Forward
0 new messages