Browse Source

Started adding code for analysis proprties, but then commented out because didn't have time to finish. Also, updated the tripal pub obo

spficklin 12 years ago
parent
commit
33ef81457a

+ 23 - 5
tripal_analysis/tripal_analysis.install

@@ -34,6 +34,18 @@ function tripal_analysis_update_6100() {
   // add the new materialized view
   tripal_analysis_add_mview_analysis_organism();
   
+  // move the analysis_type property into a new CV so that user's can change this property if
+  // they want too  
+  tripal_cv_add_cv('tripal_analysis', 'Terms used for managing analyses in Tripal');
+  
+  $sql = "
+    UPDATE {cvterm} SET cv_id = 
+      (SELECT cv_id FROM {cv} WHERE name = 'tripal_analysis')
+    WHERE cv_id = (SELECT cv_id FROM {cv} WHERE name = 'tripal') AND
+      name = 'analysis_type'
+  ";
+  chado_query($sql);
+  
   $ret = array(
     '#finished' => 1,
   );
@@ -65,28 +77,34 @@ function tripal_analysis_create_analysisfeatureprop(){
  */
 function tripal_analysis_add_cvterms(){
   
-  // add analysis_type
+  tripal_cv_add_cv('tripal_analysis', 'Terms used for managing analyses in Tripal');
+  
+  // add analysis_type. This goes in the 'tripal_analysis' CV so that site admins
+  // change change this property
   $term = array(
     'name' => 'analysis_type', 
     'def' => 'The type of analysis was performed. This value is automatically set by '.
              'each Tripal Analysis module and should be equal to the module name '.
              '(e.g. tripal_analysis_blast, tripal_analysis_go).'
   );
-  tripal_cv_add_cvterm($term, 'tripal', 0, 1, 'tripal');
+  tripal_cv_add_cvterm($term, 'tripal_analysis', 0, 1, 'tripal');
   
-  // add analysis_date
+  // add analysis_date.  This is no longer used (as far as we can tell) but we don't
+  // get rid of it in case it is used, so just keep it in the Tripal CV
   $term = array(
     'name' => 'analysis_date', 
     'def' => 'The date that an analysis was performed.'
   );
   tripal_cv_add_cvterm($term, 'tripal', 0, 1, 'tripal');
   
-  // add analysis_short_name
+  // add analysis_short_name.  This is no longer used (as far as we can tell) but we don't
+  // get rid of it in case it is used, so just keep it in the Tripal CV
   $term = array(
     'name' => 'analysis_short_name', 
     'def' => 'A computer legible (no spaces or special characters) abbreviation for the analysis.'
   );     
-  tripal_cv_add_cvterm($term, 'tripal', 0, 1 , 'tripal'); 
+  tripal_cv_add_cvterm($term, 'tripal', 0, 1 , 'tripal');     
+  
 }
 /**
  * Implementation of hook_uninstall().

+ 31 - 1
tripal_analysis/tripal_analysis.module

@@ -17,7 +17,7 @@
 require('api/tripal_analysis.api.inc');
 require('includes/tripal_analysis_privacy.inc');
 require('includes/tripal_analysis.admin.inc');
-
+require('includes/tripal_analysis-properties.inc');
 
 
 /**
@@ -63,8 +63,37 @@ function tripal_analysis_menu() {
       'type' => MENU_NORMAL_ITEM,
       'file' => 'includes/tripal_analysis.admin.inc',
   );
+  
+  //Edit/Deleting Properties-------------
+/*  $items['node/%ta_node/edit_analysis_properties'] = array(
+    'title' => 'Edit Properties',
+    'description' => 'Analysis Properties',
+    'page callback' => 'tripal_analysis_edit_ALL_properties_page',
+    'page arguments' => array(1),
+    'access arguments' => array('edit chado_analysis content'),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 8,
+  );*/
   return $items;
 }
+/**
+ * Implements Menu wildcard_load hook
+ * Purpose: Allows the node ID of a chado analysis to be dynamically
+ *   pulled from the path. The node is loaded from this node ID
+ *   and supplied to the page as an arguement
+ *
+ * @ingroup tripal_analysis
+ */
+function ta_node_load($nid) {  
+  if (is_numeric($nid)) {
+    $node = node_load($nid);
+    $analysis_id = chado_get_id_for_node('analysis', $node);
+    if ($analysis_id) {
+      return $node;
+    }
+  }
+  return FALSE;
+}
 
 /**
  * Provide information to drupal about the node types that we're creating
@@ -738,3 +767,4 @@ function tripal_analysis_views_api() {
 }
 
 
+

+ 6 - 0
tripal_pub/files/tpub.obo

@@ -1391,6 +1391,12 @@ name: Media Code
 relationship: part_of TPUB:0000037 ! Publication Details
 def: A unique special code for a journal, book, conference proceeding, etc
 
+[Term]
+id: TPUB:0000254
+name: Publication Code
+relationship: part_of TPUB:0000037 ! Publication Details
+def: A unique special code for journal article, book, book chapter or any publication type.
+
 [Typedef]
 id: is_a
 name: is a