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

Add + Set default CV Terms system variables #14

Closed reynoldtan closed 6 years ago

reynoldtan commented 6 years ago

Add and set default CV Terms location, year, replicate, collector, method and genus system variables.

To Test:

  1. Start by querying Drupal variables for variable names prefixed with analyzed... to ensure that variables do not exists.
  2. Disable - Enable analyzedphenotypes module.
  3. Query the Drupal variables table again to see if variables were defined as expected.
reynoldtan commented 6 years ago

Sorry for that @laceysanderson, Looks like it is from the old hook_install(). The following are the expected variables.

 analyzedphenotypes_systemvar_medicago_cv        | \x733a313a2230223b
 analyzedphenotypes_systemvar_cicer_cv           | \x733a313a2230223b
 analyzedphenotypes_systemvar_cicer_db           | \x733a313a2230223b
 analyzedphenotypes_systemvar_medicago_db        | \x733a313a2230223b
 analyzedphenotypes_systemvar_cicer_ontology     | \x733a313a2230223b
 analyzedphenotypes_systemvar_glycine_cv         | \x733a313a2230223b
 analyzedphenotypes_systemvar_glycine_db         | \x733a313a2230223b
 analyzedphenotypes_systemvar_glycine_ontology   | \x733a313a2230223b
 analyzedphenotypes_systemvar_lens_cv            | \x733a313a2230223b
 analyzedphenotypes_systemvar_lens_db            | \x733a313a2230223b
 analyzedphenotypes_systemvar_lens_ontology      | \x733a313a2230223b
 analyzedphenotypes_systemvar_lotus_cv           | \x733a313a2230223b
 analyzedphenotypes_systemvar_lotus_db           | \x733a313a2230223b
 analyzedphenotypes_systemvar_lotus_ontology     | \x733a313a2230223b
 analyzedphenotypes_systemvar_medicago_ontology  | \x733a313a2230223b
 analyzedphenotypes_systemvar_phaseolus_cv       | \x733a313a2230223b
 analyzedphenotypes_systemvar_phaseolus_db       | \x733a313a2230223b
 analyzedphenotypes_systemvar_phaseolus_ontology | \x733a313a2230223b
 analyzedphenotypes_systemvar_pisum_cv           | \x733a313a2230223b
 analyzedphenotypes_systemvar_pisum_db           | \x733a313a2230223b
 analyzedphenotypes_systemvar_pisum_ontology     | \x733a313a2230223b
 analyzedphenotypes_systemvar_vicia_cv           | \x733a313a2230223b
 analyzedphenotypes_systemvar_vicia_db           | \x733a313a2230223b
 analyzedphenotypes_systemvar_vicia_ontology     | \x733a313a2230223b
 analyzedphenotypes_systemvar_vigna_cv           | \x733a313a2230223b
 analyzedphenotypes_systemvar_vigna_db           | \x733a313a2230223b
 analyzedphenotypes_systemvar_vigna_ontology     | \x733a313a2230223b
 analyzedphenotypes_systemvar_allownew           | \x693a313b
 analyzedphenotypes_systemvar_genus              | \x733a33333a22416e616c7973697320547970652028616e616c797369735f70726f706572747929223b
 analyzedphenotypes_systemvar_method             | \x733a32303a22646576656c6f70735f66726f6d202863656c6c29223b
 analyzedphenotypes_systemvar_related            | \x733a33383a22666962726f626c617374206e657572616c2063726573742064657269766564202863656c6c29223b
 analyzedphenotypes_systemvar_year               | \x733a33303a226e657574726f7068696c6963206d79656c6f626c617374202863656c6c29223b
 analyzedphenotypes_systemvar_location           | \x733a33303a2268656d61746f706f6965746963207374656d2063656c6c202863656c6c29223b
 analyzedphenotypes_systemvar_replicate          | \x733a32343a226575727964656e64726f69642063656c6c202863656c6c29223b
 analyzedphenotypes_systemvar_collector          | \x733a33383a22666962726f626c617374206e657572616c2063726573742064657269766564202863656c6c29223b

Please try:

  1. Disable the module.
  2. Clear variables

I have prepared one I used during the test.

$m = chado_query("select name from variable where name like '%analyzed%'")
->fetchAll();

foreach($m as $v) {
  variable_del($v->name);
}

then goes into the dev/execute php terminal
  1. Enable the module.

    Variables for terms will default to predefined ontologies. You will notice that autocomplete fields will show the cvterm_id instead of a human-readable name - that will be fixed by the next issue/branch.

laceysanderson commented 6 years ago
                      name                       |             value              
-------------------------------------------------+--------------------------------
 analyzedphenotypes_systemvar_cv                 | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_db                 | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_allow_new          | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_cicer              | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_cicer         | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_glycine            | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_glycine       | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lens               | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_lens          | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lotus              | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_lotus         | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_medicago           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_medicago      | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_phaseolus          | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_phaseolus     | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_pisum              | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_pisum         | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vicia              | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_vicia         | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vigna              | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar__def_vigna         | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_genus              | \x733a343a2234303332223b
 analyzedphenotypes_systemvar_year               | \x733a343a2233373838223b
 analyzedphenotypes_systemvar_method             | \x733a343a2236313033223b
 analyzedphenotypes_systemvar_related            | \x733a333a22313038223b
 analyzedphenotypes_systemvar_location           | \x733a343a2236313034223b
 analyzedphenotypes_systemvar_replicate          | \x733a343a2236313035223b
 analyzedphenotypes_systemvar_collector          | \x733a343a2236313036223b
 analyzedphenotypes_systemvar_cicer_cv           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_cicer_db           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_cicer_ontology     | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_glycine_cv         | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_glycine_db         | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_glycine_ontology   | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lens_cv            | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lens_db            | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lens_ontology      | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lotus_cv           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lotus_db           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_lotus_ontology     | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_medicago_cv        | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_medicago_db        | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_medicago_ontology  | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_phaseolus_cv       | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_phaseolus_db       | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_phaseolus_ontology | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_pisum_cv           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_pisum_db           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_pisum_ontology     | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vicia_cv           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vicia_db           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vicia_ontology     | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vigna_cv           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vigna_db           | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_vigna_ontology     | \x733a373a226e6f7420736574223b
 analyzedphenotypes_systemvar_allownew           | \x693a313b
(56 rows)

As you can see from the above list, on a fresh clone I'm seeing both the new and old variable sets. On the upside, now the fixed terms are set to something :-)

PS. Before enabling the module I checked the variables table:

SELECT * FROM variable WHERE name~'^ana';
 name | value 
------+-------
(0 rows)

Can you look into why I'm still seeing the old variables? Tomorrow I'll check ontology terms :-)

reynoldtan commented 6 years ago

It's the hook_install() that generates those old variables. You can safely ignore, old names are there so we won't get errors in some parts of the module since it is looking for those var names. All will be replaced once we complete its new config page.

laceysanderson commented 6 years ago

Current status:

The only outstanding point is that I am still seeing some of the old variables

laceysanderson commented 6 years ago

According to @reynoldtan, the old variables are there to prevent errors until the rest of the code can be brought up to date. I'm merging this in with the expectation that they will be cleaned up later.