How to create a weighted network..

3,922 views
Skip to first unread message

Daniel

unread,
Jun 5, 2011, 11:12:03 AM6/5/11
to cytoscape-discuss
Hi all,

I hope anybody could help me with this. I have searched the internet
looking for a way to build up a weighted network with Cytoscape, but
the only thing I found is some layouts for weighted networks but
nothing on how to create them. I also read that the weight could be
imported as parameter for nodes and edges, but never mentioned how to
do so.

Does anybody know how to create a weighted network with Cytoscape? It
shoud be great to have a plugin to create a network from an adjacency
matrix, but any other way you may know will be great.

Thanks in advance.

Regards,

Daniel.

Sebastian Wiese

unread,
Jun 6, 2011, 4:03:36 AM6/6/11
to cytoscap...@googlegroups.com
Hi,

The shortest way to create a weighted network would be something along
teh following path.

1. You need to create a Matrix with the source and target node and the
parameter on which the weighting will be based. You could create the
matrix either in a TAB-delimited textfile or as a Excel-Sheet. When
using Excel you have to save as Version 1997-2003 as .xlsx files won't
work. In addition, formulas in this Excel sheet won't work either,
convert them to values.

The Matrix should look like something like this:

Bait Interaction Prey
ProtA 125 ProtC
ProtB 300 ProtA
...

2. In Cytoscape, klick on File/Import/Network from Table

3. Follow instructions and select column Interaction as Interaction
Type. Your interaction data must be a numerical value, either Integer or
float. Klick import. Cytoscape should create a network with your data.

4. Klick Layout/Cytoscape Layout/edge-weighted layout/Your edge attribute

5. This should result in a weighted Network based on your input data.

Yours Sebastian


--
---

Dr. Sebastian Wiese

Functional Proteomics / AG Warscheid
Institut f�r Biologie II
Alberts-Ludwigs Universit�t Freiburg

Sch�nzlestr. 1
79104 Freiburg

Tel.: +49 761/203-2693
Fax: +49 761/203-2601

dim hmmaros

unread,
Jan 22, 2015, 6:55:13 AM1/22/15
to cytoscap...@googlegroups.com, sebasti...@biologie.uni-freiburg.de
Hi!how can i do this in cytoscape 3?i cant select my weight attributes as weights for any layout...

Scooter Morris

unread,
Jan 22, 2015, 11:28:15 AM1/22/15
to cytoscap...@googlegroups.com
Your attributes need to be numeric.  Make sure that when you imported your attributes they were imported as numeric values.

-- 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 http://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.

dim hmmaros

unread,
Jan 23, 2015, 11:30:24 AM1/23/15
to cytoscap...@googlegroups.com
how can i import the attributes as numeric in cytoscape 3?i cant find any option?they are imported as string all the time.
i need them to be numeric(float) because i need to find the edge betweenness with weights...

Scooter Morris

unread,
Jan 23, 2015, 12:15:31 PM1/23/15
to cytoscap...@googlegroups.com
Looks like you are selecting your weights as "Interaction".  Interaction is actually a string that represents the type of interaction.  Instead, just select Source and Target and then click on the column header for your weight (it should turn blue).  Then it should import as a numeric.

-- scooter

dim hmmaros

unread,
Jan 23, 2015, 1:47:42 PM1/23/15
to cytoscap...@googlegroups.com
realy thank you!!this works!!!sorry but im newbie an i try to learn this program!!

Scooter Morris

unread,
Jan 23, 2015, 2:27:56 PM1/23/15
to cytoscap...@googlegroups.com
On 01/23/2015 10:47 AM, dim hmmaros wrote:
realy thank you!!this works!!!sorry but im newbie an i try to learn this program!!
Great!  Glad to hear it worked for you.

-- scooter

Suchetana Gupta

unread,
Mar 16, 2015, 8:34:56 AM3/16/15
to cytoscap...@googlegroups.com
Hi
I did exactly what you guys said. I have an excel file where columns 1 and 3 contain nodes and column 2 contains edge weight. Yet whenever i calculate network parameters using network analyzer in cytoscape 3.2.0, i still get the same results as i was getting without specifying the edge weight. But the values of some parameters like Characteristic path length should change with a weighted and an unweighted network. How do i go about it? Any help is appreciated. Thanks
Suchetana

piet molenaar

unread,
Mar 16, 2015, 8:41:52 AM3/16/15
to Cytoscape-Discuss
Hi, can you check whether the data in the edge column is actually imported as a numeric value?
Hovering over the column header in the datatable will show an info box containing the Type of data.
Cheers, 
Piet

--
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.



--
Piet Molenaar
piet...@gmail.com
Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

Suchetana Gupta

unread,
Mar 16, 2015, 9:08:07 AM3/16/15
to cytoscap...@googlegroups.com
It is appearing as String


On Sunday, June 5, 2011 at 8:42:03 PM UTC+5:30, Daniel wrote:

piet molenaar

unread,
Mar 17, 2015, 4:35:14 AM3/17/15
to Cytoscape-Discuss
So that is the problem; String means text values and only numeric values like float and integer can be used for calculation. You'd best verify your data and look whether no whitespace characters or text is present in your data column.
Hope this helps,
Piet

--
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.

Suchetana Gupta

unread,
Mar 17, 2015, 5:07:45 AM3/17/15
to cytoscap...@googlegroups.com

Thanks. But does Cytoscape give a weighted network? It didn't appear so. I tried with small sets of values. ANy clue what can be done? I need to calculate CPL.

On Sunday, June 5, 2011 at 8:42:03 PM UTC+5:30, Daniel wrote:

piet molenaar

unread,
Mar 17, 2015, 5:11:49 AM3/17/15
to Cytoscape-Discuss
Since you didn't provide numeric values (at least they weren't recognized as such) the calculation will not be performed.
If you send your small set of values I can check what's wrong with your data.

--
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.

Suchetana Gupta

unread,
Mar 19, 2015, 9:30:47 AM3/19/15
to cytoscap...@googlegroups.com

Hi
I am using the Centiscape app in Cytoscape. I believe I am getting a weighted network. I am calculating the average path length. I have two questions:
1. Is the average path length the same as the characteristic path length (CPL)? (seemed so from the definition, but wanted a confirmation). I was getting values like 8.5 for the unweighted network CPL using Network Analyzer and using Centiscape, I am getting values of Average path length as 0.94. Am I getting correct values?
2. For certain networks, I am getting an average path length value negative. (May I add in this context that some of the edge weights are negative in the network). Is this a mistake or does it hold any significance? 

I'd be grateful for any enlightenment in this regard.
Thanks
Suchetana
Reply all
Reply to author
Forward
0 new messages