Ontology

From GeneWeaver Wiki
Jump to: navigation, search

Contents

Ontology

User Documentation

    • Documentation including instructions on how to use the geneset-ontology functionality. This includes screenshots taken from the webpage, as well as any additional relevant information.

The ontology functionality allows for the visualization of ontology metadata under the view_genesets page, and other various pages. Additionally, ontology functionality allows for the modification of geneset linked ontology metadata by an authorized user, with the authorized user being the author of the geneset.

Ontology metadata is automatically populated upon page load on certain pages within the geneweaver website, such as in the view genesets page.

If ontologies are linked to a geneset, the linked ontologies will be seen as highlighted nodes within the ontology tree as shown in Figure 1. Note that the ontology data information will be pre-expanded on load to the selected ontology nodes


Figure 1:

Ontfig1.png

If the geneset being visualized has no linked ontologies, only the ontology databases will be visualized as shown below in figure 2.

In both examples given, the user is only able to view the geneset ontology metadata. The ontology nodes are not able to be selected or de-selected.


Figure 2:

Ontfig2.png

In order to edit a geneset’s ontology metadata, a user must go to the Edit MetaData page. Towards the bottom of this page, ontology metadata for a given geneset is visualized similarly to the examples above, with some slight variation. An example of this is seen in Figure 3.


Figure 3:

Ontfig3.png


Figure 4:

Ontfig4.png

Figure 3 shows a geneset with no linked ontologies similar to what is seen in Figure 2, and figure 4 shows a geneset with linked ontologies similar to what is seen in Figure 1. The data in figures 3 and 4 differ from the data in figures 1 and 2 in that the data in figures 3 and 4 is capable of being selected/de-selected. When this happens, the ontology node is linked/un-linked from a geneset in the database respectively.

A drop down menu can also be seen above the ontology data in Figure 3. A different view of this menu is also given in figure 4.


Figure 5:

Ontfig5.png


The drop down choices seen in Figure 4 show different OBO sources that an ontology can reference. In order to add or remove ontology links from a geneset, a specific OBO source must be selected. When data in the ontology tree is selected/de-selected, it is done so under the currently selected OBO source reference. In this, an ontology may be associated with a geneset under one OBO reference type, but not under a different OBO reference type.

If ‘All Reference Types’ is the selected annotator reference type, all data will be shown in the resulting ontology tree, however the data will not be able to be selected/de-selected, similar to in the view genesets page.

Additionally, the accessible reference types available within the drop down menu are dependent upon the access level of the user. A general user will only have access to the Publication, NCBO Annotator, the Description, NCBO Annotator, Manual Association, and GeneWeaver Primary Manual reference types. Users with special permissions, such as administrators will be have access to view and modify all reference type information.

Development Documentation

    • Documentation detailing how the ontology functionality actually runs from a developer’s point of view. This includes which files are modified, a list of all functions that have any effect on the resulting ontology tree, test scenarios, and code snippets.

List of files containing relevant geneset-ontology code:

  • editgenesets.html
    • HTML code for the geneset-ontology UI found under { #Annotation Information # }:
      • ‘#tree’ div tag: Div where ontology node values are populated. This tag is referenced by the JavaScript functions in order to tie dynatree and ajax functionality to the html code. Each node within the tree has a unique ID which can be referenced in JavaScript using node.data.key.
      • ‘#gso_ref_type’ select tag: Creates a drop down element which allows the user to filter the tree by ‘gso_ref_type’.
    • JavaScript Elements found under <script>:
      • Initialization Element ($(“#tree”).dynatree): This JavaScript function creates a dynatree element from the ‘tree’ div tag located in the html code described in the previous bullet. Additionally, this code contains two other functions that get tied to the dynatree element. The first function is named onLazyRead, and the second is onSelect.
      • OnLazyRead: Contains a lazy loading ajax call which populates nodes on demand. Parameters passed into the ajax call include the node key (ontology_id) to be expanded, a boolean determining whether or not the node is a database, and the gso_ref_type which is currently selected.
      • OnSelect: Contains an ajax call which updates geneset-ontology links the extsrc.geneset_ontology database upon selection/deselection of tree nodes within the UI.
  • metadata.html
    • Metadata.html is included by other various html files that allow a user to view geneset metadata. Ontology information is included in this metadata file, and includes similar elements to the code found in editgenesets.html including the #tree div tag, the initialization element, and the lazy read functionality described above.
  • application.py
    • render_editgenesets: A function which creates a list of ontologies linked to a geneset given gs_id which is stored in onts. Additionally, this function checks user admin status in order to determine which reference types should be available to the user.
    • Update_geneset_ontology_db: Function which is called whenever an ontology node is selected/de-selected in the ontology tree in editgenesets.html. Calls add_ont_to_geneset on selection and remove_ont_from_geneset on de-selection to alter the extsrc.geneset_ontology database appropriately.
    • Init_ont_tree: Function which is called to initialize ontology data using a dynatree ajax call. The function returns a JSON object which can be interpreted by the dynatree plugin. Information on the proper JSON formatting necessary for plugin interpretation can be found under the Dynatree Documentation section below.
    • Get_ont_root_nodes: Function which is instantiated by a lazy loading ajax call from an ontology dynatree. This occurs whenever a tree node is being expanded, and the children beneath the node are dynamically displayed.
  • geneweaverdb.py
    • Class Ontology: Class which holds ontology data.
    • Class Ontologydb: Class which holds ont_db data.
    • remove_ont_from_geneset: removes a geneset-ontology link from the geneset_ontology database given a gs_id, ont_id, and gso_ref_type. Called by the update_geneset_ontology_db function in application.py.
    • add_ont_to_geneset: Creates a new geneset-ontology link to the geneset_ontology database given a gs_id, ont_id, and gso_ref_type. Called by the update_geneset_ontology_db function in application.py.
    • get_all_parents_to_root_for_ontology: Creates a list of all paths from an ontology to a root node using an ont_id. This function modifies the data returned from the get_all_parents_for_ontology function which performs the appropriate database query to get the parent nodes of the ontology parameter recursively.
    • Get_all_children_for_ontology: Performs a database query to obtain all children of a given ontology node, and returns the children as a list of ontology class objects.
    • Get_all_ontologydb: Performs a database query to obtain a list of all ontology databases within the ontologydb table. The function returns a list of ontologydb class objects.
    • Get_all_gso_ref_type: Performs a database query to obtain a list of all gso_ref_types used within the geneset_ontology database.
    • Get_all_root_ontology_for_database: Performs a database query to return all roots for a given ontology database as a list of ontology objects.
    • Get_all_ontologies_by_geneset: Performs a database query to return all ontologies linked to a particular geneset as a list of ontology class objects.

Dynatree-1.2.8 materials:

  • Included Project Files:
    • jquery.dynatree.js (js/dynatree-1.2.8/src/jquery.dynatree.js)
    • dynatree.css (js/dynatree-1.2.8/src/skin-vista/ui.dynatree.css’)
  • Dynatree Documentation:
http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html#nodeOptions. Additionally, programmatic capability documentation can be found at http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html#programming.
Personal tools
Namespaces

Variants
Actions
Navigation
Getting Started
Tools
Other
Toolbox