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

Issue #18 - Api update #18

Closed reynoldtan closed 6 years ago

reynoldtan commented 6 years ago

General module update to support new system variables.

To test:

  1. Disable and uninstall module.
  2. Delete old system variables prefixed with 'analyzephenotypes' in table: variable.
  3. Enable module.
  4. Configure module CV, DB and Ontology.
  5. Access Tripal/Extensions/Analyzed Phenotypes/Upload Phenotypic Data.

More information in this PR: https://github.com/UofS-Pulse-Binfo/analyzedphenotypes/issues/3

laceysanderson commented 6 years ago

Completed code review (excluding API): looks good 👍 Now moving on to testing the functionality

laceysanderson commented 6 years ago

When testing the Upload, I get an error for not filling out the optional/disabled "Crop Ontology". This field should be optional whether it's disabled or not.

Even after choosing a crop ontology suggestion, I still receive the error: "Crop ontology entered is not recognized. Please enter or select crop ontology."

reynoldtan commented 6 years ago

Crop Ontology optional with or without ontology set. Noted.

laceysanderson commented 6 years ago

Do you want to fix that in this PR because I currently can't finish testing the upload functionality.

Crop ontology not set

screen shot 2018-05-17 at 2 37 42 pm

Crop ontology field is empty. Please enter or select crop ontology. screen shot 2018-05-17 at 2 36 34 pm

Crop Ontology Set

screen shot 2018-05-17 at 2 38 34 pm

Crop ontology entered is not recognized. Please enter or select crop ontology. screen shot 2018-05-17 at 2 40 06 pm

laceysanderson commented 6 years ago

Confirmed fixed :-) Now to test the final save!

laceysanderson commented 6 years ago

Fails on final save :-(

2018-05-17 15:02:21: Calling: analyzedphenotypes_save_tsv_data(a:4:{s:12:"project_name";s:62:"AGILE: Application of Genomic Innovation in the Lentil Economy";s:13:"project_genus";s:4:"Lens";s:9:"data_file";s:4:"1574";s:12:"trait_cvterm";a:4:{s:44:"AGL Nodes on Primary Stem at R1 (1st; count)";N;s:28:"AGL Days till Harvest (days)";N;s:58:"AGL Days till 10% of Plants have Elongated Tendrils (days)";N;s:28:"AGL Days to Emergence (days)";N;}})
0% Complete...
WD analyzedphenotypes:                                                                                         [error]
CODE:104 Trait name is not recognized by this system. [VALUE: AGL Nodes on Primary Stem at R1 (1st; count)]

CRITICAL (ANALYZEDPHENOTYPES): 
CODE:104 Trait name is not recognized by this system. [VALUE: AGL Nodes on Primary Stem at R1 (1st; count)]

[site http://default] [TRIPAL CRITICAL] [ANALYZEDPHENOTYPES] CODE:104 Trait name is not recognized by this system. [VALUE: AGL Nodes on Primary Stem at R1 (1st; count)]
WD analyzedphenotypes: Failed to load phenotypic data in Tripal Job #8187.                                     [error]
CRITICAL (ANALYZEDPHENOTYPES): Failed to load phenotypic data in Tripal Job #8187.
[site http://default] [TRIPAL CRITICAL] [ANALYZEDPHENOTYPES] Failed to load phenotypic data in Tripal Job #8187.
Drush command terminated abnormally due to an unrecoverable error.                                             [error]

Despite me having screen shot 2018-05-17 at 3 31 00 pm

laceysanderson commented 6 years ago

After the fixes to the Tripal API, the test file now loads. However, populating the mview fails. This is due to the incorrect terms being used for location and year.

WD tripal_mviews: PDOException: SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "location" violates not-null constraint [error] DETAIL: Failing row contains (Lens, 6113, AGL Days till 10% of Plants have Elongated Tendrils (days), 63, AGILE: Application of Genomic Innovation in the Lentil Economy, null, 2011, 28987, PI 297787 LSP AGL, 8).: INSERT INTO chado.mview_phenotype ( SELECT o.genus as organism_genus, trait.cvterm_id as trait_id, trait.name as trait_name, proj.project_id as project_id, proj.name as project_name, loc.value as location, yr.value as year, s.stock_id as germplasm_id,
s.name as germplasm_name, avg( CAST(p.value as FLOAT) ) as mean FROM chado.phenotype p LEFT JOIN chado.cvterm trait ON trait.cvterm_id=p.attr_id LEFT JOIN chado.project proj USING(project_id) LEFT JOIN chado.stock s USING(stock_id) LEFT JOIN chado.organism o ON o.organism_id=s.organism_id LEFT JOIN chado.phenotypeprop loc ON loc.phenotype_id=p.phenotype_id AND loc.type_id IN (SELECT cvterm_id FROM chado.cvterm WHERE name='Location') LEFT JOIN chado.phenotypeprop yr ON yr.phenotype_id=p.phenotype_id AND yr.type_id IN (SELECT cvterm_id FROM chado.cvterm WHERE name='Year') GROUP BY trait.cvterm_id, trait.name, proj.project_id, proj.name, loc.value, yr.value, s.stock_id, s.name, o.genus); Array ( ) in chado_query() (line 1713 of /var/www/dev/fresh/sites/all/modules/contrib/tripal/tripal_chado/api/tripal_chado.query.api.inc). Done.

laceysanderson commented 6 years ago

Tested and approved. Also confirmed the upload works with the test data.