Column ordering

Configuration

Traditionally the list of columns to be displayed has been generated from the featuresets option in the server stanza in the config file ZMap.

with the advent of extra servers eg DAS, pipe, file this list has been generated by concatenating the lists of featuresets from each server, and there has been a choice of doing this either on startup (taking all servers defined in the 'sources' option in that order) or dynamically (adding to the list as data is received).

Later versions of ZMap provide a columns option in the [ZMap] stanza which lists columns to display in order from left to right. It is also possible to map individual featuresets from several servers to a display columms via the [columns] stanza.

See zmapFeature for a discussion of more recent (July 2010) developments where columns are ordered according to configured column name (internally) as opposed to the attached feature set's id.

From configuration to actual display order

Here we consider the default display with reverse strand on the left forward strand on the right and a separator in the middle.

The ZMap display is split into several sections and columns are included according to thier styles. These are:

The options define whether or not a column is strand senesitive and/or frame senesitive and frame implies strand.

The '3 Frame' column is treated specially as a placeholder. Columns are grouped into three sections with frame sensitive colums in the middle (where 3 Frame appears in the list) and within each group columns are sorted into the order as defined in configuration.

Features on the reverse strand are displayed to the left of the strand separator, but only if thier style specifies strand-specific. Features that have styles that are not strand specific appear to the right of the strand seperator on either side of the 3 Frame section depending on where they appear in the columns list. This implies that all data right of the 3 Frame section is not strand specific.

Reverse Complement and 3-Frame

3 Frame mode will display frame sensitive colums in three groups, one for each frame, and these columns are sorted into configured order per group. 3Frame columns only appear on the right hand side of the display and contain features from the relevant strand ie normally the forward strand and the reverse strand if reverse complemented if the style used is strand specific, otherwise they may include both strands.

GF-splice features are a special case as they are frame and strand sensitive and only include features from the forward strand. It is meaningless to display this data for the reverse strand.

Implementation

All possible columns are created for featuresets when the arrive from various database servers via a few functions on zmapWindow/zmapWindowDrawFeatures.c that end up in createColumnFull().

There is an execute function windowDrawContextCB that displays a feature context and calls set_name_create_set_columns() at the block level to create columns per strand and feature_set_matches_frame_drawing_mode() at the featureset level to decide whether or not to include each one. Note that this second function also attempts to optimise the display of columns by preventing the drawing of columns that are already there..

windowDrawContextCB() is also called from windowDrawContext() for the normal display of features.

Similar actions are taken by zmapWindowDraw.c/zMapWindowToggle3Frame() which calls zmapWindowDrawFeatures.c/zmapWindowDraw3FrameFeatures() and zmapWindowDrawRemove3FrameFeatures(). Note that when turning off 3 Frame mode we may have to re-draw single columns for those features defined as 'always display'. purge_hide_frame_specific_columns() handles removing unwanted columns for these types.

Implementation #2

set_name_create_set_columns() has been removed and columns are now created on demand.

The command [ZMap] columns= xxx; yyy ; etc is supposed to specify which columns to display and in what order, but extra data requested from servers gets displayed regardless. These extra columns are placed to the RHS of the display and ordered by featureset id - this is to ensure a stable/ predictable display. Ideally they should be specified in the columns command.