-
Notifications
You must be signed in to change notification settings - Fork 14
Key structures
This document will describe some key structures in the Phenogrid code, hopefully providing guidance and context for anyone who wants to get involved in the coding.
see Overview Component Diagram
Removing specific mentions of Phenotypes and Genotypes is a key goal of ongoing phenogrid refactoring. Eventually, all references to phenotypes and genotypes will be replaced with source and target, respectively (see Data Management):
- source - those items that are input to the comparisons displayed in Phenogrid
- target - those things that we are comparing against.
The Phenogrid has two axes that are rendered with labels, scores, etc., and associated with appropriate content for tooltips and other support. Since the grid can be flipped to exchange the rows and columns, AxisGroup entries contain methods needed to isolate out the various pieces of functionality needed to manage the grids.
When data is loaded into Phenogrid, the createAxisRenderingGroup() call creates two objects - the sourceAxis and the targetAxis. These are assigned to the variables self.state.xAxisRender and self.state.yAxisRender for x and y axes, respectively, and can be switched as needed to reorient. There are 3 key variables used within AxisRenders:
- items - contains the list of item to use for rendering on the axis; it's content will vary depending on the inverted axis flag; see Internal Data Structures below
the following variables are used by most functions to determine the range of the rendered portion of the axis items.
- renderStartPos - render starting position
- renderEndPos - render end position
There are two primary object classes that are responsible for managing data within Phenogrid: DataLoader and DataManager.
-
DataLoader (DL) Is responsible for performing all fetching of data from external servers, and the transformation process to internal structures (i.e., associative array objects).
-
DataManager (DM) Data from the DataLoader is injected into the DataManager and this object manages all interaction with the data. It can request to the DL to provide a refreshed copy of the data.
Internal Data Structures There are three (3) main data structures used within Phenogrid: source, target and cellData
- source - contains all sources (i.e, phenotypes) for each species
{id:, label:, IC:, count:, sum:, type:}
accessing data: var o = source[‘Mus musculus’][‘HP_23948’]
- target - contains all target data (i.e., disease, gene, genotypes)
{id:, label:, targetGroup:, taxon:, type:, score:}
accessing data: var o = target[‘Mus musculus’][‘MGI_006446’])
-
cellData- contains the transformed owlsims comparison data
{source_id:,target_id:,value: (lcs), a_IC:,a_label:,subsumer_label:,subsumer_id:,subsumer_IC:,b_label:,b_id:,b_IC:, species:,type: ‘cell’}
-
matrix- contains the matching point for source target; this is built dynamically before rendering
{source_id:,target_id:,xpos:,ypos:, targetGroup:}
accessing data:
var o = cellData[‘Mus musculus’][‘HP_23948’][‘MGI_006446’]
(targetGroup aka 'species')