Column Bumping

Background

The ZMap canvas is being converted to have featureset foo canvas items to allow efficient use of the Foo Canvas and GDK and part of this process involves moving the column bumping code into the new modules.

Historically a column contained individual features each of which was a FooCanvasGroup and each part of a complex feature (eg exon, intron line, glyphs) was a distinct FooCanvasItem. The code to manipulate these was in zmapWindow/zmapWindowColBump.c and zmapWindow/items/zmapWindowContainerFeatureSetUtils.c. When complete these will be replaced by zmapWindow/items/zmapWindowCanvasfeaturesetBump.c and possibly some other files; in the transitional phase both sets of code will be present.

ZMAPBUMP_NAVIGATOR has been removed: it was not used and the code to use it mapped it onto ZMAPBUMP_ALTERNATING, and the navigator bump functions are not workong well anyway. There was coed to implement ZMAPBUMP_NAVIGATOR, but this was a carbon copy of ZMAPBUMP_OVERLAP.

Functional Specification

This is an opportunity to document this!

Features are displayed using a Style which specifies a bump mode (default = ZMAPBUMP_UNBUMP), and the bump mode can be fixed in which case it cannot be changed. Otherwise there is the possibility of choosing any other bump mode from a menu. Note that ZMAPBUMP_STYLE is an exception and only applies if configured fully (ie a style is specified).

The table below lists the available modes but from the code it's not immediately obvious what the nuanced differences between the various _NAME_ modes are. ZMAPBUMP_START_POSITION appears to not be used (does not appear in any styles). It's not clear than ZMAPBUMP_NAME is of any use, unless it was an attempt to display quicker than ZMAP_BUMP_COLINEAR. ZMAPBUMP_NAME_INTERLEAVE appears to be intended to not overlap any features but some do - possibly this is a bug caused by variable feature width.
Mode Description Use
ZMAPBUMP_UNBUMP No bumping (default) Normal overlapped display
ZMAPBUMP_OVERLAP Bump any features overlapping each other Simple see everything layout - same-name alignments get jumbled up
ZMAPBUMP_START_POSITION Bump if features have same start coord.
ZMAPBUMP_ALTERNATING Alternate features between two sub_columns Assembly path
ZMAPBUMP_ALL A sub-column for every feature. Large complex low volume features eg transcripts
ZMAPBUMP_NAME A sub-column for features with the same name. Alignments
ZMAPBUMP_NAME_INTERLEAVE All features with same name in a single sub-column but several names interleaved in each sub-column, the most compact display. alignments
ZMAPBUMP_NAME_COLINEAR As for Name but colinear alignments shown. Alignments - shows homology status
ZMAPBUMP_NAME_NO_INTERLEAVE Display as for COLINEAR but no interleaving of different names. Alignemnts
ZMAPBUMP_NAME_BEST_ENDS As for No Interleave but for alignments sorted by 5' and 3' best/biggest matches, one sub_column per match.
ZMAPBUMP_STYLE Show features using an alternate style. Coverage (graph) data eg heatmaps to wiggle or histogram

Rationalised Specification

We intend to link up same-name items into composite features (like transcripts). (These are derived from exonerate alignment and split into distinct features before being sent to ZMap). The following modes are proposed for a new implementation, and if more variants are needed they can be added later.
Mode Description Use
ZMAPBUMP_UNBUMP No bumping (default) Normal overlapped display
ZMAPBUMP_OVERLAP Bump any features overlapping each other Simple see everything layout - same-name alignments get jumbled up
ZMAPBUMP_ALTERNATING Alternate features between two sub_columns Assembly path
ZMAPBUMP_ALL A sub-column for every feature. Large complex low volume features eg transcripts
ZMAPBUMP_NAME_COLINEAR A sub-column for features with the same name with colinear alignments shown. Alignments - shows homology status
ZMAPBUMP_NAME_NO_INTERLEAVE Display as for COLINEAR but more than one set in a column if space available (does not overlap). Alignemnts - more compact than colinear
ZMAPBUMP_NAME_BEST_ENDS As for No Interleave but for alignments sorted by 5' and 3' best/biggest matches, one sub_column per match.
ZMAPBUMP_STYLE Show features using an alternate style. Coverage (graph) data eg heatmaps to wiggle or histogram

Historically there is also a compress mode given to the bump code, which hides data outside the marked region. Partly this was implemented to provide performance benefit, but for some bump modes (eg ZMAPBUMP_ALL) it prevents excessive horizontal scrolling. This compress mode defines the sequence range we bump (and data not straying into this region is hidden). There are the options of Mark Visible or All, with visible corresponding to the scroll region, and All being all features. Note that due to the implementation of featureset foo canvas items we do not have to care about whether features are visible of not as they will never be exposed if they are outside the scrolling region. However there is some opprtunity for fine tuning of code here if this an issue.