UofS-Pulse-Binfo / analyzedphenotypes

Tripal/Drupal support for analyzed phenotypic data including data loaders, exporters, trait pages and summaries on germplasm pages.
GNU General Public License v2.0
0 stars 1 forks source link

Configuration for unit and method #57

Closed laceysanderson closed 5 years ago

laceysanderson commented 5 years ago

Metadata

Documentation:

Description

When we upgraded the data storage method, we created the need for additional cv's and cvterms in the configuration. Specifically we needed to allow per organism config of method and unit cv and which cvterms should be used for Trait=>Method and Method=>Unit relationships.

Testing?

This test requires updating of default variable options. This is usually done in .install but can be done after the fact using the code sample below:

module_load_include('inc','analyzedphenotypes','/api/analyzedphenotypes.ontology.api');
$default_ontology = ap_load_defaultontology();

$sysvars = ap_construct_variablenames();
  foreach($sysvars['terms'] as $v => $var) {
    // Set the variable to default ontology term.
    // base terms: location, replicate, year ...
    $v = trim(str_replace('ap_', '', $v));

    variable_set($var, $default_ontology[$v]);
  }

For Testing,

  1. Go to the configuration form and confirm there are now trait/method/unit options per organism screen shot 2019-02-04 at 2 52 16 pm
  2. In the configuration form, confirm there is a Trait=>Method and Method=>Unit, both with defaults. screen shot 2019-02-04 at 2 54 52 pm
  3. Try inserting a trait and ensure at the database level that the cvterms are in the correct cv and are connected in cvterm_relationship using the correct type_id.
$info = ap_insert_trait([
  'genus' => 'Tripalus',
  'name' => 'test trait2',
  'description' => 'I though the name was pretty self explanatory',
  'method_title' => 'accurate1',
  'method' => 'A super accurate measurement method for something made up.',
  'unit' => 'Kelvin',
  'type' => 'quant',
]);
dpm($info, 'info');
reynoldtan commented 5 years ago

Tested and confirmed: 👍

A. Trait, Method and Unit vocabulary options in configuration screen shot 2019-02-12 at 12 16 25 pm 2

B. Default values for both Trait=>Method and Method=>Unit. screen shot 2019-02-12 at 12 17 21 pm 2

C. Term relationships Settings for Cicer Genus: screen shot 2019-02-12 at 12 27 45 pm 2

Term: 'genus' => 'Cicer', 'name' => 'Go Trait', 'description' => 'Go Trait Description', 'method_title' => 'go_trait_method_title', 'method' => 'Go trait method of collection', 'unit' => 'seconds', 'type' => 'quant',

Insert result and Relationship: screen shot 2019-02-12 at 12 26 26 pm 2