Browse Source

Changed Analysis content type to use operation:2945 term. issue #151

Stephen Ficklin 7 years ago
parent
commit
f853f19cb6

+ 4 - 4
tripal_chado/includes/setup/tripal_chado.setup.inc

@@ -236,14 +236,14 @@ function tripal_chado_prepare_chado($job = NULL) {
     // Create the 'Analysis' entity type. This uses the local:analysis term.
     $error = '';
     $args = array(
-      'vocabulary' => 'local',
-      'accession' => 'analysis',
-      'term_name' => 'analysis',
+      'vocabulary' => 'operation',
+      'accession' => '2945',
+      'term_name' => 'Analysis',
       'storage_args' => array(
         'data_table' => 'analysis',
       )
     );
-    $term = tripal_load_term_entity(array('vocabulary' => 'local', 'accession' => 'analysis'));
+    $term = tripal_load_term_entity(array('vocabulary' => 'operation', 'accession' => '2945'));
     $bundle = tripal_load_bundle_entity(array('term_id' => $term->id));
     if (!$term or !$bundle) {
       if (!tripal_create_bundle($args, $error)) {

+ 3 - 3
tripal_chado/includes/tripal_chado.migrate.inc

@@ -644,9 +644,9 @@ function tripal_chado_migrate_map_types($tv2_content_types) {
     }
     else if ($table == 'analysis') {
       array_push($types, array(
-        'vocabulary' => 'local',
-        'accession' => 'analysis',
-        'term_name' => 'analysis',
+        'vocabulary' => 'operation',
+        'accession' => '2945',
+        'term_name' => 'Analysis',
         'storage_args' => array (
           'data_table' => $table
         )

+ 7 - 0
tripal_chado/includes/tripal_chado.semweb.inc

@@ -542,6 +542,13 @@ function tripal_chado_populate_vocab_EDAM() {
     'display in a genome browser. Synonym: Sequence annotation track.',
   ));
   tripal_associate_chado_semweb_term('featureloc', 'srcfeature_id', $term);
+
+  $term = tripal_insert_cvterm(array(
+    'id' => 'operation:2945',
+    'name' => 'Analysis',
+    'cv_name' => 'EDAM',
+    'definition' => 'Apply analytical methods to existing data of a specific type.',
+  ));
 }
 
 /**

+ 21 - 1
tripal_chado/tripal_chado.install

@@ -1310,4 +1310,24 @@ function tripal_chado_update_7318() {
     $error = $e->getMessage();
     throw new DrupalUpdateException('Could not perform update: '. $error);
   }
-}
+}
+
+
+/**
+ * Adding new Analysis term.
+ */
+function tripal_chado_update_7319() {
+  try {
+    $term = tripal_insert_cvterm(array(
+      'id' => 'operation:2945',
+      'name' => 'Analysis',
+      'cv_name' => 'EDAM',
+      'definition' => 'Apply analytical methods to existing data of a specific type.',
+    ));
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Could not perform update: '. $error);
+  }
+}
+