Feature Context to Canvas FToI hash

Featues context and window canvas

Data structures used

To avoid confusion here is a quick summary:

Connecting feature context to window canvas

Features may only be displayed in one place per window

So far the existing mechanisms of canvas items referring to features in the feature context directly, and features referring to canvas items via a hash table have worked. Each window has its own context to hash table and when the view is split into two then a second hash table is created. Each container item in the hash table has its own hash table and to look up a feature we need to progress through four levels of hash table.

Some reasons for wanting to display a feature more than once are:

Note Separator column items (created by a DNA search for example) do not refer to features in the feature context (except perhaps the DNA sequence) and are not relevant here. However this may be an area to be aware of.

Solutions ?

Recode the FtoI hash table as a hash table of lists (yuk) or as a btree with non-unique keys allowed.

Recode the FtoI hash table as a list of Canvas items stored in the feature context. This seems remarkably simple and we could replace all the FToI hash table with a simple short list of references to canvas items in each item in the feature context. This would work quicker as scanning a list of one or two items will be faster than searching four hash tables.

Is the FToIHash used directly by the CanvasItems code?

Maybe this is why it exists? The FToiHash is used by Feature Search which is used for a numboer of different ZMap functions see here for details.

Displaying features in another column

To highlight a transcript and all supporting evidence we could cretae the new column and copy the mixed types of features to a new featureset ('evidence'). This will preserve the 1-1 FToIHash mapping and will be easy to maintain and clear. It may also be wise to mark the original features as hidden, so that they do only appear once.