cytoscape 
 1 , 
 2 provides an environment for the visualization and analysis of networks and associated annotations .
the primary audience for cytoscape is the biological community and cytoscape supports a number of standard use cases for analyzing and visualizing biological data .
many of these use cases involve the selection of a number of nodes or edges based on some analysis or annotation and either performing an action on that selection or comparing those nodes or edges to a different set of nodes or edges that resulted from alternative analyses or analyses based on alternative annotations . the core capabilities for cytoscape provide some tools to facilitate these types of comparisons but they can be counterintuitive or complicated to use . 
 setsapp is a cytoscape 3 application that provides a general set of tools for users and developers to define and maintain sets of nodes or edges and compare those sets using the standard set operations of union , intersection , and difference . in this paper , we present the implementation of 
 setsapp , in particular , how 
 setsapp integrates with the cytoscape command system , and then present a sample biological workflow using 
 setsapp .
cytoscape provides two approaches to implementing apps : a simple app and a bundle app .
simple apps are implemented using the same general approach as in cytoscape 2.8 , but at the cost of significant flexibility .
bundle apps utilize open service gateway initiative ( osgi ) 
  interfaces through apis provided by cytoscape to interact with the cytoscape core functionality . 

there are three main components to the 
 setsapp implementation : the user interface , the command interface , and the underlying data model for maintaining sets of nodes and edges .
the 
 setsapp user interface consists of menu items in the main apps menu , node and edge context menus , and a panel added to the 
 control panel ( left or west ) section of the cytoscape user interface .
the main feature of the 
 sets panel is the list of currently defined sets .
each set can be expanded to see all of the nodes or edges within that set , and context menus provide the ability to select , deselect , rename , or remove sets . when multiple sets are selected , the 
 set operations buttons are enabled .
this allows users to create new sets based on the union , intersection , or difference of other sets .
note that the results of a union or intersection are well - defined for multiple sets , but the difference operation is order dependent .
if more than two sets are selected , the order is the order of selection , so care must be taken when attempting to create a difference set of more than two sets .
sets can be created from the currently selected nodes or edges , or based on a particular node or edge attribute .
when creating sets from attributes , the user will need to supply a prefix for the sets to be created and choose the attribute ( currently only string attributes are supported ) from a list .
in addition to having menu items to manage sets , the user may select all set members in the network , or if the set is expanded , individual members .
this functionality presents an easy way for users to visualize the results of set operations and to perform interactive exploratory analysis .
the menus provided through the top - level apps menu offer the same functionality as the 
 create set from menu in the 
 setsapp control panel with the addition of a menu to import a set from a file .
node and edge context menus provide the user with the ability to add or remove the corresponding node or edge from sets .
in addition to the standard user interface described above , 
 setsapp provides a number of  commands  .
these commands may be used for scripting purposes or by other cytoscape apps that wish to take advantage of the 
 setsapp functionality . 

a command is made available to cytoscape by creating a standard cytoscape taskfactory with two new properties in the org.cytoscape.work package : serviceproperties.command_namespace , which is always set to  

setsapp  ; and serviceproperties.command , which is the command name ( e.g.  addto  ) .
the command arguments are implemented as tunables within the task called by the designated taskfactory . because there is no guarantee that the task will be executed within the context of a gui
, care should be taken to make sure that the appropriate tunable types are used .
for example , the nodelist tunable allows the command - line user to enter a list of nodes rather than assuming that the user will have selected nodes interactively .
for another cytoscape app to use any of these commands , it would need to call one of the cytoscape taskmanagers and provide it org.cytoscape.command.commandexecutortaskfactorys createtaskiterator method with the appropriate argument map , command , and command namespace .
getservice 
       ( synchronoustaskmanager . 
 class 
 ) ; 
 commandexecutortaskfactory cetf = 
   serviceregistrar .
getservice 
       ( commandexecutortaskfactory . 
 class 
 ) ; 
 map < string , object > argmap = 
 new 
 hashmap
< string , object > ( ) ; 
 argmap.put ( 
 " name " 
 , 
 " newset " 
 ) ; 
 // selected is a special keyword for the 
 nodelist tunable 
 argmap.put ( 
 " nodelist " 
 , 
 " selected " 
 ) ; 
 // the current network 
 argmap.put ( 
 " network " 
 , 
 " current " 
 ) ; 
 // assumes that this implements taskobserver 
 tm.execute(cetf.createtaskiterator ( 
 " setsapp " 
 , 
 " createset " 
 , 
 argmap , 
 this 
 ) , 
 this 
 ) ; 

  the main model object for a node or edge set is the 
 set object , which stores a map of all of the nodes or edges in this set .
the 
 setsmanager also serves the critical function of serializing the information about sets to the default hidden table ( see cynetwork.hidden_attrs ) for nodes or edges ( depending on the type of the set ) .
each set is created as a boolean column in the hidden table which is set to 
 true if the corresponding node or edge is in that set . by storing values in the default hidden tables ,
the information about sets is automatically saved in cytoscape sessions and restored when sessions are reloaded . 

setsmanager implements 
 sessionreloadedlistener and recreates the 
 sets from the information stored in the hidden table columns .
the 
 setsapp user interface consists of menu items in the main apps menu , node and edge context menus , and a panel added to the 
 control panel ( left or west ) section of the cytoscape user interface .
the main feature of the 
 sets panel is the list of currently defined sets .
each set can be expanded to see all of the nodes or edges within that set , and context menus provide the ability to select , deselect , rename , or remove sets . when multiple sets are selected , the 
 set operations buttons are enabled .
this allows users to create new sets based on the union , intersection , or difference of other sets .
note that the results of a union or intersection are well - defined for multiple sets , but the difference operation is order dependent .
if more than two sets are selected , the order is the order of selection , so care must be taken when attempting to create a difference set of more than two sets .
sets can be created from the currently selected nodes or edges , or based on a particular node or edge attribute .
when creating sets from attributes , the user will need to supply a prefix for the sets to be created and choose the attribute ( currently only string attributes are supported ) from a list .
in addition to having menu items to manage sets , the user may select all set members in the network , or if the set is expanded , individual members .
this functionality presents an easy way for users to visualize the results of set operations and to perform interactive exploratory analysis .
the menus provided through the top - level apps menu offer the same functionality as the 
 create set from menu in the 
 setsapp control panel with the addition of a menu to import a set from a file .
node and edge context menus provide the user with the ability to add or remove the corresponding node or edge from sets .
in addition to the standard user interface described above , 
 setsapp provides a number of  commands  .
these commands may be used for scripting purposes or by other cytoscape apps that wish to take advantage of the 
 setsapp functionality . 

a command is made available to cytoscape by creating a standard cytoscape taskfactory with two new properties in the org.cytoscape.work package : serviceproperties.command_namespace , which is always set to  

setsapp  ; and serviceproperties.command , which is the command name ( e.g.  addto  ) .
the command arguments are implemented as tunables within the task called by the designated taskfactory . because there is no guarantee that the task will be executed within the context of a gui
, care should be taken to make sure that the appropriate tunable types are used .
for example , the nodelist tunable allows the command - line user to enter a list of nodes rather than assuming that the user will have selected nodes interactively . for another cytoscape app to use any of these commands
, it would need to call one of the cytoscape taskmanagers and provide it org.cytoscape.command.commandexecutortaskfactorys createtaskiterator method with the appropriate argument map , command , and command namespace .
getservice 
       ( synchronoustaskmanager . 
 class 
 ) ; 
 commandexecutortaskfactory cetf = 
   serviceregistrar .
getservice 
       ( commandexecutortaskfactory . 
 class 
 ) ; 
 map < string , object > argmap = 
 new 
 hashmap < string , object > ( ) ; 
 argmap.put ( 
 " name " 
 , 
 " newset " 
 ) ; 
 // selected is a special keyword for the 
 nodelist tunable 
 argmap.put ( 
 " nodelist " 
 , 
 " selected " 
 ) ; 
 // the current network 
 argmap.put ( 
 " network " 
 , 
 " current " 
 ) ; 
 // assumes that this implements taskobserver 
 tm.execute(cetf.createtaskiterator ( 
 " setsapp " 
 , 
 " createset " 
 , 
 argmap , 
 this 
 ) , 
 this 
 ) ; 


the main model object for a node or edge set is the 
 set object , which stores a map of all of the nodes or edges in this set .
the 
 setsmanager also serves the critical function of serializing the information about sets to the default hidden table ( see cynetwork.hidden_attrs ) for nodes or edges ( depending on the type of the set ) .
each set is created as a boolean column in the hidden table which is set to 
 true if the corresponding node or edge is in that set . by storing values in the default hidden tables , the information about sets is automatically saved in cytoscape sessions and restored when sessions are reloaded . 

setsmanager implements 
 sessionreloadedlistener and recreates the 
 sets from the information stored in the hidden table columns .
a simple example use case might be the exploration of the data set from ideker 
 et al . , 2001 
 , which measured the change in expression for 331 genes after a systematic deletion of genes known to be involved in the 
 saccharomyces cerevisiae switch to galactose metabolism .
this data was combined with known protein - protein and protein - dna interactions to explore the biological response to deletions in the presence ( the g in the column names ) or absence of galactose in the medium .
this data set is now included as a sample with cytoscape downloads ( 
 galfiltered.cys ) . in our workflow
we use cytoscape s 
 select panel to select all proteins that are underexpressed ( gal1rgexp < -0.5 fold change ) in the deletion of gal1 ( 
 figure 2 ) .
that selection is saved as a set named gal1- ( 
 apps 
 setsappcreate node set ) .
we then select all of the proteins that are overexpressed ( gal1rgexp > 0.5 fold change ) in the deletion of gal1 and save that selection as a set named gal1 + .
repeating this for gal4 ( column gal4rgexp ) and gal80 ( column gal80rexp ) results in 6 sets altogether : gal1 + , gal1- , gal4 + , gal4- , gal80 + , gal80- ( 
 figure 3 ) .
note that the data for gal1 and gal4 is in the presence of galactose , but the data for gal80 is in the absence of galactose since gal80 is a known repressor of gal4 .
given those six sets of genes , we can explore the data sets by looking at combinations of the sets .
for example , we could look at the intersection of all of the underexpressed proteins by selecting each of gal1- , gal4- , and gal80- in the 
 sets panel and pressing the 
 intersection button in the 
 set operations box near the bottom of the panel .
if we name the resulting set gal- we see that it contains a single gene : arg1 . in this data
set of 331 genes , only this one gene is repressed for all three of the deleted gal genes . in the absence of galactose when gal80 is deleted , arg1 is underexpressed , and in the presence of galactose when either gal1 or gal4 are deleted the gene is also underexpressed .
looking at the expression significance values in the node table panel of cytoscape ( gal1rgsig , gal4rgsig , and gal80rsig ) this is a highly significant result , although there is no direct correlation between the galactose switch and arginine biosynthesis regulation that we were able to find in the literature . on the other hand ,
arg1 is regulated by the gcn4 activator which is known to repress protein synthesis during periods of stress or starvation 
 , which explains the significant down - regulation of arg1 .
we can perform a similar analysis to understand the consistent up - regulation of the five genes in the gal+ set : gip1 , nce103 , yig1 , pot1 , and icl1 . 

gal+ and gal- were created by performing the intersection of all of the + and - sets , respectively .
there are many cytoscape workflows that could take advantage of the features of 
 setsapp .
any workflow that might want to look for groups of nodes or edges that share multiple traits , or that explicitly do not share those traits . while it is possible to duplicate many of the final results enabled by 
 setsapp by using cytoscape 3.1 s new 
 select panel , a user would need to know in advance exactly the combination of features that were biologically interesting . 

setsapp provides an alternative that allows users to explore various combinations of nodes and edges and to save such selections for later uses . in the workflow we developed above ,
we combined the functionality of cytoscape s 
 select panel with 
 setsapp to explore combinations of sets of genes based on shared properties .
there are many more sophisticated apps available to cytoscape users that could be used to do a more thorough analysis of this data set including jactivemodules 
 , clustermaker 
  and rinalyzer 
 , however , the workflow above demonstrates the utility of a simple set - oriented approach to exploring networks .
source code as at the time of publication : 
 https://github.com/f1000research/setsapp 
  archived code as at the time of publication : 
 http://www.dx.doi.org/10.5281/zenodo.10424 
  license : lesser gnu public license 3.0 : 
 https://www.gnu.org/licenses/lgpl.html 

 setsapp ( 
 http://apps.cytoscape.org/apps/setsapp ) is a relatively simple cytoscape 3 app for users to handle groups of nodes and/or edges . 
 it supports several important biological workflows and enables various set operations . 
 setsapp provides basic tools to create sets of nodes or edges , import or export sets , and perform standard set operations ( union , difference , intersection ) on those sets . 
 the sets functionality is also exposed to users and app developers in the form of a set of commands that can be used for scripting purposes or integrated in other cytoscape apps . 
Introduction
Implementation
User interface
Command interface
Data model
Results
Conclusions
Software availability