Browse Source

Preparing phylogeny module or release

Stephen Ficklin 8 năm trước cách đây
mục cha
commit
eca67392b7
35 tập tin đã thay đổi với 140 bổ sung549 xóa
  1. 1 1
      tripal_bulk_loader/tripal_bulk_loader.module
  2. 1 1
      tripal_core/api/tripal_core.DEPRECATED.api.inc
  3. 1 1
      tripal_core/api/tripal_core.chado_nodes.api.inc
  4. 1 1
      tripal_core/api/tripal_core.chado_query.api.inc
  5. 1 1
      tripal_core/tripal_core.module
  6. 2 2
      tripal_core/tripal_core.views.inc
  7. 5 27
      tripal_phylogeny/includes/tripal_phylogeny.admin.inc
  8. 0 8
      tripal_phylogeny/includes/tripal_phylogeny.chado_node.inc
  9. 5 4
      tripal_phylogeny/includes/tripal_phylogeny.taxonomy.inc
  10. 0 4
      tripal_phylogeny/theme/css/tripal_phylogeny.css
  11. 0 97
      tripal_phylogeny/theme/js/organism-bubble-plot.js
  12. 3 123
      tripal_phylogeny/theme/js/tripal_phylogeny.js
  13. 0 0
      tripal_phylogeny/theme/templates/tripal_phylogeny_analysis.tpl.php
  14. 2 3
      tripal_phylogeny/theme/templates/tripal_phylogeny_base.tpl.php
  15. 0 0
      tripal_phylogeny/theme/templates/tripal_phylogeny_help.tpl.php
  16. 0 0
      tripal_phylogeny/theme/templates/tripal_phylogeny_organisms.tpl.php
  17. 19 0
      tripal_phylogeny/theme/templates/tripal_phylogeny_phylogram.tpl.php
  18. 0 0
      tripal_phylogeny/theme/templates/tripal_phylogeny_references.tpl.php
  19. 11 0
      tripal_phylogeny/theme/templates/tripal_phylogeny_taxonomic_tree.tpl.php
  20. 0 0
      tripal_phylogeny/theme/templates/tripal_phylogeny_teaser.tpl.php
  21. 0 33
      tripal_phylogeny/theme/templates/tripal_phylotree_phylogram.tpl.php
  22. 0 8
      tripal_phylogeny/theme/templates/tripal_phylotree_radial.tpl.php
  23. 0 24
      tripal_phylogeny/theme/templates/tripal_phylotree_taxonomic_tree.tpl.php
  24. 13 27
      tripal_phylogeny/theme/tripal_phylogeny.theme.inc
  25. 1 1
      tripal_phylogeny/tripal_phylogeny.info
  26. 30 23
      tripal_phylogeny/tripal_phylogeny.module
  27. 1 6
      tripal_phylogeny/tripal_phylogeny.views.inc
  28. 11 63
      tripal_phylogeny/tripal_phylogeny.views_default.inc
  29. 1 1
      tripal_views/api/tripal_views.api.inc
  30. 1 1
      tripal_views/includes/tripal_views_integration.inc
  31. 1 1
      tripal_views/tripal_views.info
  32. 0 64
      tripal_views/tripal_views.views.inc
  33. 19 15
      tripal_views/views/handlers/tripal_views_handler_filter_select_cvterm.inc
  34. 5 5
      tripal_views/views/handlers/tripal_views_handler_filter_select_id.inc
  35. 5 4
      tripal_views/views/handlers/tripal_views_handler_filter_select_string.inc

+ 1 - 1
tripal_bulk_loader/tripal_bulk_loader.module

@@ -460,7 +460,7 @@ function tripal_bulk_loader_progess_file_get_progress($job_id, $update_progress
  * @params $callback
  *   The callback passed into tripal_add_job()
  * @param $args
- *   The arguements passed into tripal_add_job()
+ *   The arguments passed into tripal_add_job()
  * @return
  *   An array where keys are the human readable headers describing each arguement
  *   and the value is the aguement passed in after formatting

+ 1 - 1
tripal_core/api/tripal_core.DEPRECATED.api.inc

@@ -915,7 +915,7 @@ function tripal_core_delete_property_by_id($basetable, $property_id) {
     'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. This requires manual
-      intervention since the arguements for the two functions are different.
+      intervention since the arguments for the two functions are different.
       Please update your code.",
     array(
       '%old_function'=>'tripal_core_delete_property_by_id',

+ 1 - 1
tripal_core/api/tripal_core.chado_nodes.api.inc

@@ -1247,7 +1247,7 @@ function hook_chado_node_sync_form($form, &$form_state) {
  *
  * Allows you to use this function as your own submit.
  *
- * This might be necessary if you want to add additional arguements to the
+ * This might be necessary if you want to add additional arguments to the
  * tripal job or to call your own sync'ing function if the generic
  * chado_node_sync_records() is not sufficient.
  *

+ 1 - 1
tripal_core/api/tripal_core.chado_query.api.inc

@@ -1577,7 +1577,7 @@ function chado_query($sql, $args = array()) {
  *    indicated by :tokens with values being in the $args array and all tables should
  *    be prefixed with the schema name described in tripal_get_schema_name().
  * @param $args
- *    An array of arguements where the key is the token used in $sql (for example, :value)
+ *    An array of arguments where the key is the token used in $sql (for example, :value)
  *    and the value is the value you would like substituted in.
  */
 function hook_chado_query_alter(&$sql, &$args) {

+ 1 - 1
tripal_core/tripal_core.module

@@ -529,7 +529,7 @@ function tripal_core_theme($existing, $type, $theme, $path) {
 
 /**
  * Implements hook_job_describe_args().
- * Describes the arguements for the tripal_populate_mview job to allow for greater
+ * Describes the arguments for the tripal_populate_mview job to allow for greater
  * readability in the jobs details pages.
  *
  * @param $callback

+ 2 - 2
tripal_core/tripal_core.views.inc

@@ -134,8 +134,8 @@ function tripal_core_views_data_jobs($data) {
 
   // Arguments
   $data['tripal_jobs']['arguments'] = array(
-    'title' => t('Arguements'),
-    'help' => t('Any arguements passed to the callback.'),
+    'title' => t('arguments'),
+    'help' => t('Any arguments passed to the callback.'),
     'field' => array(
       'handler' => 'views_handler_field',
       'click sortable' => TRUE, // This is use by the table display plugin.

+ 5 - 27
tripal_phylogeny/includes/tripal_phylogeny.admin.inc

@@ -100,12 +100,12 @@ function tripal_phylogeny_default_plots_form($form, &$form_state) {
     '#title' => t('Plot Settings'),
     '#description' => t('You can customize settings for each plot'),
     '#collapsible' => TRUE,
-    '#collapsed' => TRUE
+    '#collapsed' => FALSE
   );
 
   $form['plot_settings']['phylogram_width'] = array(
     '#type' => 'textfield',
-    '#title' => 'Phylogram Width',
+    '#title' => 'Tree Width',
     '#description' => 'Please specify the width in pixels for the phylogram',
     '#default_value' => variable_get('tripal_phylogeny_default_phylogram_width', 350),
     '#element_validate' => array(
@@ -113,39 +113,19 @@ function tripal_phylogeny_default_plots_form($form, &$form_state) {
     ),
     '#size' => 5,
   );
-  $form['plot_settings']['dendrogram_width'] = array(
-    '#type' => 'textfield',
-    '#title' => 'Dendrogram Width',
-    '#description' => 'Please specify the width in pixels for the circular dendrogram',
-    '#default_value' => variable_get('tripal_phylogeny_default_dendrogram_width', 500),
-    '#element_validate' => array(
-      'element_validate_integer_positive'
-    ),
-    '#size' => 5,
-  );
-  $form['plot_settings']['bubble_width'] = array(
-    '#type' => 'textfield',
-    '#title' => 'Bubble Plot Width',
-    '#description' => 'Please specify the width in pixels for the organism bubble plot',
-    '#default_value' => variable_get('tripal_phylogeny_default_bubble_width', 500),
-    '#element_validate' => array(
-      'element_validate_integer_positive'
-    ),
-    '#size' => 5,
-  );
 
   $form['node_settings'] = array(
     '#type' => 'fieldset',
     '#title' => t('Node Settings'),
     '#description' => t('You can customize settings for the nodes on the trees.'),
     '#collapsible' => TRUE,
-    '#collapsed' => TRUE
+    '#collapsed' => FALSE
   );
   $form['node_settings']['root_node_size'] = array(
     '#type' => 'textfield',
     '#title' => 'Root Node Size',
     '#description' => 'Please specify a size for the root node size. If set to zero, the node will not appear.',
-    '#default_value' => variable_get('tripal_phylogeny_default_root_node_size', 6),
+    '#default_value' => variable_get('tripal_phylogeny_default_root_node_size', 3),
     '#element_validate' => array(
       'element_validate_integer'
     ),
@@ -155,7 +135,7 @@ function tripal_phylogeny_default_plots_form($form, &$form_state) {
     '#type' => 'textfield',
     '#title' => 'Interor Node Size',
     '#description' => 'Please specify a size for the interior node size. If set to zero, the node will not appear.',
-    '#default_value' => variable_get('tripal_phylogeny_default_interior_node_size', 6),
+    '#default_value' => variable_get('tripal_phylogeny_default_interior_node_size', 1),
     '#element_validate' => array(
       'element_validate_integer'
     ),
@@ -272,8 +252,6 @@ function tripal_phylogeny_default_plots_form_submit($form, &$form_state) {
 
   if ($form_state['clicked_button']['#name'] == 'submit') {
     variable_set('tripal_phylogeny_default_phylogram_width', $form_state['values']['phylogram_width']);
-    variable_set('tripal_phylogeny_default_dendrogram_width', $form_state['values']['dendrogram_width']);
-    variable_set('tripal_phylogeny_default_bubble_width', $form_state['values']['bubble_width']);
 
     variable_set('tripal_phylogeny_default_root_node_size', $form_state['values']['root_node_size']);
     variable_set('tripal_phylogeny_default_interior_node_size', $form_state['values']['interior_node_size']);

+ 0 - 8
tripal_phylogeny/includes/tripal_phylogeny.chado_node.inc

@@ -74,13 +74,6 @@ function tripal_phylogeny_node_view($node, $view_mode, $langcode) {
       '#tripal_toc_title' => 'Taxonomic Tree',
       '#weight' => -80,
     );
-    $node->content['tripal_phylogeny_radial'] = array(
-      '#theme' => 'tripal_phylogeny_radial',
-      '#node' => $node,
-      '#tripal_toc_id'    => 'phylotree_circ_dendrogram',
-      '#tripal_toc_title' => 'Circular Dendrogram',
-      '#weight' => -80,
-    );
     $node->content['tripal_phylogeny_organisms'] = array(
       '#theme' => 'tripal_phylogeny_organisms',
       '#node' => $node,
@@ -894,7 +887,6 @@ function phylotree_json($phylotree_id) {
     // Add this node to the list, organized by ID.
     $phylonodes[$phylonode_id] = $node;
   }
-  drupal_debug($phylonodes);
 
   // Populate the children[] arrays for each node.
   foreach ($phylonodes as $key => &$node) {

+ 5 - 4
tripal_phylogeny/includes/tripal_phylogeny.taxonomy_import.inc → tripal_phylogeny/includes/tripal_phylogeny.taxonomy.inc

@@ -73,13 +73,14 @@ function tripal_phylogeny_ncbi_taxonomy_import($job_id) {
     }
 
     // If the tree already exists then don't insert it again.
-    $tree_name = 'NCBI Taxonomy Tree';
+    global $site_name;
+    $tree_name = $site_name . 'Taxonomy Tree';
     $phylotree = chado_select_record('phylotree', array('*'), array('name' => $tree_name));
     if (count($phylotree) == 0) {
       // Add the taxonomic tree.
       $options = array(
-        'name' => 'NCBI Taxonomy Tree',
-        'description' => 'The Taxonomy Database is a curated classification and nomenclature for all of the organisms in the public sequence databases.',
+        'name' =>  $site_name . 'Taxonomy Tree',
+        'description' => 'The taxonomic tree of organisms represented in this database.',
         'leaf_type' => 'taxonomy',
         'analysis_id' => $analysis->analysis_id,
         'tree_file' => '/dev/null',
@@ -90,7 +91,7 @@ function tripal_phylogeny_ncbi_taxonomy_import($job_id) {
       $warnings = array();
       $success = tripal_insert_phylotree($options, $errors, $warnings);
       if (!$success) {
-        throw new Exception("Cannot add the NCBI Taxonomy Tree phylotree record.");
+        throw new Exception("Cannot add the Taxonomy Tree record.");
       }
       $phylotree = (object) $options;
     }

+ 0 - 4
tripal_phylogeny/theme/css/tripal_phylogeny.css

@@ -1,4 +0,0 @@
-#phylonode_popup_dialog {
-    font-family: sans-serif;
-    font-size: 0.75rem;
-}

+ 0 - 97
tripal_phylogeny/theme/js/organism-bubble-plot.js

@@ -1,97 +0,0 @@
-
-/* d3js graph of phylotree organisms 
-
-selector : jquery selector for div to insert svg content
-data : json data
-options : {  fill : color function for each node, 
-             width :  svg width & height,
-             height : svg height }
-*/
-
-function organismBubblePlot(selector, data, options) {
-  
-  /* Flatten the tree structure to sum organisms. the bubble layout
-   * expects a name property, but the organismColor function expects
-   * the abbreviation property to exist as well. */
-  var organisms = {};
-  var countOrganisms = function(node, i, arr) {
-    if (node.fo_organism_id) {
-      if (!organisms[node.fo_organism_id]) {
-        // Copy only the organisms related metadata, discarding feature info.
-        organisms[node.fo_organism_id] = {
-          'organism_id' : node.fo_organism_id,
-          'name' : node.fo_abbreviation,
-          'abbreviation' : node.fo_abbreviation,
-          'genus' : node.fo_genus,
-          'species' : node.fo_species,
-          'common_name' : node.fo_common_name,
-          'organism_node_id' : node.fo_organism_node_id,
-          'value' : 1 // count
-        };
-      }
-      else {
-        organisms[node.fo_organism_id]['value']++;
-      }
-    }
-    if(node.children) {
-      node.children.forEach(countOrganisms);
-    }
-  }
-  data.children.forEach(countOrganisms);
-
-  // flatten counts hash into an array
-  var organismsArr = [];
-  for (var organismId in organisms) {
-    organismsArr.push( organisms[organismId] );
-  }
-
-  options = options || {};
-  var fill = options.fill || function(node) {
-    return 'cyan';
-  };
-  var nodeMouseOver = options.nodeMouseOver || function(d) {};
-  var nodeMouseOut = options.nodeMouseOut || function(d) {};
-  var nodeMouseDown = options.nodeMouseDown || function(d) {};
-  
-  var w = options.width || d3.select(selector).style('width') || d3.select(selector).attr('width'),
-  h = options.height || d3.select(selector).style('height') || d3.select(selector).attr('height'),
-  w = parseInt(w),
-  h = parseInt(h);
-  
-  var format = d3.format(",d");
-  
-  var bubble = d3.layout.pack()
-    .sort(null)
-    .size([w, h]);
-  
-  var vis = d3.select(selector).append("svg:svg")
-    .attr("width",  w +'px')
-    .attr("height", h +'px')
-    .attr("class", "bubble");
-  
-  var node = vis.selectAll("g.node")
-    .data(bubble.nodes( { 'children': organismsArr } )
-          .filter(function(d) { return !d.children; }))
-    .enter().append("svg:g")
-    .attr("class", "node")
-    .on('click', nodeMouseDown)
-    .on('mouseover', nodeMouseOver)
-    .on('mouseout', nodeMouseOut)    
-    .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
-  
-  node.append("svg:title")
-    .text(function(d) { return d.name + ": " + format(d.value); });
-  
-  node.append("svg:circle")
-    .attr("r", function(d) { return d.r; })
-    .style("fill", function(d) { return fill(d); });
-  
-  node.append("svg:text")
-    .attr("text-anchor", "middle")
-    .attr('font-size', '90%')
-    .attr("dy", ".3em")
-    .text(function(d) {
-      return d.name + ' (' + d.value +')';
-    });
-  d3.select(self.frameElement).style("height", h + "px");
-}

+ 3 - 123
tripal_phylogeny/theme/js/tripal_phylogeny.js

@@ -1,11 +1,11 @@
 /* phylotree d3js graphs */
 
 (function ($) {
-  
+
   var height = 0; // will be dynamically sized
-  
+
   $(document).ready( function () {
-        
+
     var nodeSize = function(d) {
       var size;
       if (d.cvterm_name == "phylo_root") {
@@ -65,123 +65,19 @@
     // callback for mousedown/click event on graph node d
     var nodeMouseDown = function(d) {
       var el = $(this);
-      var dialog = $('#phylonode_popup_dialog');
       var title = (! d.children ) ? d.name : 'interior node ' + d.phylonode_id;
 
       if(d.children) {
         // interior node
         if(d.phylonode_id) {
-          var link = $('#phylonode_context_link');
-          // eventually, this link will be replaced with something internal to the site; note that the trailing slash is somewhat important to avoid apparent hanging due to the way django handles url pattern matching
-          link.attr('href', 'http://comparative-legumes.org/chado/context_viewer/' + d.phylonode_id + '/');
-          link.text('View Genomic Contexts for genes in this subtree');
-          link.show();
         }
         else {
           // this shouldn't happen but ok
-          $('#phylonode_context_link').hide();
         }
-        
-        // show dialog content relevant for interior node
-        // go_link not ready for prime time
-        // $('#phylonode_go_link').show();
-        $('#phylonode_go_link').hide();
-        $('#phylonode_context_link').show();
-        
-        // hide dialog content which is only applicable to leaf nodes
-        $('#phylonode_organism_link').hide();
-        $('#phylonode_feature_link').hide();
       }
       else {
         // leaf node
-
-        // show dialog content relevant for leaf node
-        $('#phylonode_organism_link').show();
-        $('#phylonode_feature_link').show();
-        
-        // hide dialog content which is only applicable to interior nodes
-        $('#phylonode_go_link').hide();
-        $('#phylonode_context_link').hide();
-        
-        if(d.feature_node_id) {
-          var link = $('#phylonode_feature_link');
-          link.attr('href', '?q=node/' + d.feature_node_id);
-          link.text('view feature: ' + d.feature_name);
-          link.show();
-
-        }
-        else {
-          // this shouldn't happen but ok
-          $('#phylonode_feature_link').hide();
-        }
-        if (d.feature_name) {
-          var link = $('#phylonode_gene_linkout');
-          //FIXME: hack depending on typical naming conventions. we can certainly do better
-          var transcript = d.feature_name.replace(/^.....\./, "");
-          var gene = transcript.replace(/\.\d+$/, "");
-          if (d.fo_genus == 'Glycine' && d.fo_species == 'max') {
-                  link.attr('href', 'http://www.soybase.org/sbt/search/search_results.php?category=FeatureName&search_term=' + gene);
-                  //link.attr('href', 'http://www.soybase.org/gb2/gbrowse/gmax2.0/?q=' + gene + ';dbid=gene_models_wm82_a2_v1');
-                  link.text('view at SoyBase: ' + gene);
-                  link.show();
-          }
-          else if (d.fo_genus == 'Phaseolus' && d.fo_species == 'vulgaris') {
-                  link.attr('href', 'http://phytozome.jgi.doe.gov/pz/portal.html#!gene?organism=Pvulgaris&searchText=locusName:' + gene);
-                  link.text('view at Phytozome: ' + gene);
-                  link.show();
-          }
-          else if (d.fo_genus == 'Medicago' && d.fo_species == 'truncatula') {
-                  link.attr('href', 'http://medicago.jcvi.org/medicago/jbrowse/?data=data%2Fjson%2Fmedicago&loc='+transcript+'&tracks=DNA%2Cgene_models&highlight=');
-                  link.text('view at JCVI: ' + transcript);
-                  link.show();
-          }
-          else if (d.fo_genus == 'Arachis' && d.fo_species == 'duranensis') {
-                  //link.attr('href', 'http://peanutbase.org/gb2/gbrowse/Aradu1.0/?q=' + gene);
-                  //link.attr('href', 'http://peanutbase-stage.agron.iastate.edu/gb2/gbrowse/Aradu1.0/?q=' + gene);
-                  link.attr('href', 'http://peanutbase.org/gb2/gbrowse/Aradu1.0/?q=' + gene + ';dbid=gene_models');
-                  //link.attr('href', 'http://peanutbase-stage.agron.iastate.edu/gb2/gbrowse/Aradu1.0/?q=' + gene + ';dbid=gene_models');
-                  link.text('view at PeanutBase: ' + gene);
-                  link.show();
-          }
-          else if (d.fo_genus == 'Arachis' && d.fo_species == 'ipaensis') {
-                  //link.attr('href', 'http://peanutbase.org/gb2/gbrowse/Araip1.0/?q=' + gene);
-                  //link.attr('href', 'http://peanutbase-stage.agron.iastate.edu/gb2/gbrowse/Araip1.0/?q=' + gene);
-                  link.attr('href', 'http://peanutbase.org/gb2/gbrowse/Araip1.0/?q=' + gene + ';dbid=gene_models');
-                  //link.attr('href', 'http://peanutbase-stage.agron.iastate.edu/gb2/gbrowse/Araip1.0/?q=' + gene + ';dbid=gene_models');
-                  link.text('view at PeanutBase: ' + gene);
-                  link.show();
-          }
-          else if (d.fo_genus == 'Arabidopsis' && d.fo_species == 'thaliana') {
-                  link.attr('href', ' http://www.araport.org/locus/' + gene);
-                  link.text('view at Arabidopsis Information Portal: ' + gene);
-                  link.show();
-          }
-          else {
-                  link.hide();
-          }
-        
-        }
-        if(d.fo_organism_id) {
-          var link = $('#phylonode_organism_link');
-          link.attr('href', d.fo_organism_node_id ?
-                    '?q=node/' + d.fo_organism_node_id : '#');
-          link.text('view organism: ' + d.fo_genus + ' '+
-                    d.fo_species + ( d.fo_common_name ? ' (' + d.fo_common_name + ')' : '' ) );
-          link.show();
-        } 
-        else {
-          // there should always be an organism id, but degrade gracefully
-          $('#phylonode_organism_link').hide();
-        }
       }
-    
-      dialog.dialog( {
-        title : title,
-        closeOnEscape : false,
-        modal : false,
-        position : { my : 'center center', at : 'center center', of : el },
-        show : { effect: 'blind', direction: 'down', duration: 200 }
-      });
     };
 
     $.getJSON(phylotreeDataURL, function(treeData) {
@@ -200,22 +96,6 @@
         'nodeMouseOut' : nodeMouseOut,
         'nodeMouseDown' : nodeMouseDown
       });
-      d3.phylogram.buildRadial('#phylotree-radial-graph', treeData, {
-        'width' : treeOptions['dendrogram_width'], // square graph 
-        'fill' : organismColor,
-        'size' : nodeSize,
-        'nodeMouseOver' : nodeMouseOver,
-        'nodeMouseOut' : nodeMouseOut,
-        'nodeMouseDown' : nodeMouseDown
-      });
-      organismBubblePlot('#phylotree-organisms', treeData, {
-        'height' : treeOptions['bubble_width'], // square graph
-        'width' : treeOptions['bubble_width'], 
-        'fill' : organismColor,
-        'nodeMouseOver' : nodeMouseOver,
-        'nodeMouseOut' : nodeMouseOut,
-        'nodeMouseDown' : nodeMouseDown
-      });
     }
 
     /* graphHeight() generate graph height based on leaf nodes */

+ 0 - 0
tripal_phylogeny/theme/templates/tripal_phylotree_analysis.tpl.php → tripal_phylogeny/theme/templates/tripal_phylogeny_analysis.tpl.php


+ 2 - 3
tripal_phylogeny/theme/templates/tripal_phylotree_base.tpl.php → tripal_phylogeny/theme/templates/tripal_phylogeny_base.tpl.php

@@ -1,8 +1,7 @@
 <?php
-$phylotree = $variables['node']->phylotree; 
+$phylotree = $variables['node']->phylotree;
 $phylotree = chado_expand_var($phylotree,'field','phylotree.comment'); ?>
 
-
 <div class="tripal_phylogeny-data-block-desc tripal-data-block-desc"> <?php
 
 // the $headers array is an array of fields to use as the colum headers.
@@ -70,4 +69,4 @@ $table = array(
 
 // once we have our table array structure defined, we call Drupal's theme_table()
 // function to generate the table.
-print theme_table($table);  ?>
+print theme_table($table);

+ 0 - 0
tripal_phylogeny/theme/templates/tripal_phylotree_help.tpl.php → tripal_phylogeny/theme/templates/tripal_phylogeny_help.tpl.php


+ 0 - 0
tripal_phylogeny/theme/templates/tripal_phylotree_organisms.tpl.php → tripal_phylogeny/theme/templates/tripal_phylogeny_organisms.tpl.php


+ 19 - 0
tripal_phylogeny/theme/templates/tripal_phylogeny_phylogram.tpl.php

@@ -0,0 +1,19 @@
+<?php
+$phylotree = $variables['node']->phylotree;
+
+if ($phylotree->type_id->name != "taxonomy" and $phylotree->has_nodes) {
+
+  if ($phylotree->type_id and $phylotree->type_id->name == 'polypeptide') { ?>
+    <p>Phylogenies are essential to any analysis of evolutionary gene
+      sequences collected across a group of organisms. A <b>phylogram</b>
+      is a phylogenetic tree that has branch spans proportional to the
+      amount of character change.
+    </p> <?php
+  } ?>
+
+  <div id="phylogram">
+    <!-- d3js will add svg to this div, and remove the loader gif prefix with / for absolute url --><?php
+    $ajax_loader = url(drupal_get_path('module', 'tripal_phylogeny') . '/theme/images/ajax-loader.gif'); ?>
+    <img src="<?php print $ajax_loader ?>" class="phylogram-ajax-loader"/>
+  </div> <?php
+}

+ 0 - 0
tripal_phylogeny/theme/templates/tripal_phylotree_references.tpl.php → tripal_phylogeny/theme/templates/tripal_phylogeny_references.tpl.php


+ 11 - 0
tripal_phylogeny/theme/templates/tripal_phylogeny_taxonomic_tree.tpl.php

@@ -0,0 +1,11 @@
+<?php
+$phylotree = $variables['node']->phylotree;
+$phylotree = chado_expand_var($phylotree,'field','phylotree.comment');
+
+if ($phylotree->type_id->name == "taxonomy" and $phylotree->has_nodes) { ?>
+  <div id="phylogram">
+    <!-- d3js will add svg to this div, and remove the loader gif prefix with / for absolute url --><?php
+    $ajax_loader = url(drupal_get_path('module', 'tripal_phylogeny') . '/theme/images/ajax-loader.gif'); ?>
+    <img src="<?php print $ajax_loader ?>" class="phylogram-ajax-loader"/>
+  </div> <?php
+}

+ 0 - 0
tripal_phylogeny/theme/templates/tripal_phylotree_teaser.tpl.php → tripal_phylogeny/theme/templates/tripal_phylogeny_teaser.tpl.php


+ 0 - 33
tripal_phylogeny/theme/templates/tripal_phylotree_phylogram.tpl.php

@@ -1,33 +0,0 @@
-<?php
-$phylotree = $variables['node']->phylotree;
-
-if ($phylotree->type_id->name != "taxonomy" and $phylotree->has_nodes) {
-
-  if ($phylotree->type_id and $phylotree->type_id->name == 'polypeptide') { ?>
-    <p>Phylogenies are essential to any analysis of evolutionary gene
-      sequences collected across a group of organisms. A <b>phylogram</b>
-      is a phylogenetic tree that has branch spans proportional to the
-      amount of character change.
-    </p> <?php
-  } ?>
-
-  <div id="phylogram">
-    <!-- d3js will add svg to this div, and remove the loader gif prefix with / for absolute url -->
-    <img src="/<?php print drupal_get_path('module', 'tripal_phylogeny') ?>/theme/images/ajax-loader.gif" class="phylogram-ajax-loader"/>
-  </div>
-
-  <div id="phylonode_popup_dialog" style="display: none;">
-    <!-- these links are for leaf nodes only -->
-    <div><a id="phylonode_feature_link" href="" tabindex="-1"></a></div>
-    <div><a id="phylonode_gene_linkout" href="" tabindex="-1"></a></div>
-    <div><a id="phylonode_context_search_link" href="" tabindex="-1"></a></div>
-    <div><a id="phylonode_organism_link" href="" tabindex="-1"></a></div>
-
-    <!-- these links are for interior nodes only -->
-    <div><a id="phylonode_go_link" href="?block=phylotree_go" class="tripal_toc_list_item_link"  tabindex="-1">
-      View Gene Ontology</a></div>
-    <!-- removed tripal_toc_list_item_link from context link, at least while it is a link off the site -->
-    <div><a id="phylonode_context_link" href="?block=phylotree_context" class="" tabindex="-1">
-      View Context</a></div>
-  </div> <?php
-}

+ 0 - 8
tripal_phylogeny/theme/templates/tripal_phylotree_radial.tpl.php

@@ -1,8 +0,0 @@
-<?php
-$phylotree = $variables['node']->phylotree; 
-
-if ($phylotree->has_nodes) { ?>
-  <div id="phylotree-radial-graph">
-    <!-- d3 will add svg to this div -->
-  </div> <?php 
-} ?>

+ 0 - 24
tripal_phylogeny/theme/templates/tripal_phylotree_taxonomic_tree.tpl.php

@@ -1,24 +0,0 @@
-<?php
-$phylotree = $variables['node']->phylotree;
-
-if ($phylotree->type_id->name == "taxonomy" and $phylotree->has_nodes) { ?>
-  <div id="phylogram">
-    <!-- d3js will add svg to this div, and remove the loader gif prefix with / for absolute url -->
-    <img src="/<?php print drupal_get_path('module', 'tripal_phylogeny') ?>/theme/images/ajax-loader.gif" class="phylogram-ajax-loader"/>
-  </div>
-
-  <div id="phylonode_popup_dialog" style="display: none;">
-    <!-- these links are for leaf nodes only -->
-    <div><a id="phylonode_feature_link" href="" tabindex="-1"></a></div>
-    <div><a id="phylonode_gene_linkout" href="" tabindex="-1"></a></div>
-    <div><a id="phylonode_context_search_link" href="" tabindex="-1"></a></div>
-    <div><a id="phylonode_organism_link" href="" tabindex="-1"></a></div>
-
-    <!-- these links are for interior nodes only -->
-    <div><a id="phylonode_go_link" href="?block=phylotree_go" class="tripal_toc_list_item_link"  tabindex="-1">
-      View Gene Ontology</a></div>
-    <!-- removed tripal_toc_list_item_link from context link, at least while it is a link off the site -->
-    <div><a id="phylonode_context_link" href="?block=phylotree_context" class="" tabindex="-1">
-      View Context</a></div>
-  </div> <?php
-}

+ 13 - 27
tripal_phylogeny/theme/tripal_phylogeny.theme.inc

@@ -8,10 +8,9 @@ function tripal_phylogeny_preprocess_tripal_phylogeny_phylogram(&$variables) {
   $phylotree = $variables['node']->phylotree;
   $module_path = drupal_get_path('module', 'tripal_phylogeny');
 
-  drupal_add_js('//cdnjs.cloudflare.com/ajax/libs/d3/3.4.8/d3.min.js', 'external');
+  drupal_add_js('https://d3js.org/d3.v3.min.js', 'external');
 
   drupal_add_js("$module_path/theme/js/d3.phylogram.js");
-  drupal_add_js("$module_path/theme/js/organism-bubble-plot.js");
   drupal_add_js("$module_path/theme/js/tripal_phylogeny.js");
   drupal_add_css("$module_path/theme/css/tripal_phylogeny.css");
 
@@ -20,10 +19,8 @@ function tripal_phylogeny_preprocess_tripal_phylogeny_phylogram(&$variables) {
   // Get the tree options as set by the administrator.
   $options = json_encode(array(
     'phylogram_width' => variable_get('tripal_phylogeny_default_phylogram_width', 350),
-    'dendrogram_width' => variable_get('tripal_phylogeny_default_dendrogram_width', 500),
-    'bubble_width' => variable_get('tripal_phylogeny_default_bubble_width', 500),
-    'root_node_size' => variable_get('tripal_phylogeny_default_root_node_size', 6),
-    'interior_node_size' => variable_get('tripal_phylogeny_default_interior_node_size', 6),
+    'root_node_size' => variable_get('tripal_phylogeny_default_root_node_size', 3),
+    'interior_node_size' => variable_get('tripal_phylogeny_default_interior_node_size', 1),
     'leaf_node_size' => variable_get('tripal_phylogeny_default_leaf_node_size', 6),
   ));
 
@@ -38,16 +35,16 @@ function tripal_phylogeny_preprocess_tripal_phylogeny_phylogram(&$variables) {
   $colors = json_encode($colors);
 
   // Add javascript data needed for this tree.
-  drupal_add_js("
+  drupal_add_js('
       // var having URL of json data source for charting
-      var phylotreeDataURL = \"/chado_phylotree/$phylotree->phylotree_id/json\";
+      var phylotreeDataURL =  baseurl + "/chado_phylotree/' . $phylotree->phylotree_id . '/json";
       // var with path to our theme, for use by javascript functions.
-      var pathToTheme = \"/$module_path/theme\";
+      var pathToTheme = "/' . $module_path . '/theme";
       // var with custom options
-      var treeOptions = $options;
+      var treeOptions = ' . $options . ';
       // var with the organism colors
-      var organismColors = $colors;
-    ",
+      var organismColors = ' . $colors . ';
+    ',
     'inline'
   );
   tripal_phylogeny_set_tree_vars($phylotree);
@@ -62,34 +59,23 @@ function tripal_phylogeny_preprocess_tripal_phylogeny_taxonomic_tree(&$variables
   $phylotree = $variables['node']->phylotree;
   $module_path = drupal_get_path('module', 'tripal_phylogeny');
 
-  drupal_add_js('//cdnjs.cloudflare.com/ajax/libs/d3/3.4.8/d3.min.js', 'external');
+  drupal_add_js('https://d3js.org/d3.v4.js', 'external');
 
   drupal_add_js("$module_path/theme/js/d3.phylogram.js");
-  drupal_add_js("$module_path/theme/js/organism-bubble-plot.js");
   drupal_add_js("$module_path/theme/js/tripal_phylogeny.js");
   drupal_add_css("$module_path/theme/css/tripal_phylogeny.css");
 
   drupal_add_library('system', 'ui.dialog');
 
-  drupal_add_js("
+  drupal_add_js('
     // var having URL of json data source for charting
-    var phylotreeDataURL = \"/chado_phylotree/$phylotree->phylotree_id/json\";
+    var phylotreeDataURL = baseurl + "/chado_phylotree/' . $phylotree->phylotree_id . '/json";
     // var with path to our theme, for use by javascript functions.
-    var pathToTheme = \"/$module_path/theme\";
-    ",
+    var pathToTheme = "/' . $module_path . '/theme";',
     'inline'
   );
   tripal_phylogeny_set_tree_vars($phylotree);
 }
-/**
- * Implements hook_preprocess_hook();
- *
- * @param $variables
- */
-function tripal_phylogeny_preprocess_tripal_phylogeny_radial(&$variables) {
-  $phylotree = $variables['node']->phylotree;
-  tripal_phylogeny_set_tree_vars($phylotree);
-}
 
 /**
  * Implements hook_preprocess_hook();

+ 1 - 1
tripal_phylogeny/tripal_phylogeny.info

@@ -1,5 +1,5 @@
 name = Tripal Phylotree
-description = Supports the phylogeny tables of Chado by providing pages for viewing and editing of phylotrees. Table list at: http://gmod.org/wiki/Chado_Phylogeny_Module
+description = Supports the phylogeny tables of Chado by providing pages for viewing and editing of phylotrees. Table list at: http://gmod.org/wiki/chado_phylotree_Module. This module was added to Tripal through collaboration with the LegumeInformation group (http://http://legumeinfo.org/)
 core = 7.x
 project = tripal_phylogeny
 package = Tripal Extensions

+ 30 - 23
tripal_phylogeny/tripal_phylogeny.module

@@ -17,7 +17,7 @@ require_once 'theme/tripal_phylogeny.theme.inc';
 require_once 'includes/tripal_phylogeny.admin.inc';
 require_once 'includes/tripal_phylogeny.chado_node.inc';
 require_once 'includes/tripal_phylogeny.import_tree.inc';
-require_once 'includes/tripal_phylogeny.taxonomy_import.inc';
+require_once 'includes/tripal_phylogeny.taxonomy.inc';
 
 /**
  * Implements hook_permission().
@@ -55,16 +55,16 @@ function tripal_phylogeny_menu() {
 
   // administration landing page. currently has no content but is
   // apparently required for the Sync and Help links to work.
-  $items['admin/tripal/extension/tripal_phylogeny'] = array(
-    'title' => 'Phylotrees',
-    'description' => 'Phylogenetic trees & gene families',
+  $items['admin/tripal/chado/tripal_phylogeny'] = array(
+    'title' => 'Phylogeny and Taxonomy',
+    'description' => 'Phylogenetic and taxonomic trees.',
     'page callback' => 'tripal_phylogeny_admin_phylotrees_listing',
     'access arguments' => array('administer tripal phylotree'),
     'type' => MENU_NORMAL_ITEM,
   );
 
   // help menu
-  $items['admin/tripal/extension/tripal_phylogeny/help'] = array(
+  $items['admin/tripal/chado/tripal_phylogeny/help'] = array(
     'title' => 'Help',
     'description' => 'Basic Description of Tripal Phylotree Module Functionality',
     'page callback' => 'theme',
@@ -75,7 +75,7 @@ function tripal_phylogeny_menu() {
   );
 
   // configuration menu item
-  $items['admin/tripal/extension/tripal_phylogeny/configuration'] = array(
+  $items['admin/tripal/chado/tripal_phylogeny/configuration'] = array(
     'title' => 'Settings',
     'description' => 'Configure the Tripal Phylotree module',
     'page callback' => 'drupal_get_form',
@@ -85,9 +85,9 @@ function tripal_phylogeny_menu() {
     'weight' => 1
   );
 
-  $items['admin/tripal/extension/tripal_phylogeny/plots'] = array(
+  $items['admin/tripal/chado/tripal_phylogeny/plots'] = array(
     'title' => 'Plot Defaults',
-    'description' => 'Set defaults for the trees, dendrograms and bubble plot',
+    'description' => 'Set defaults for the trees',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_phylogeny_default_plots_form'),
     'access arguments' => array('administer tripal phylotree'),
@@ -96,7 +96,7 @@ function tripal_phylogeny_menu() {
   );
 
   // sync menu item (will be rendered as a tab by tripal)
-  $items['admin/tripal/extension/tripal_phylogeny/sync'] = array(
+  $items['admin/tripal/chado/tripal_phylogeny/sync'] = array(
     'title' => ' Sync',
     'description' => 'Create pages on this site for phylotrees stored in Chado',
     'page callback' => 'drupal_get_form',
@@ -107,7 +107,7 @@ function tripal_phylogeny_menu() {
   );
 
   // Enable admin view
-  $items['admin/tripal/extension/tripal_phylogeny/views/phylotree/enable'] = array(
+  $items['admin/tripal/chado/tripal_phylogeny/views/phylotree/enable'] = array(
     'title' => 'Enable Phylotree Administrative View',
     'page callback' => 'tripal_enable_view',
     'page arguments' => array('tripal_phylogeny_admin_phylotree', 'admin/tripal/chado/tripal_phylogeny'),
@@ -118,32 +118,45 @@ function tripal_phylogeny_menu() {
   $items['chado_phylotree/%'] = array(
     'page callback' => 'phylotree_by_name',
     'page arguments' => array(1),
-    'access callback' => TRUE // allow all anonymous http clients
+    // allow all anonymous http clients
+    'access callback' => TRUE
   );
 
    // create a route for viewing json of all phylonodes having this phylotree_id
    $items['chado_phylotree/%/json'] = array(
     'page callback' => 'phylotree_json',
     'page arguments' => array(1),
-    'access callback' => TRUE // allow all anonymous http clients
+     // allow all anonymous http clients
+    'access callback' => TRUE
    );
 
    // Data Loaders
-   $items['admin/tripal/loaders/newic_tree_loader'] = array(
-     'title' => 'Phylogenetic Trees',
-     'description' => 'Loads phylogenetic trees. (Redirects to create a phylogenetic tree content type)',
+   $items['admin/tripal/loaders/newic_phylotree_loader'] = array(
+     'title' => 'Phylogenetic Trees (Newic format)',
+     'description' => 'Loads phylogenetic trees in Newic format. (Redirects to create a phylogenetic tree content type)',
      'page callback' => 'drupal_goto',
      'page arguments' => array('node/add/chado-phylotree'),
      'access arguments' => array('administer tripal phylotree'),
      'type' => MENU_NORMAL_ITEM,
    );
-   $items['admin/tripal/loaders/taxonomy_loader'] = array(
+
+   $items['admin/tripal/loaders/ncbi_taxonomy_loader'] = array(
      'title' => 'NCBI Taxonomy Loader',
      'description' => 'Loads taxonomic details about installed organisms.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('tripal_phylogeny_taxonomy_load_form'),
      'access arguments' => array('administer tripal phylotree'),
-     'file' => '/includes/tripal_phylogeny.taxonomy_import.inc',
+     'file' => '/includes/tripal_phylogeny.taxonomy.inc',
+     'type' => MENU_NORMAL_ITEM,
+   );
+
+   $items['taxonomy_view'] = array(
+     'title' => 'Site Taxonomy',
+     'description' => 'A taxonomy viewer for the species on this site.',
+     'page callback' => 'drupal_get_form',
+     'page arguments' => array('tripal_phylogeny_taxonomy_viewer'),
+     'access arguments' => array('access taxonomy content'),
+     'file' => '/includes/tripal_phylogeny.taxonomy.inc',
      'type' => MENU_NORMAL_ITEM,
    );
 
@@ -224,12 +237,6 @@ function tripal_phylogeny_theme($existing, $type, $theme, $path) {
       'template' => 'tripal_phylogeny_organisms',
       'path' => "$path/theme/templates",
     ),
-    // partial for phylotree radial block
-    'tripal_phylogeny_radial' => array(
-      'variables' => array('node' => NULL),
-      'template' => 'tripal_phylogeny_radial',
-      'path' => "$path/theme/templates",
-    ),
     // partial for cross references block
     'tripal_phylogeny_references' => array(
       'variables' => array('node' => NULL),

+ 1 - 6
tripal_phylogeny/tripal_phylogeny.views.inc

@@ -18,11 +18,6 @@
  */
 function tripal_phylogeny_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'tripal_phylogeny') . '/views_handlers',
-    ),
-    'handlers' => array(
-      
-    ),
+
   );
 }

+ 11 - 63
tripal_phylogeny/tripal_phylogeny.views_default.inc

@@ -12,8 +12,8 @@
 function tripal_phylogeny_views_default_views() {
   $views = array();
 
-  // User View ("Search Biological Content") 
-  // Remember, if you change the name/path of this view, you also want to 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view, you also want to
   // change it's description in tripal_phylogeny_search_biological_data_views()
   $view = tripal_phylogeny_defaultvalue_user_phylotrees();
   $view = tripal_make_view_compatible_with_external($view);
@@ -38,12 +38,12 @@ function tripal_phylogeny_defaultview_admin_phylotree() {
   $view->description = 'DO NOT DISABLE';
   $view->tag = 'tripal admin';
   $view->base_table = 'phylotree';
-  $view->human_name = 'Phylotree Admin';
+  $view->human_name = 'Phylogeny Admin';
   $view->core = 0;
   $view->api_version = '3.0';
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
-  
-  /* Display: Master */
+
+  /* Display: phylotree_all */
   $handler = $view->new_display('default', 'phylotree_all', 'default');
   $handler->display->display_options['title'] = 'Phylogeny';
   $handler->display->display_options['use_more_always'] = FALSE;
@@ -62,7 +62,7 @@ function tripal_phylogeny_defaultview_admin_phylotree() {
   $handler->display->display_options['header']['action_links_area']['label'] = 'Action Links';
   $handler->display->display_options['header']['action_links_area']['link-1'] = array(
     'label-1' => 'Add Phylogenetic Tree',
-    'path-1' => 'node/add/tripal-phylotree',
+    'path-1' => 'node/add/chado-phylotree',
   );
   $handler->display->display_options['header']['action_links_area']['link-2'] = array(
     'label-2' => '',
@@ -140,70 +140,18 @@ function tripal_phylogeny_defaultview_admin_phylotree() {
     3 => 0,
   );
   $handler->display->display_options['filters']['name_1']['max_length'] = '40';
-  /* Filter criterion: Chado Analysis: Name */
-  $handler->display->display_options['filters']['name']['id'] = 'name';
-  $handler->display->display_options['filters']['name']['table'] = 'analysis';
-  $handler->display->display_options['filters']['name']['field'] = 'name';
-  $handler->display->display_options['filters']['name']['value'] = array();
-  $handler->display->display_options['filters']['name']['group'] = 1;
-  $handler->display->display_options['filters']['name']['exposed'] = TRUE;
-  $handler->display->display_options['filters']['name']['expose']['operator_id'] = 'name_op';
-  $handler->display->display_options['filters']['name']['expose']['label'] = 'Analysis';
-  $handler->display->display_options['filters']['name']['expose']['description'] = 'Select one or more analyses to filter trees.';
-  $handler->display->display_options['filters']['name']['expose']['operator'] = 'name_op';
-  $handler->display->display_options['filters']['name']['expose']['identifier'] = 'name';
-  $handler->display->display_options['filters']['name']['expose']['remember_roles'] = array(
-    2 => '2',
-    1 => 0,
-    3 => 0,
-  );
-  $handler->display->display_options['filters']['name']['values_form_type'] = 'select';
-  $handler->display->display_options['filters']['name']['select_multiple'] = TRUE;
-  $handler->display->display_options['filters']['name']['select_optional'] = TRUE;
-  $handler->display->display_options['filters']['name']['max_length'] = '40';
-  /* Filter criterion: Chado Cvterm: Name */
-  $handler->display->display_options['filters']['name_2']['id'] = 'name_2';
-  $handler->display->display_options['filters']['name_2']['table'] = 'cvterm';
-  $handler->display->display_options['filters']['name_2']['field'] = 'name';
-  $handler->display->display_options['filters']['name_2']['exposed'] = TRUE;
-  $handler->display->display_options['filters']['name_2']['expose']['operator_id'] = 'name_2_op';
-  $handler->display->display_options['filters']['name_2']['expose']['label'] = 'Leaf node type';
-  $handler->display->display_options['filters']['name_2']['expose']['description'] = 'Provide the type of leaf node (e.g. polypeptide, taxonomic, etc).';
-  $handler->display->display_options['filters']['name_2']['expose']['operator'] = 'name_2_op';
-  $handler->display->display_options['filters']['name_2']['expose']['identifier'] = 'name_2';
-  $handler->display->display_options['filters']['name_2']['expose']['remember_roles'] = array(
-    2 => '2',
-    1 => 0,
-    3 => 0,
-  );
-  $handler->display->display_options['filters']['name_2']['max_length'] = '40';
-  /* Filter criterion: Chado Phylotree: Comment */
-  $handler->display->display_options['filters']['comment']['id'] = 'comment';
-  $handler->display->display_options['filters']['comment']['table'] = 'phylotree';
-  $handler->display->display_options['filters']['comment']['field'] = 'comment';
-  $handler->display->display_options['filters']['comment']['exposed'] = TRUE;
-  $handler->display->display_options['filters']['comment']['expose']['operator_id'] = 'comment_op';
-  $handler->display->display_options['filters']['comment']['expose']['label'] = 'Description';
-  $handler->display->display_options['filters']['comment']['expose']['description'] = 'Find a tree using words in the tree description.';
-  $handler->display->display_options['filters']['comment']['expose']['use_operator'] = TRUE;
-  $handler->display->display_options['filters']['comment']['expose']['operator'] = 'comment_op';
-  $handler->display->display_options['filters']['comment']['expose']['identifier'] = 'comment';
-  $handler->display->display_options['filters']['comment']['expose']['remember_roles'] = array(
-    2 => '2',
-    1 => 0,
-    3 => 0,
-  );
-  
+
   /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page');
   $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_phylogeny/phylotree';
   $handler->display->display_options['menu']['type'] = 'default tab';
-  $handler->display->display_options['menu']['title'] = 'Phylogenetic Tree';
+  $handler->display->display_options['menu']['title'] = 'Trees';
   $handler->display->display_options['menu']['weight'] = '0';
   $handler->display->display_options['menu']['context'] = 0;
   $handler->display->display_options['menu']['context_only_inline'] = 0;
   $handler->display->display_options['tab_options']['weight'] = '0';
-  
+
+
   return $view;
 }
 /**
@@ -323,6 +271,6 @@ function tripal_phylogeny_defaultvalue_user_phylotrees() {
     $handler->display->display_options['menu']['title'] = 'Phylogeny';
     $handler->display->display_options['menu']['description'] = 'Gene trees, species trees, etc.';
     $handler->display->display_options['menu']['weight'] = '-10';
-  
+
     return $view;
 }

+ 1 - 1
tripal_views/api/tripal_views.api.inc

@@ -339,7 +339,7 @@ function mymodule_defaultview_<VIEW-TYPE>_<VIEW-MACHINE-NAME>() {
  * @param $view
  *   The default view definition object
  * @return
- *   The default view with all relationships, fields, filters, sorts, arguements for
+ *   The default view with all relationships, fields, filters, sorts, arguments for
  *   Drupal tables removed.
  */
 function tripal_make_view_compatible_with_external($view) {

+ 1 - 1
tripal_views/includes/tripal_views_integration.inc

@@ -250,7 +250,7 @@ function tripal_views_get_integration_array_for_chado_table($table_name, $base_t
       if ($field_name == 'type_id' OR $field_name == 'cvterm_id') {
         $defn_array['fields'][$field_name]['handlers']['filter']['name'] = 'tripal_views_handler_filter_select_cvterm';
       }
-      if (preg_match('/name/',$field_name)) {
+      if (preg_match('/name/', $field_name)) {
         $defn_array['fields'][$field_name]['handlers']['filter']['name'] = 'tripal_views_handler_filter_select_string';
       }
     }

+ 1 - 1
tripal_views/tripal_views.info

@@ -11,9 +11,9 @@ files[] = views/handlers/tripal_views_handler_filter_file_upload.inc
 files[] = views/handlers/tripal_views_handler_field_sequence.inc
 files[] = views/handlers/tripal_views_handler_filter_no_results.inc
 files[] = views/handlers/tripal_views_handler_filter_sequence.inc
+files[] = views/handlers/tripal_views_handler_filter_select_string.inc
 files[] = views/handlers/tripal_views_handler_filter_select_cvterm.inc
 files[] = views/handlers/tripal_views_handler_filter_select_id.inc
-files[] = views/handlers/tripal_views_handler_filter_select_string.inc
 files[] = views/handlers/tripal_views_handler_field_aggregate.inc
 
 dependencies[] = views

+ 0 - 64
tripal_views/tripal_views.views.inc

@@ -6,69 +6,6 @@
 
 include 'views/handlers/tripal_views_handler_area_action_links.inc';
 
-/**
- * Implements hook_views_handlers().
- *
- * Purpose: Register all custom handlers with views
- *   where a handler describes either "the type of field",
- *   "how a field should be filtered", "how a field should be sorted"
- *
- * @return
- *   An array of handler definitions
- *
- * @ingroup tripal_views
- */
-function tripal_views_views_handlers() {
-
-  return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'tripal_views') . '/views/handlers',
-    ),
-    'handlers' => array(
-
-      // Custom Tripal Field Handlers
-      /** CANT FIX UNTIL Tripal Feature is working
-      'tripal_views_handler_field_sequence' => array(
-        'parent' => 'views_handler_field',
-      ),
-      */
-
-      // Custom area handler
-      'tripal_views_handler_area_action_links' => array(
-        'parent' => 'views_handler_area',
-      ),
-
-      // Custom Tripal Filter Handlers
-      'tripal_views_handler_filter_no_results' => array(
-        'parent' => 'views_handler_filter'
-      ),
-      'tripal_views_handler_filter_select_cvterm' => array(
-        'parent' => 'tripal_views_handler_filter_select_string',
-      ),
-      'tripal_views_handler_filter_select_id' => array(
-        'parent' => 'tripal_views_handler_filter_select_string',
-      ),
-      'tripal_views_handler_filter_select_string' => array(
-        'parent' => 'views_handler_filter_string',
-      ),
-      'tripal_views_handler_filter_textarea' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'tripal_views_handler_filter_file_upload' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      /** D7 @todo: get handlers working
-
-      */
-      /** CANT FIX UNTIL Tripal Feature is working
-      'tripal_views_handler_filter_sequence' => array(
-        'parent' => 'chado_views_handler_filter_string',
-      ),
-      */
-    ),
-  );
-}
-
 /**
  * Implements hook_views_pre_render().
  *
@@ -412,7 +349,6 @@ function tripal_views_views_data() {
         }
       }
   }
-
   return $data;
 }
 

+ 19 - 15
tripal_views/views/handlers/tripal_views_handler_filter_select_cvterm.inc

@@ -7,19 +7,23 @@
 /**
  * This Handler provides a select list for the type field
  *
- *  NOTE: This handler only works when applied to the type_id field in the base_table of
- *  this view.
+ *  NOTE: This handler only works when applied to the type_id field in the
+ *  base_table of the view.
  *
  * @ingroup tripal_views
  */
-class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_filter_select_string {
+class tripal_views_handler_filter_select_cvterm extends views_handler_filter_string {
+  /**
+   * {@inheritdoc}
+   */
 
   /**
    * Provide the options used in the select list.
    * Override this function in extended handlers to easily change option list.
    *
    * @return
-   *   An array of options where the key is the value of this field in the database
+   *   An array of options where the key is the value of this field in the
+   *   database
    */
   function get_select_options() {
 
@@ -36,7 +40,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
 
         $return = $this->get_select_option_where($this->table);
         $where_clauses = $return['where_clauses'];
-        $arguements = $return['arguements'];
+        $arguments = $return['arguments'];
         $base_where = '';
         if (!empty($where_clauses)) {
           $base_where = implode(' AND ', $where_clauses);
@@ -69,7 +73,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
         // show these exact types.
         $return = $this->get_select_option_where('cvterm');
         $where_clauses = $return['where_clauses'];
-        $cvterm_args = $return['arguements'];
+        $cvterm_args = $return['arguments'];
         $cvterm_where = '';
         if (!empty($where_clauses)) {
           $cvterm_where = implode(' AND ', $where_clauses);
@@ -78,13 +82,13 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
         // have been used.
         $return = $this->get_select_option_where($this->table);
         $where_clauses = $return['where_clauses'];
-        $base_args = $return['arguements'];
+        $base_args = $return['arguments'];
         $base_where = '';
         if (!empty($where_clauses)) {
           $base_where = implode(' AND ', $where_clauses);
         }
-        // We only supply one set or arguements those so merge the two.
-        $arguements = array_merge($cvterm_args, $base_args);
+        // We only supply one set or arguments those so merge the two.
+        $arguments = array_merge($cvterm_args, $base_args);
 
         // Using a "Loose Index Scan" to get a list of all the cvs used
         // in the table the drop-down filter is from.
@@ -110,7 +114,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
             ORDER BY cvterm.name ASC";
         $sql = format_string($sql, array('!table' => $this->table, '!field' => $this->field));
       }
-      $resource = chado_query($sql, $arguements);
+      $resource = chado_query($sql, $arguments);
 
       // Now actually gerenate the select list
       // based on the results from the above query.
@@ -130,7 +134,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
       // show these exact types.
       $return = $this->get_select_option_where('cvterm');
       $where_clauses = $return['where_clauses'];
-      $cvterm_args = $return['arguements'];
+      $cvterm_args = $return['arguments'];
       $cvterm_where = '';
       if (!empty($where_clauses)) {
         $cvterm_where = implode(' AND ', $where_clauses);
@@ -139,13 +143,13 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
       // have been used.
       $return = $this->get_select_option_where($this->table);
       $where_clauses = $return['where_clauses'];
-      $base_args = $return['arguements'];
+      $base_args = $return['arguments'];
       $base_where = '';
       if (!empty($where_clauses)) {
         $base_where = implode(' AND ', $where_clauses);
       }
-      // We only supply one set or arguements those so merge the two.
-      $arguements = array_merge($cvterm_args, $base_args);
+      // We only supply one set or arguments those so merge the two.
+      $arguments = array_merge($cvterm_args, $base_args);
 
       // Using a "Loose Index Scan" to get a list of all the cvterms used
       // in the base table. See https://wiki.postgresql.org/wiki/Loose_indexscan
@@ -167,7 +171,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
           ORDER BY cvterm.name ASC";
       $sql = format_string($sql, array('!table' => $this->table, '!field' => $this->field));
 
-      $resource = chado_query($sql, $arguements);
+      $resource = chado_query($sql, $arguments);
       $cvterms = array();
 
       // Add an "- Any - " option to allow a type to not be set by default.

+ 5 - 5
tripal_views/views/handlers/tripal_views_handler_filter_select_id.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Contains tripal_views_handler_filter_select_cvterm
+ * Contains tripal_views_handler_filter_select_string
  */
 
 /**
@@ -48,10 +48,10 @@ class tripal_views_handler_filter_select_id extends tripal_views_handler_filter_
     if (isset($this->options['show_all']) AND $this->options['show_all'] == TRUE) {
 
       // We still want to use any hidden fitlers on the parent table
-      // but the arguements will need to be field names rather than
+      // but the arguments will need to be field names rather than
       // generic placeholders so we need to tell get_select_option_where() that.
       $return = $this->get_select_option_where($this->parent_table, FALSE);
-      $args = $return['arguements'];
+      $args = $return['arguments'];
 
       // Simply grab all the values from the table referenced by
       // the foreign key constraint. Since we use the id as the key of
@@ -67,7 +67,7 @@ class tripal_views_handler_filter_select_id extends tripal_views_handler_filter_
 
       $return = $this->get_select_option_where($this->parent_table);
       $where_clauses = $return['where_clauses'];
-      $arguements = $return['arguements'];
+      $arguments = $return['arguments'];
       $where = '';
       if (!empty($where_clauses)) {
         $where = implode(' AND ', $where_clauses);
@@ -102,7 +102,7 @@ class tripal_views_handler_filter_select_id extends tripal_views_handler_filter_
         '!name_field' => $name_field
       ));
 
-      $resource = chado_query($sql, $arguements);
+      $resource = chado_query($sql, $arguments);
       $options = array();
 
       if ($this->options['select_optional']) {

+ 5 - 4
tripal_views/views/handlers/tripal_views_handler_filter_select_string.inc

@@ -88,7 +88,7 @@ class tripal_views_handler_filter_select_string extends views_handler_filter_str
 
     $return = $this->get_select_option_where();
     $where_clauses = $return['where_clauses'];
-    $arguements = $return['arguements'];
+    $arguments = $return['arguments'];
     $where = '';
     if (!empty($where_clauses)) {
       $where = ' WHERE ' . implode(' AND ', $where_clauses);
@@ -96,7 +96,7 @@ class tripal_views_handler_filter_select_string extends views_handler_filter_str
 
     // get the values from the table
     $sql = 'SELECT ' . $this->real_field . ' FROM {' . $this->table . '} ' . $where . ' ORDER BY ' . $this->field . ' ASC';
-    $results = chado_query($sql, $arguements);
+    $results = chado_query($sql, $arguments);
 
     // Build the select box options
     $max_length = (isset($this->options['max_length'])) ? $this->options['max_length'] : 40;
@@ -126,12 +126,13 @@ class tripal_views_handler_filter_select_string extends views_handler_filter_str
    *   An array of full qualified where clauses (ie: table.myfield = 'fred')
    */
   function get_select_option_where($table = NULL, $generic_placeholder = TRUE) {
+
     $where = array();
     $values = array();
 
     $table = (is_null($table)) ? $this->table : $table;
 
-    // build a where clause that will filter the list in the drop box
+    // Build a where clause that will filter the list in the drop box
     // using fields that are not exposed and that are for the table
     // from whcih the values in the drop box will be slected and
     // we only want to use non-exposed fields because these are not
@@ -177,7 +178,7 @@ class tripal_views_handler_filter_select_string extends views_handler_filter_str
 
     return array(
       'where_clauses' => $where,
-      'arguements' => $values
+      'arguments' => $values
     );
   }