Reloading the data into the same network

162 views
Skip to first unread message

Dima

unread,
Oct 16, 2018, 6:52:35 AM10/16/18
to cytoscape-helpdesk
Hi!I

have an automated routine which is constantly recalculating a network and then importing it into Cytospace to generate network maps - I impulse nodes and edges as csv tabs - all values load fine - even node direction  - BUT THE ARROWS DO NTO UPDATE - even after I refresh the network - all labels load fine, colors as well - but for some reason the direction of the arrows stays the same - what could be wrong??

Dima

Dima

unread,
Oct 16, 2018, 7:01:29 AM10/16/18
to cytoscape-helpdesk
arrow direction looks to be set in stone - I tried to modify all table columns and the arrow still point in the oiriginal erroneous direction...

Dima

unread,
Oct 16, 2018, 7:27:51 AM10/16/18
to cytoscape-helpdesk
I need to add that this is a directed network - cannot edge direcitons be reimported into an existign netwrok??


On Tuesday, October 16, 2018 at 1:52:35 PM UTC+3, Dima wrote:

Dima

unread,
Oct 16, 2018, 10:00:57 AM10/16/18
to cytoscape-helpdesk
Here is an example of the columns which describe the edges

when I change first line to EUR USD - the arrow does nto chnage direciton - can you help me understand why?


ID Node1 Node2
1 USD EUR
2 USD GBP
3 CHF USD
4 JPY USD

Dima

unread,
Oct 16, 2018, 2:09:28 PM10/16/18
to cytoscape...@googlegroups.com
Can someone please help? this is so very urgent!

Ruth Isserlin

unread,
Oct 16, 2018, 2:18:38 PM10/16/18
to cytoscape...@googlegroups.com
Hi Dima, 
I am not sure what the issue is.  You are loading in the network through a script  and everything but the arrow head is showing up? by default the target arrow head and source arrow head are set to be nothing.  Have you tried changing the target arrow head to an arrow?
Screen Shot 2018-10-16 at 2.16.45 PM.png
Thanks, 
Ruth 


On Tue, Oct 16, 2018 at 2:09 PM Dima <sema...@gmail.com> wrote:
Can someone please hlpe? this is so very urgent!

--
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/7da9ea6c-8e52-4b86-82a0-f735876f33eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Pico

unread,
Oct 16, 2018, 2:21:25 PM10/16/18
to cytoscape-helpdesk
Hi Dima,

I have a few minutes I can offer today to help. To be most efficient, it would be best if you could provide more specific examples of the automation that I can simply run, diagnose and debug.  Are you doing this in R or Python or as a bash script?  Can you provide examples of the script that doesn't work as expected?

 - Alex

David Otasek

unread,
Oct 16, 2018, 2:32:21 PM10/16/18
to cytoscape-helpdesk
Hi Dima,

In Cytoscape, multiple edges can exist between nodes. Is it possible that you're creating multiple edges (for example: USD -> EUR and EUR -> USD)?

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

Dima

unread,
Oct 16, 2018, 2:35:43 PM10/16/18
to cytoscape...@googlegroups.com
Hello Ruth and Alex - thank you for your kidn replies - I am importing data as tables - automaticlly - via a script which automates mouse movements - so it can be considered manually) I have two columns which show node1 and node2  and as I understand arrow direction depends on which node is named in node 1 (source) - right? node2 is destination - so my model recalculates the network and imports this as table and I now have different order or the nodes - was EUR USD - became USD EUR and arrow does not chnage to reverse direction from USD TO EUR - I am doign somethign wrong?

Dima

unread,
Oct 16, 2018, 2:41:01 PM10/16/18
to cytoscape-helpdesk
Thank you David but no - I have the same numebr of edges- tabels are imported - data overwritten but arrow direction stays the same((
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

Ruth Isserlin

unread,
Oct 16, 2018, 2:46:48 PM10/16/18
to cytoscape...@googlegroups.com

Hi Dima, 

it doesn't matter which direction you want to use. In the style tab, click on the edge tab(at the bottom of the tab) and set either the target arrow shape from none to the arrow or the source arrow shape to put the arrow heads on the network.


Do you want it to look like this:

Screen Shot 2018-10-16 at 2.44.25 PM.png

or like this:
Screen Shot 2018-10-16 at 2.44.49 PM.png

Ruth

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

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

David Otasek

unread,
Oct 16, 2018, 3:03:38 PM10/16/18
to cytoscape-helpdesk
Hi Dima,

Could you walk us step by step through the process by which you're loading these networks? Which menu options do you select, what do your files look like, what options do you select in the import dialogs, etc. It's very difficult to get an exact idea of what you're trying to do.

Generally, however, if you're loading by mouse script, you will be very limited in what you can reliably automate. I would advise you take Alex Pico's earlier advice and pick up one of the scripting languages he suggested.

Dima

unread,
Oct 16, 2018, 3:22:20 PM10/16/18
to cytoscape-helpdesk
yes Ruth I want them to show directed - the csv file shows this directio by node order - or how this should be done?
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

--
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-helpdesk+unsub...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.

Ruth Isserlin

unread,
Oct 16, 2018, 3:36:06 PM10/16/18
to cytoscape...@googlegroups.com

one column is treated as the source and other column is treated as the target.  The direction can be from the target to the source or the source to the target depending on where you put the arrow. It doesn't matter.   It is just important that the entire column of nodes is of one type.  If you wanted to show that there was a reciprocal relationship you would need to have:


Node1 Node2

A            B

B            A


I added the line:

5    USD     JPY


to your original table and now the network would look like:

Screen Shot 2018-10-16 at 3.34.40 PM.png

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

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

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

Dima

unread,
Oct 17, 2018, 2:15:32 AM10/17/18
to cytoscape...@googlegroups.com
Yes - I imported the table - it updated the node names in the source and direction column and the arrows did not update and example previously it was
USD NZD
arrows pointing from USD to NZD
now it is
NZD USD
arrows still pointing from USD to NZD

the table is loaded - data updated, but arrows stay as the previous network....

not sure why this happens - maybe because the network was ortriginally cretaed in an older version of Cytoscape?

even if I manually change source and target nodes  the arrows do not change direction....

you can see below that the arrow is pointing in the opporsite direciton:


arrow.png

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

--
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-helpdesk+unsub...@googlegroups.com.

--
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-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

Dima

unread,
Oct 17, 2018, 7:40:13 AM10/17/18
to cytoscape...@googlegroups.com
no idea why this happens? I tried to import tabels in the same network using 5 lower verions of Cyroscape -

3.6.0

3.5.1

3.5.0

3.4.0

3.3.0

3.2.1

3.2.0

and it still does not change arrow direction - what can I am doing whrong???

Dima

unread,
Oct 17, 2018, 10:02:51 AM10/17/18
to cytoscape-helpdesk
DO i UNDERSTAND THIS CORRECTLY - ONCE A NETWORK IS IMPORTED THE ARROW DIRECTION IS SET IN STONE AND SUBSEQUENT IMPORTS WILL NTO CHANGE THE ARROW DIRECTION?

Ruth Isserlin

unread,
Oct 17, 2018, 10:14:58 AM10/17/18
to cytoscape...@googlegroups.com
 no it is not set in stone.   Just open your style tab and change the arrow head on Target arrow shape from an arrow to none and change source arrow shape to an arrow. 

If this still doesn’t work for you then maybe I am misunderstanding the issue.  If you want you can send me your cytoscape session file and I try and fix the issue.

Change it from:


To:


On Oct 17, 2018, at 10:02 AM, Dima <sema...@gmail.com> wrote:

DO i UNDERSTAND THIS CORRECTLY - ONCE A NETWORK IS IMPORTED THE ARROW DIRECTION IS SET IN STONE AND SUBSEQUENT IMPORTS WILL NTO CHANGE THE ARROW DIRECTION?

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

Dima

unread,
Oct 17, 2018, 10:41:35 AM10/17/18
to cytoscape-helpdesk
Thank you very much for your kidn reply.....the thing is when I import the table it usually shwos the diferent direciton of the arrows......but cytoscape ignores this - even ifg it loads all the other parameters - please tell me where I can send the session file and the fiels to import?


On Wednesday, October 17, 2018 at 5:14:58 PM UTC+3, risserlin wrote:
 no it is not set in stone.   Just open your style tab and change the arrow head on Target arrow shape from an arrow to none and change source arrow shape to an arrow. 

If this still doesn’t work for you then maybe I am misunderstanding the issue.  If you want you can send me your cytoscape session file and I try and fix the issue.

Change it from:


To:
On Oct 17, 2018, at 10:02 AM, Dima <sema...@gmail.com> wrote:

DO i UNDERSTAND THIS CORRECTLY - ONCE A NETWORK IS IMPORTED THE ARROW DIRECTION IS SET IN STONE AND SUBSEQUENT IMPORTS WILL NTO CHANGE THE ARROW DIRECTION?

--
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-helpdesk+unsub...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.

Ruth Isserlin

unread,
Oct 17, 2018, 4:39:02 PM10/17/18
to cytoscape...@googlegroups.com
Hi Dima, 
I see now what your issue was.  I was trying to show you how you can fix the problem after it had occurred not trying to fix the underlying issue and you are right there is an issue.  Looks like a bug.

If I load your file with the following command specifying column 2 as the source and column 3 as the target

network import file indexColumnSourceInteraction=2 indexColumnTargetInteraction=3 file="/Users/risserlin/Downloads/EDGES_test.xlsx" startLoadRow=2


and then I run the exact same command but instead specify column 3 as the source and column 2 as the target

network import file indexColumnSourceInteraction=3 indexColumnTargetInteraction=2 file="/Users/risserlin/Downloads/EDGES_test.xlsx" startLoadRow=2


I should get opposite networks or networks where the only thing that is different is the direction of every edge. In cytoscape 3.6.1 they are exactly the same.  That I think is a bug.  Here are the resulting networks in cytoscape 3.6.1:

Screen Shot 2018-10-17 at 4.34.32 PM.png

The good news is that this is a bug but it looks like it is fixed in the latest version of cytoscape that is in beta release.  Here is what the networks look like using the exact same commands as above  in cytoscape 3.7:
Screen Shot 2018-10-17 at 4.36.08 PM.png

You can download this version of cytoscape here:

Thanks, 
Ruth 




On Wed, Oct 17, 2018 at 10:41 AM Dima <sema...@gmail.com> wrote:
Thank you very much for your kidn reply.....the thing is when I import the table it usually shwos the diferent direciton of the arrows......but cytoscape ignores this - even ifg it loads all the other parameters - please tell me where I can send the session file and the fiels to import?

On Wednesday, October 17, 2018 at 5:14:58 PM UTC+3, risserlin wrote:
 no it is not set in stone.   Just open your style tab and change the arrow head on Target arrow shape from an arrow to none and change source arrow shape to an arrow. 

If this still doesn’t work for you then maybe I am misunderstanding the issue.  If you want you can send me your cytoscape session file and I try and fix the issue.

Change it from:


To:
On Oct 17, 2018, at 10:02 AM, Dima <sema...@gmail.com> wrote:

DO i UNDERSTAND THIS CORRECTLY - ONCE A NETWORK IS IMPORTED THE ARROW DIRECTION IS SET IN STONE AND SUBSEQUENT IMPORTS WILL NTO CHANGE THE ARROW DIRECTION?

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

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

Alex Pico

unread,
Oct 17, 2018, 7:16:23 PM10/17/18
to cytoscape...@googlegroups.com
Also note that this works fine in both 3.6.1 and 3.7.0 via R, like so…

#Read in edge table (see attached file)
edges.data<-read.csv("/Users/alexpico/Desktop/edges.csv", stringsAsFactors = F)

#Define source and target, then create network
colnames(edges.data)<-c("ID","source","target”)
createNetworkFromDataFrames(edges = edges.data[,2:3])

#Now switch source and target, then create network
colnames(edges.data)<-c("ID","target","source”)
createNetworkFromDataFrames(edges = edges.data[,2:3])


I think the bug was limited to ‘network import file’ commands and not CyREST. In either case, all methods appear to work in 3.7.0.
 - Alex

edges.csv

Dima

unread,
Oct 18, 2018, 3:02:47 AM10/18/18
to cytoscape-helpdesk
Thank yopu for your fabulous replies....do you think that for me installign the latest version can help? I am only importing the same network but with the different direciton of the edges - just mixing the direction of the nodes - not just reversing the direction.... (as is shown in the Node1 and Node2 columns). I will now try to install the latest version...

Dima

unread,
Oct 18, 2018, 3:13:52 AM10/18/18
to cytoscape-helpdesk
Deaar Ruth,
Please reupload the screenshot - cannto see it.
as I mentioned below I am not just reversing the edges but importing the new network with saem edges of thee new direciton (mostly mixed not just reversed) -- and the nodes stay the same  - for soem reason edges are not reversed....
let me  try new version
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

--
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-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

Dima

unread,
Oct 18, 2018, 3:45:35 AM10/18/18
to cytoscape-helpdesk
Ruth - the vberison that you mentioned failed to import the edges - not sure wqhat to do - i TRIED THE VERION YOU MENTINED AS WELL AS THE LATEST 3.7.0

Dima

unread,
Oct 18, 2018, 3:59:33 AM10/18/18
to cytoscape-helpdesk
can you pls reupl;aod the edge4s file - i am tryign to import it vial R


On Thursday, October 18, 2018 at 2:16:23 AM UTC+3, Alex Pico wrote:

Dima

unread,
Oct 18, 2018, 5:06:24 AM10/18/18
to cytoscape-helpdesk
I managed to install r, RCy3 (i am a no-prpogrammer)

can you please help me with the code to just load my CSV file into an open network named table1 and treat ID column as the key? I need to overwrite previosu edge data and make the edges realign with new nodes...

I mean can you please show me an exampel command which fully simulates importing CSV table as edges table

Dima

Dima

unread,
Oct 18, 2018, 5:52:08 AM10/18/18
to cytoscape-helpdesk
Dear Ruth -  I am quite confused by using R - as I am non tech person - can you please show me an example comman which I can use inside Cytsocape to just import an excel table as the edges table and use column ID as the key column?


On Wednesday, October 17, 2018 at 11:39:02 PM UTC+3, risserlin wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

--
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-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

Scooter Morris

unread,
Oct 25, 2018, 11:40:33 AM10/25/18
to cytoscape-helpdesk
Hi Dima,
   OK, let's step away from R for a moment.  In reading the entire thread, I'm not 100% convinced I know exactly what you are doing.  When you say that "you are importing the table" are you using "network import file" or are you doing a "table import"?  If you are doing the former, you should create a new network every time you run the command.  If you are doing the latter, you are correct, just adding data to a table will not change the direction of the edges.  As Ruth has pointed out, the direction of the edges is somewhat independent of the how the edges are visualized, so you could do somewhat of the same thing by adding a column to the table and changing the column.

-- scooter
Reply all
Reply to author
Forward
0 new messages