Filters
The Cytoscape Filter plugin, which
is packaged with the official Cytoscape 2.1 release and is active by
default, allows for a wide variety of fine-tuned filtering on node
and edge attributes loaded onto Cytoscape networks. For example, you
can easily select all the nodes whose name contains a specific
pattern that you define. Example filters are shipped with the plugin
to get started. Base filters only operate on String and Scalar data
i.e. any names, descriptions or numerical node or edge attributes can
be filtered. A Boolean filter is also available that can be used to
combine any number of existing filters in logical combinations, so as
you add filters, the plugin becomes more powerful.
Using the Plugin

If the Filter plugin is loaded, then you should see a menu called
“Filters” and the filter icon:

Activate
the filters using either the “Use Filters” menu entry or the
large filters icon (red and green arrows). The filters dialog looks
like the following (without the colors...)
As for the colors:
The Red Box:
Each available filter has its own tab. The default filter is Node
Interactions (which allows you to filter nodes, based on the
edges that they are connected to), Boolean (which allows you
to combine filters together using AND, OR and XOR operators),
Topology (which allows you to filter nodes based on the number
of edges to other nodes), Numerical (which allows for >, =,
and < filtering operations on numerical attributes) and String
(which allows for filtering using * and ? as wildcards).
The Purple
Box: An existing or newly created
filter can be edited in this area. Each filter type has its own user
interface for editing.
The Orange
Box: All available filters are shown in this list. Initially,
this list will contain sample filters, but as you create more, they
will be added here.
The Cyan Box:
Pressing “Add Current Filter” adds the filter being edited
to the “Available Filters” box, and “Remove Selected Filter”
deletes the currently selected filter.
The Green Box:
This area contains default actions for a given filter. These specify
how Cytoscape should display the network components (nodes and edges)
that pass a filter. You can choose to have Cytoscape select the nodes
and/or edges that pass a given filter or alternatively have Cytoscape
hide the nodes and/or edges that do not pass a given filter. A useful
operation is to have a filter select a set of nodes and then send
these nodes to a new network (through the Select menu).
Creating Filters
The important thing to realize when
creating a filter is that the filter does not do anything by
itself. Once created, the filter must be run.
String Filter:

The String Filter allows you to
choose to Filter Node or Edges, and gives you a list of available
attributes to search for each (those attributes that are loaded on
the network). If you have the filters dialog box active and you load
new graph attributes, you can click the update button to refresh the
attribute list. Search terms are entered in the text box at the
bottom. For example to match any Node whose canonicalName starts
with “YDL” you would select “Node”, “canonicalName” and
type “YDL*”. The * is important as it matches anything for any
number of characters after YDL. If you want to be more specific and
only select Nodes whose canonicalName starts with YDL00 followed by
any other two characters, you would type “YDL00??”. The “?”
denotes any single character, while the “*” represents zero or
more characters. Full regular expression searching is supported,
although is not covered here. Once the filter is defined, it will be
assigned a default descriptive name, although this name can be
edited. Pressing the “Add Current Filter” button will add your
filter to the list of available filters to the left.
Numerical Filter:

The Numerical Filter also allows you
to filter Nodes or Edges, and presents you with a list of available
attributes. This filter matches greater-than, less-than, or equal-to
a number you type in the search box. See the String filter
description for more information.

Boolean Filter:
The Boolean filter allows you to
define a new filter that is a logical combination of existing
filters. Available filters are displayed (although the list can be
refreshed by clicking the “Update List of Filters” button). By
selecting one or more filters, you can then choose whether Nodes or
Edges pass “ALL” (AND), “AT LEAST ONE” (OR), or “ONLY ONE”
(XOR) of the selected filters. Once created Boolean filters can then
themselves be combined using the Boolean filter to create arbitrarily
complex logical combinations of filters. Note that unlike the String
and Numerical Filters, Boolean Filters will need to be assigned a
name manually.
Once created, filters are saved for
future sessions, as long as you exit Cytoscape normally via the exit
command in the File menu (i.e. not via ctrl-c on Linux).
Running filters
Any available filter can be run by
selecting a visualization action for Cytoscape (how your filter
results should be displayed) and pressing the ‘Go!’ button.
The
Network +/- Filter Feature
The “Network +/-” dialog is
available from the Filters menu. It allows you to create new networks
and add/remove nodes to/from existing networks based on available
filters. The dialog box is shown below:

The Attribute Browser Filter
Feature
The “Attributes Browser if passed
Filter” item from the Data menu allows you to see the normal
Cytoscape graph attribute browser for all nodes or edges that pass a
given filter.

Once clicked, the following dialog
box appears to allow you to choose an available filter:

Clicking on the Browser button will
open the graph attributes browser.
The Diff Filter Feature
The Diff feature, accessible from
the Data menu shown above, allows you to see which nodes or edges
pass each of two selected filters and which nodes or edges those
filters don’t have in common (i.e. it shows the differences between
two filters). This is useful for quickly comparing two filters. You
can then create a new network that contains the differences (“Create
Network” button) or create a new filter that selects the
differences (“Create Filter” button).

The same functionality is available
here for networks. You can select any two networks that are loaded
and create a new network from their differences.