Moving network to a network collection

603 views
Skip to first unread message

K. Elo

unread,
Feb 22, 2017, 2:24:19 AM2/22/17
to cytoscape-helpdesk
Hi!

Is there any possibility to move a network from one collection to an
other in Cytoscape 3.4.0 (Linux 64bit)?

I have a project with ca. 20 networks. The project started with only a
few networks all under the originally created network collection. Now I
would like to re-organise my networks in thematical collections but
cannot find any possibility for (a) creating empty network collections,
nor for (b) moving a network from one collection to an other.

Best regards,
Kimmo


Barry Demchak

unread,
Feb 22, 2017, 11:00:29 AM2/22/17
to cytoscape...@googlegroups.com
Hi, Kimmo --

I can see a few ways to do this. The Cytoscape terminology involved complicates the picture, as it doesn't help clarify what's being done.

First, to create a new collection, use the File | New | Network | Empty Network menu. This will give you the option of creating a new collection by using the dropdown.

Once you have a new collection, you can go back to your original network, select the nodes and edges you want, and use the Edit | Copy menu item to put them into the clipboard. Then select the new network and the Edit | Paste menu item to copy the nodes and edges into it.

Another (easier) way would be to select the network you want, then use the File | New | Clone Current Network ... this will create a new collection with a new network.

Both of these routes can be combined to get 20 networks into a new collection.

For getting a lot of networks into a new collection, I can think of another route ... use the File | Export | Network menu item to write each network into its own .XGMML file. Then use the File | Import | Network menu item to import each network into a new collection.

As you can see, this is possible from the UI, but not so convenient.

It should be possible to automate this in two different ways:

Use the Command Line dialog scripting (in the Tools menu) to script the exporting and importing. Of interest:
Network set current
Network select
Network export
Network import

You can find out about these from the Command Line dialog by using the "help network" command and (for example) the "help network select" command. Note that the help text is all of the documentation there is (for now) and you may have to do some experimenting with these commands to get them right. There is also documentation at http://manual.cytoscape.org/en/3.4.0/Command_Tool.html

Finally, for better program-based control (e.g., Python), there's cyREST, which controls Cytoscape as if it were a REST server. For documentation on that: https://github.com/cytoscape/cyREST/wiki ... It's the most flexible and powerful, but requires programming from an external framework (e.g., Jupyter, Java, etc).

Does this help??
--
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.
For more options, visit https://groups.google.com/d/optout.

K. Elo

unread,
Mar 2, 2017, 7:27:44 AM3/2/17
to cytoscape...@googlegroups.com
Hi!

Thanks, Barry, for your clarifying answer. So not drag-and-drop-solution
available :)

The options were those I had already figured out. To export and import
ten, fifteen networks might work. An cloning creates each time a new
colledction, so I would end up with N new collections (what was not my
goal).

IMHO having the possibility to move a network from one collection to
another without any unneccessary steps like export/import weould be a
good improvement. If Cytoscape already can (1) clone, (2) rename and (3)
delete networks, programming a move function should be no rocket science
:) I will take a look on the scripting tools in order to figure out how
much work is needed to add this functionality :)

Best regards,
Kimmo

Barry Demchak

unread,
Mar 2, 2017, 10:18:05 AM3/2/17
to cytoscape...@googlegroups.com
Hi, Kimmo --

One thing I can add is an explanation of what a collection is in the first place.

Essentially, a collection (or base network) is a collection of nodes, edges and attributes that all subnets share. Subnets cannot have nodes or edges that aren't in the base network. Additionally, subnets can have their own attributes. Having base-level attributes enables the user to change an attribute in one subnet and have it become effective for all subnets.

If that's the case, moving a subnet from one collection to another involves copying nodes and to the new collection, then copying base attributes to the collection, and subnet attributes to the new subnet.

Of course, when you do that, you lose the connection between attributes in the old collection and the new one.

The big question, then, is what properties you're trying to preserve when you move a subnet to a new collection ... and how you resolve node, edge and attribute collisions at the base network level.

I suspect there are solutions to this question, and I'm interested in what effect you're trying to achieve.

-----Original Message-----
From: cytoscape...@googlegroups.com [mailto:cytoscape...@googlegroups.com] On Behalf Of K. Elo
Reply all
Reply to author
Forward
0 new messages