Browse Source

Added a new featurepos template, a new featuremappos table, and new vocabulary terms

spficklin 11 years ago
parent
commit
4e144306dc

+ 1 - 1
tripal_featuremap/includes/tripal_featuremap.form.inc

@@ -29,7 +29,7 @@ function chado_featuremap_form($node) {
   // get the list of unit types
   $values = array(
     'cv_id' => array(
-      'name' => 'tripal_featuremap',
+      'name' => 'featuremap_units',
     )
   );
   $columns = array('cvterm_id','name');

+ 71 - 6
tripal_featuremap/tripal_featuremap.install

@@ -120,15 +120,20 @@ function tripal_featuremap_add_cvterms() {
   
    // add cvterms for the map unit types
    tripal_cv_add_cvterm(array('name' => 'cM','def' => 'Centimorgan units'), 
-     'tripal_featuremap', 0, 1, 'tripal');
+     'featuremap_units', 0, 1, 'tripal');
    tripal_cv_add_cvterm(array('name' => 'bp','def' => 'Base pairs units'), 
-     'tripal_featuremap', 0, 1, 'tripal');
+     'featuremap_units', 0, 1, 'tripal');
    tripal_cv_add_cvterm(array('name' => 'bin_unit','def' => 'The bin unit'), 
-     'tripal_featuremap', 0, 1, 'tripal');   
+     'featuremap_units', 0, 1, 'tripal');   
    tripal_cv_add_cvterm(array('name' => 'marker_order','def' => 'Units simply to define marker order.'), 
-     'tripal_featuremap', 0, 1, 'tripal');
+     'featuremap_units', 0, 1, 'tripal');
    tripal_cv_add_cvterm(array('name' => 'undefined','def' => 'A catch-all for an undefined unit type'), 
-     'tripal_featuremap', 0, 1, 'tripal');
+     'featuremap_units', 0, 1, 'tripal');
+   
+    tripal_cv_add_cvterm(array('name' => 'start','def' => 'The start coordinate for a map feature.'), 
+     'featurepos_property', 0, 1, 'tripal');
+    tripal_cv_add_cvterm(array('name' => 'stop','def' => 'The end coordinate for a map feature'), 
+     'featurepos_property', 0, 1, 'tripal');
    
    // add cvterms for map properties
    tripal_cv_add_cvterm(array('name' => 'Map Dbxref','def' => 'A unique identifer for the map in a remote database.  The format is a database abbreviation and a unique accession separated by a colon.  (e.g. Gramene:tsh1996a)'), 
@@ -266,11 +271,71 @@ function tripal_featuremap_add_custom_tables(){
     'referring_tables' => NULL,
   );
   tripal_core_create_custom_table(&$ret, 'featuremap_dbxref', $schema, TRUE);
+  
+  $schema = array (
+    'table' => 'featureposprop',
+    'fields' => array (
+      'featureposprop_id' => array (
+        'type' => 'serial',
+        'not null' => true,
+      ),
+      'featurepos_id' => array (
+        'type' => 'int',
+        'not null' => true,
+      ),
+      'type_id' => array (
+        'type' => 'int',
+        'not null' => true,
+      ),
+      'value' => array (
+        'type' => 'text',
+        'not null' => false,
+      ),
+      'rank' => array (
+        'type' => 'int',
+        'not null' => true,
+        'default' => 0,
+      ),
+    ),
+    'primary key' => array (
+      0 => 'featureposprop_id',
+    ),
+    'unique keys' => array (
+      'featureposprop_id' => array (
+        0 => 'featurepos_id',
+        1 => 'type_id',
+        2 => 'rank',
+      ),
+    ),
+    'indexes' => array (
+      'featureposprop_c1' => array (
+        0 => 'featurepos_id',
+      ),
+      'featureposprop_idx2' => array (
+        0 => 'type_id',
+      ),
+    ),
+    'foreign keys' => array (
+      'cvterm' => array (
+        'table' => 'cvterm',
+        'columns' => array (
+          'type_id' => 'cvterm_id',
+        ),
+      ),
+      'featurepos' => array (
+        'table' => 'featurepos',
+        'columns' => array (
+          'featurepos_id' => 'featurepos_id',
+        ),
+      ),
+    ),
+  );
+  tripal_core_create_custom_table(&$ret, 'featureposprop', $schema, TRUE);
 }
 
 /**
  *  Update for Drupal 6.x, Tripal 1.1, FeatureMap Module 1.1
- *  This update adds a new featuremapprop and featuremap_dbxref tables and 
+ *  This update adds a new featuremapprop, featureposprop, and featuremap_dbxref tables and 
  *  CV terms for the featuremap_property CV
  *
  */

+ 4 - 0
tripal_featuremap/tripal_featuremap.module

@@ -232,6 +232,10 @@ function tripal_featuremap_theme() {
       'arguments' => array('node' => NULL),
       'template' => 'tripal_featuremap_properties',
     ),
+    'tripal_featuremap_featurepos' => array(
+      'arguments' => array('node' => NULL),
+      'template' => 'tripal_featuremap_featurepos',
+    ),
     'tripal_featuremap_publication' => array(
       'arguments' => array('node' => NULL),
       'template' => 'tripal_featuremap_publication',