2 This Mason can be imported on any page for saving analyses, the results of analyses, and the model used in an analysis.
4 1) User input for saving analysis: analysis_name, analysis_description, year, breeding_program
5 2) User input for saving model trained weights: model_name, model_description, model_is_public
7 3) Developer input for saving analysis: protocol, dataset_id, accession_names, trait_names, analysis_statistical_ontology_term, analysis_design (if design computed already, otherwise the design will be computed using the accession_names provided), result_summary
8 4) Developer input for saving model trained weights: model_language, model_type, model_properties, application_name, application_version, model_file_to_archive, model_file_type, training_data_file_to_archive, training_data_file_type, auxiliary_files, analysis_result_values, analysis_result_values_type
10 Developer inputs can be set using javascript when the model is opened and then nothing else needs to be changed!
12 'protocol' is a string of the model formula like: 'lme(t1~rep + 1|germplasmName)'
14 'dataset_id' is optional and is used if a dataset was selected as data input.
16 'accession_names' is a JSON encoded array of the accession names involved like: ['accession1', 'accession2']
18 'trait_names' is a JSON encoded array of the trait names analyzed like: ['trait1', 'trait2']
20 'analysis_statistical_ontology_term' is the statistical term of the analysis results like: 'Multivariate linear mixed model genetic BLUPs using genetic relationship matrix and row and column spatial effects computed using Sommer R|SGNSTAT:0000001'. On submission, the trait_names will be post-composed with this term to save the analysis results.
22 The 'analysis_design' is optional and is a precomputed JSON encoded object of objects like:
25 'stock_name' => 'test_accession1',
26 'plot_name' => 'analysisblup06112020_34_test_accession1',
35 'stock_name' => 'test_accession2',
36 'plot_name' => 'analysisblup06112020_34_test_accession2',
45 or analysis_design can be left blank and the design will be computed using accession_names once this workflow is submitted.
47 The 'result_summary' should be a JSON encoded object of arbitrary results like:
49 'genetic_correlation' => {
50 'grain yield to NDVI' => 0.8
52 'important_stat' => 100,
53 'genetic_variance' => 9
56 'model_language' is a string like 'R' or 'Python'
58 'model_type' is a string describing the model type like 'sommer_grm_spatial_genetic_blups'. This is the only term which must be a cvterm under 'protocol_type' (added by db patch).
60 'model_properties' is a JSON encoded object with any key/value pairs like:
66 'application_name' is a string describing the web application producing the analysis e.g. 'solGS', 'NickMorales Mixed Models'
67 'application_version' is a string describing the version of the web application e.g. 'V1.01'
69 'model_file_to_archive' is optional. This is the file path of the temporary file where the trained model weights were stored. On submission this file will be archived using model_file_type.
71 'model_file_type' is optional and is a string describing the type of the model_file_to_archive like: 'trained_keras_cnn_model'
73 'training_data_file_to_archive' is the file path of the temporary file where the input training data (e.g. phenotype file) is stored. On submission this file will be archived using training_data_file_type.
75 'training_data_file_type' is a string describing the type of the training data file like: 'nicksmixedmodels_v1.01_sommer_grm_spatial_genetic_blups_phenotype_file'
77 'auxiliary_files' is a JSON encoded array of objects containing any additional temporary files used by the model analysis. The objects should have the keys 'auxiliary_model_file' and 'auxiliary_model_file_archive_type' e.g.:
79 {'auxiliary_model_file':'/tmp/grm.tsv', 'auxiliary_model_file_archive_type':'nicksmixedmodels_v1.01_sommer_grm_spatial_genetic_blups_grm_file'}
82 The 'analysis_result_values' can take a nested object of stock_name->trait_name->value, where stock_name is either the precomputed analysis_design "plots" or is accession names.
83 The 'analysis_result_values_type' is either analysis_result_values_match_precomputed_design or analysis_result_values_match_accession_names for these scenarios.
85 For example in the case of a precomputed analysis design and 'analysis_result_values_type'='analysis_result_values_match_precomputed_design':
87 'analysisblup06112020_35_test_accession4' => {
88 'Mean Pixel Value|NIR (780-3000nm)|NIR Denoised Original Image|day 10|COMP:0000108' => [
90 '2020-06-11_17:39:21',
95 'Mean Pixel Value|Red (600-690nm)|Red Denoised Original Image|day 10|COMP:0000078' => [
96 '-0.00288303972761372',
97 '2020-06-11_17:39:21',
103 'analysisblup06112020_35_test_accession2' => {
104 'Mean Pixel Value|Red (600-690nm)|Red Denoised Original Image|day 10|COMP:0000078' => [
105 '0.000961013242537908',
106 '2020-06-11_17:39:21',
111 'Mean Pixel Value|NIR (780-3000nm)|NIR Denoised Original Image|day 10|COMP:0000108' => [
112 '-0.00427706422614838',
113 '2020-06-11_17:39:21',
121 For example in the case of a design not computed, but which will be computed using accession names, and 'analysis_result_values_type'='analysis_result_values_match_accession_names':
123 'test_accession4' => {
124 'Mean Pixel Value|NIR (780-3000nm)|NIR Denoised Original Image|day 10|COMP:0000108' => [
125 '0.0128311926784451',
126 '2020-06-11_17:39:21',
131 'Mean Pixel Value|Red (600-690nm)|Red Denoised Original Image|day 10|COMP:0000078' => [
132 '-0.00288303972761372',
133 '2020-06-11_17:39:21',
139 'test_accession2' => {
140 'Mean Pixel Value|Red (600-690nm)|Red Denoised Original Image|day 10|COMP:0000078' => [
141 '0.000961013242537908',
142 '2020-06-11_17:39:21',
147 'Mean Pixel Value|NIR (780-3000nm)|NIR Denoised Original Image|day 10|COMP:0000108' => [
148 '-0.00427706422614838',
149 '2020-06-11_17:39:21',
157 The trait names will be post-composed with the analysis_statistical_ontology_term on submission.
159 'trait_composing_info' is an optional JSON encoded object mapping additional term to post compose into the saved analysis trait, such as:
161 'Harvest index|CO_323:0000101' => ['day 10|TIME:0000102', 'additional info|ETC:0000202']
170 <& /util/import_javascript.mas, classes => ['jquery', 'CXGN.BreedersToolbox.HTMLSelect'], entries => [ ] &>
172 <div class="modal fade" id="generic_save_analysis_dialog" name="generic_save_analysis_dialog" tabindex="-1" role="dialog" aria-labelledby="genericStoreAnalysisDialog" data-backdrop="static">
173 <div class="modal-dialog modal-xl" role="document">
174 <div class="modal-content">
175 <div class="modal-header">
176 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
177 <h4 class="modal-title" id="genericStoreAnalysisDialog">Save Analysis Results</h4>
179 <div class="modal-body">
180 <div class="container-fluid">
181 <&| /util/workflow.mas, id=> "generic_save_analysis_workflow" &>
182 <&| /util/workflow.mas:step, title=> "Intro" &>
183 <& /page/page_title.mas, title=>"This workflow will guide you through storing a new analysis and the results, and saving model weights" &>
184 <p>An analysis is stored independently; however, it maintains associations to the results for the accessions and traits involved. In the case where a model is being trained for predictions e.g. genomic selection or CNN image predictions, those trained model weights can be saved.</p>
187 <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
190 <&| /util/workflow.mas:step, title=> "Analysis Info" &>
191 <& /page/page_title.mas, title=>"Save analysis results" &>
193 <p>This is an optional step and is only available when there are actual results to save. Please move on to saving the model weights if there are no results to save.</p>
195 <form class="form-horizontal">
196 <div class="form-group form-group-sm">
197 <label class="col-sm-3 control-label">Do you want to save the analysis results?: </label>
198 <div class="col-sm-9">
199 <select class="form-control" id="generic_save_analysis_analysis_to_save" name="generic_save_analysis_analysis_to_save" >
200 <option value="no">No</option>
201 <option value="yes">Yes</option>
209 <button class="btn btn-primary" id="generic_save_analysis_next">Go to Next Step</button>
213 <form class="form-horizontal" id="generic_save_analysis_analysis_form" style="display:none">
214 <div class="form-group form-group-sm">
215 <label class="col-sm-3 control-label">Analysis Name (must be unique): </label>
216 <div class="col-sm-9">
217 <input class="form-control" id="generic_save_analysis_analysis_name" name="generic_save_analysis_analysis_name" type="text" />
220 <div class="form-group form-group-sm">
221 <label class="col-sm-3 control-label">Analysis Description: </label>
222 <div class="col-sm-9">
223 <input class="form-control" id="generic_save_analysis_analysis_description" name="generic_save_analysis_analysis_description" type="text" />
226 <div class="form-group form-group-sm">
227 <label class="col-sm-3 control-label">Breeding Program: </label>
228 <div class="col-sm-9">
229 <div id="generic_save_analysis_breeding_program_div"></div>
232 <div class="form-group form-group-sm">
233 <label class="col-sm-3 control-label">Year: </label>
234 <div class="col-sm-9">
235 <div id="generic_save_analysis_analysis_year_div"></div>
240 <div class="form-group form-group-sm">
241 <label class="col-sm-3 control-label">Protocol: </label>
242 <div class="col-sm-9">
243 <input class="form-control" id="generic_save_analysis_protocol" name="generic_save_analysis_protocol" type="text" placeholder="e.g. lmer(grain_yield ~ replicate + 1|germplasmName)" disabled/>
246 <div class="form-group form-group-sm">
247 <label class="col-sm-3 control-label">Dataset ID: </label>
248 <div class="col-sm-9">
249 <input class="form-control" id="generic_save_analysis_dataset_id" name="generic_save_analysis_dataset_id" type="number" disabled/>
252 <div class="form-group form-group-sm">
253 <label class="col-sm-3 control-label">Accession Names: </label>
254 <div class="col-sm-9">
255 <input class="form-control" id="generic_save_analysis_accession_names" name="generic_save_analysis_accession_names" type="text" disabled/>
258 <div class="form-group form-group-sm">
259 <label class="col-sm-3 control-label">Trait Names: </label>
260 <div class="col-sm-9">
261 <input class="form-control" id="generic_save_analysis_trait_names" name="generic_save_analysis_trait_names" type="text" disabled/>
264 <div class="form-group form-group-sm">
265 <label class="col-sm-3 control-label">Statistical Ontology Term: </label>
266 <div class="col-sm-9">
267 <input class="form-control" id="generic_save_analysis_statistical_ontology_term" name="generic_save_analysis_statistical_ontology_term" type="text" disabled/>
270 <div class="form-group form-group-sm">
271 <label class="col-sm-3 control-label">Analysis Design (If left blank, design will be created using above accession names): </label>
272 <div class="col-sm-9">
273 <input class="form-control" id="generic_save_analysis_design" name="generic_save_analysis_design" type="text" disabled/>
276 <div class="form-group form-group-sm">
277 <label class="col-sm-3 control-label">Analysis Result Values: </label>
278 <div class="col-sm-9">
279 <input class="form-control" id="generic_save_analysis_result_values" name="generic_save_analysis_result_values" type="text" disabled/>
282 <div class="form-group form-group-sm">
283 <label class="col-sm-3 control-label">Analysis Result Values Type: </label>
284 <div class="col-sm-9">
285 <input class="form-control" id="generic_save_analysis_result_values_type" name="generic_save_analysis_result_values_type" type="text" disabled/>
288 <div class="form-group form-group-sm">
289 <label class="col-sm-3 control-label">Analysis Result Summary Values: </label>
290 <div class="col-sm-9">
291 <input class="form-control" id="generic_save_analysis_result_summary_values" name="generic_save_analysis_result_summary_values" type="text" disabled/>
294 <div class="form-group form-group-sm">
295 <label class="col-sm-3 control-label">Compose Trait Info With Time Term(optional): </label>
296 <div class="col-sm-9">
297 <input class="form-control" id="generic_save_analysis_result_compose_trait_info" name="generic_save_analysis_result_compose_trait_info" type="text" disabled/>
302 <&| /util/workflow.mas:step, title=> "Model Info" &>
303 <& /page/page_title.mas, title=>"Save model information" &>
305 <p>This step may be pre-populated if you are using a model that is already saved in the database. If there is no input enabled, move to the next step.</p>
307 <div class="form-horizontal" id="generic_save_analysis_model_select_form">
308 <div class="form-group form-group-sm">
309 <label class="col-sm-3 control-label">Select a Model (If Not A New Model): </label>
310 <div class="col-sm-9">
311 <div id="save_new_analysis_model_select_div"></div>
318 <form class="form-horizontal" id="generic_save_analysis_model_form">
319 <div class="form-group form-group-sm" id="generic_save_analysis_model_name_div">
320 <label class="col-sm-3 control-label">New Model Name (must be unique): </label>
321 <div class="col-sm-9">
322 <input class="form-control" id="generic_save_analysis_model_name" name="generic_save_analysis_model_name" type="text" />
325 <div class="form-group form-group-sm" id="generic_save_analysis_model_description_div">
326 <label class="col-sm-3 control-label">New Model Description: </label>
327 <div class="col-sm-9">
328 <input class="form-control" id="generic_save_analysis_model_description" name="generic_save_analysis_model_description" type="text" />
331 <div class="form-group form-group-sm" id="generic_save_analysis_model_is_public_div">
332 <label class="col-sm-3 control-label">New Model Is Public: </label>
333 <div class="col-sm-9">
334 <select class="form-control" id="generic_save_analysis_model_is_public" name="generic_save_analysis_model_is_public" >
335 <option value="yes">Yes</option>
336 <option value="no">No</option>
343 <button class="btn btn-primary" id="generic_save_analysis_submit_button" onclick="return false;">Save Analysis Results And/Or Model</button>
347 <div class="form-group form-group-sm">
348 <label class="col-sm-3 control-label">Model ID: </label>
349 <div class="col-sm-9">
350 <input class="form-control" id="generic_save_analysis_model_id" name="generic_save_analysis_model_id" type="text" disabled/>
353 <div class="form-group form-group-sm">
354 <label class="col-sm-3 control-label">Model Language: </label>
355 <div class="col-sm-9">
356 <input class="form-control" id="generic_save_analysis_model_language" name="generic_save_analysis_model_language" type="text" disabled/>
359 <div class="form-group form-group-sm">
360 <label class="col-sm-3 control-label">Model Type: </label>
361 <div class="col-sm-9">
362 <input class="form-control" id="generic_save_analysis_model_type" name="generic_save_analysis_model_type" type="text" disabled/>
365 <div class="form-group form-group-sm">
366 <label class="col-sm-3 control-label">Model Properties: </label>
367 <div class="col-sm-9">
368 <input class="form-control" id="generic_save_analysis_model_properties" name="generic_save_analysis_model_properties" type="text" disabled/>
371 <div class="form-group form-group-sm">
372 <label class="col-sm-3 control-label">Application Name: </label>
373 <div class="col-sm-9">
374 <input class="form-control" id="generic_save_analysis_model_application_name" name="generic_save_analysis_model_application_name" type="text" disabled/>
377 <div class="form-group form-group-sm">
378 <label class="col-sm-3 control-label">Application Version: </label>
379 <div class="col-sm-9">
380 <input class="form-control" id="generic_save_analysis_model_application_version" name="generic_save_analysis_model_application_version" type="text" disabled/>
383 <div class="form-group form-group-sm">
384 <label class="col-sm-3 control-label">Model File To Archive: </label>
385 <div class="col-sm-9">
386 <input class="form-control" id="generic_save_analysis_model_file" name="generic_save_analysis_model_file" type="text" disabled/>
389 <div class="form-group form-group-sm">
390 <label class="col-sm-3 control-label">Archive Model File Type: </label>
391 <div class="col-sm-9">
392 <input class="form-control" id="generic_save_analysis_model_archived_model_file_type" name="generic_save_analysis_model_archive_model_file_type" type="text" disabled/>
395 <div class="form-group form-group-sm">
396 <label class="col-sm-3 control-label">Training Data File To Archive: </label>
397 <div class="col-sm-9">
398 <input class="form-control" id="generic_save_analysis_model_training_data_file" name="generic_save_analysis_model_training_data_file" type="text" disabled/>
401 <div class="form-group form-group-sm">
402 <label class="col-sm-3 control-label">Archive Training Data File Type: </label>
403 <div class="col-sm-9">
404 <input class="form-control" id="generic_save_analysis_model_archived_training_data_file_type" name="generic_save_analysis_model_archived_training_data_file_type" type="text" disabled/>
407 <div class="form-group form-group-sm">
408 <label class="col-sm-3 control-label">Auxiliary Files to Archive: </label>
409 <div class="col-sm-9">
410 <input class="form-control" id="generic_save_analysis_model_auxiliary_files" name="generic_save_analysis_model_auxiliary_files" type="text" disabled/>
416 <&| /util/workflow.mas:step, title=> "Saved" &>
417 <& /page/page_title.mas, title=>"Saved successfully" &>
419 <div id="generic_save_analysis_response_div"></div>
424 <div class="modal-footer">
425 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
431 <div class="modal fade" id="generic_save_analysis_template_dialog" name="generic_save_analysis_template_dialog" tabindex="-1" role="dialog" aria-labelledby="genericStoreAnalysisTemplateDialog" data-backdrop="static">
432 <div class="modal-dialog modal-xl" role="document">
433 <div class="modal-content">
434 <div class="modal-header">
435 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
436 <h4 class="modal-title" id="genericStoreAnalysisTemplateDialog">Save Analysis Results</h4>
438 <div class="modal-body">
439 <div class="container-fluid">
440 <form class="form-horizontal" id="generic_save_analysis_template_analysis_form">
441 <div class="form-group form-group-sm">
442 <label class="col-sm-3 control-label">Analysis Name Template (must be unique): </label>
443 <div class="col-sm-9">
444 <input class="form-control" id="generic_save_analysis_template_analysis_name" name="generic_save_analysis_template_analysis_name" type="text" />
447 <div class="form-group form-group-sm">
448 <label class="col-sm-3 control-label">Analysis Description: </label>
449 <div class="col-sm-9">
450 <input class="form-control" id="generic_save_analysis_template_analysis_description" name="generic_save_analysis_template_analysis_description" type="text" />
453 <div class="form-group form-group-sm">
454 <label class="col-sm-3 control-label">Breeding Program: </label>
455 <div class="col-sm-9">
456 <div id="generic_save_analysis_template_breeding_program_div"></div>
459 <div class="form-group form-group-sm">
460 <label class="col-sm-3 control-label">Year: </label>
461 <div class="col-sm-9">
462 <div id="generic_save_analysis_template_analysis_year_div"></div>
467 <div id="generic_save_analysis_template_response_div"></div>
471 <button class="btn btn-primary" id="generic_save_analysis_template_submit_button" onclick="return false;">Save Analysis Results And Model</button>
476 <div class="modal-footer">
477 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
485 jQuery(document).ready(function() {
487 get_select_box('years', 'generic_save_analysis_analysis_year_div', {'auto_generate': 1, 'id':'generic_save_analysis_analysis_year', 'name':'generic_save_analysis_analysis_year'});
488 get_select_box('breeding_programs', 'generic_save_analysis_breeding_program_div', { 'name' : 'generic_save_analysis_breeding_program_id', 'id' : 'generic_save_analysis_breeding_program_id' });
489 get_select_box('models', 'save_new_analysis_model_select_div', { 'id':'save_new_analysis_model_id', 'name':'save_new_analysis_model_id', 'empty':1 });
491 get_select_box('years', 'generic_save_analysis_template_analysis_year_div', {'auto_generate': 1, 'id':'generic_save_analysis_template_analysis_year', 'name':'generic_save_analysis_template_analysis_year'});
492 get_select_box('breeding_programs', 'generic_save_analysis_template_breeding_program_div', { 'name' : 'generic_save_analysis_template_breeding_program_id', 'id' : 'generic_save_analysis_template_breeding_program_id' });
494 jQuery('#generic_save_analysis_next').click(function(){
495 Workflow.complete("#generic_save_analysis_next");
496 Workflow.focus('#generic_save_analysis_workflow', 2);
497 jQuery('#generic_save_analysis_dialog').scrollTop(0);
501 jQuery('#generic_save_analysis_analysis_to_save').change(function(){
502 if (jQuery(this).val() == 'yes') {
503 jQuery('#generic_save_analysis_analysis_form').show();
505 if (jQuery(this).val() == 'no') {
506 jQuery('#generic_save_analysis_analysis_form').hide();
507 jQuery('#generic_save_analysis_analysis_name').val('');
511 jQuery('#generic_save_analysis_submit_button').click(function(){
512 var generic_save_analysis_analysis_to_save_boolean = jQuery('#generic_save_analysis_analysis_to_save').val();
513 var generic_save_analysis_analysis_name = jQuery('#generic_save_analysis_analysis_name').val();
514 var generic_save_analysis_analysis_description = jQuery('#generic_save_analysis_analysis_description').val();
515 var generic_save_analysis_analysis_year = jQuery('#generic_save_analysis_analysis_year').val();
516 var generic_save_analysis_breeding_program_id = jQuery('#generic_save_analysis_breeding_program_id').val();
517 var generic_save_analysis_protocol = jQuery('#generic_save_analysis_protocol').val();
518 var generic_save_analysis_dataset_id = jQuery('#generic_save_analysis_dataset_id').val();
519 var generic_save_analysis_accession_names = jQuery('#generic_save_analysis_accession_names').val();
520 var generic_save_analysis_trait_names = jQuery('#generic_save_analysis_trait_names').val();
521 var generic_save_analysis_statistical_ontology_term = jQuery('#generic_save_analysis_statistical_ontology_term').val();
522 var generic_save_analysis_precomputed_design_optional = jQuery('#generic_save_analysis_design').val();
523 var generic_save_analysis_result_values = jQuery('#generic_save_analysis_result_values').val();
524 var generic_save_analysis_result_values_type = jQuery('#generic_save_analysis_result_values_type').val();
525 var generic_save_analysis_result_summary_values = jQuery('#generic_save_analysis_result_summary_values').val();
526 var generic_save_analysis_result_compose_trait_info = jQuery('#generic_save_analysis_result_compose_trait_info').val();
528 var generic_save_analysis_select_model_id = jQuery('#save_new_analysis_model_id').val();
529 var generic_save_analysis_model_id = jQuery('#generic_save_analysis_model_id').val();
530 var generic_save_analysis_model_name = jQuery('#generic_save_analysis_model_name').val();
531 var generic_save_analysis_model_description = jQuery('#generic_save_analysis_model_description').val();
532 var generic_save_analysis_model_is_public = jQuery('#generic_save_analysis_model_is_public').val();
533 var generic_save_analysis_model_language = jQuery('#generic_save_analysis_model_language').val();
534 var generic_save_analysis_model_type = jQuery('#generic_save_analysis_model_type').val();
535 var generic_save_analysis_model_properties = jQuery('#generic_save_analysis_model_properties').val();
536 var generic_save_analysis_model_application_name = jQuery('#generic_save_analysis_model_application_name').val();
537 var generic_save_analysis_model_application_version = jQuery('#generic_save_analysis_model_application_version').val();
538 var generic_save_analysis_model_file = jQuery('#generic_save_analysis_model_file').val();
539 var generic_save_analysis_model_archived_model_file_type = jQuery('#generic_save_analysis_model_archived_model_file_type').val();
540 var generic_save_analysis_model_training_data_file = jQuery('#generic_save_analysis_model_training_data_file').val();
541 var generic_save_analysis_model_archived_training_data_file_type = jQuery('#generic_save_analysis_model_archived_training_data_file_type').val();
542 var generic_save_analysis_model_auxiliary_files = jQuery('#generic_save_analysis_model_auxiliary_files').val();
544 if (generic_save_analysis_analysis_to_save_boolean == 'yes') {
545 if (generic_save_analysis_analysis_name == '') {
546 alert('Please give an analysis name');
549 if (generic_save_analysis_analysis_description == '') {
550 alert('Please give an analysis description');
553 if (generic_save_analysis_analysis_year == '') {
554 alert('Please give an analysis year');
557 if (generic_save_analysis_breeding_program_id == '') {
558 alert('Please give a breeding program');
561 if (generic_save_analysis_protocol == '') {
562 alert('Please give an analysis protocol e.g. lmer(grain_yield ~ replicate + 1|germplasmName)');
565 if (generic_save_analysis_accession_names == '') {
566 alert('Please give analysis accession names');
569 if (generic_save_analysis_trait_names == '') {
570 alert('Please give analysis trait names');
573 if (generic_save_analysis_statistical_ontology_term == '') {
574 alert('Please give a statistical ontology term');
577 if (generic_save_analysis_result_values == '') {
578 alert('Please give analysis result values');
581 if (generic_save_analysis_result_values_type == '') {
582 alert('Please give analysis result values type');
585 if (generic_save_analysis_result_summary_values == '') {
586 alert('Please give analysis result summary info');
590 if ( (generic_save_analysis_model_id != '' || generic_save_analysis_select_model_id != '') && generic_save_analysis_model_name != '') {
591 alert('If Model ID is given, then you should not give a new model name!');
594 if ( (generic_save_analysis_model_id != '' || generic_save_analysis_select_model_id != '') && generic_save_analysis_model_description != '') {
595 alert('If Model ID is given, then you should not give a new model description!');
598 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_name == '') {
599 alert('Please give a model name');
602 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_description == '') {
603 alert('Please give a model description');
606 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_is_public == '') {
607 alert('Please tell if a model is public');
610 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_language == '') {
611 alert('Please give a model language');
614 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_type == '') {
615 alert('Please give a model type');
618 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_properties == '') {
619 alert('Please give a model properties JSON object');
622 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_application_name == '') {
623 alert('Please give a model application name');
626 if ( (generic_save_analysis_model_id == '' && generic_save_analysis_select_model_id == '') && generic_save_analysis_model_application_version == '') {
627 alert('Please give a model application version');
631 var analysis_model_id = generic_save_analysis_model_id;
632 if (analysis_model_id == '') {
633 analysis_model_id = generic_save_analysis_select_model_id;
638 url : '/ajax/analysis/store/json',
640 'analysis_to_save_boolean':generic_save_analysis_analysis_to_save_boolean,
641 'analysis_name':generic_save_analysis_analysis_name,
642 'analysis_description':generic_save_analysis_analysis_description,
643 'analysis_year':generic_save_analysis_analysis_year,
644 'analysis_breeding_program_id':generic_save_analysis_breeding_program_id,
645 'analysis_protocol':generic_save_analysis_protocol,
646 'analysis_dataset_id':generic_save_analysis_dataset_id,
647 'analysis_accession_names':generic_save_analysis_accession_names,
648 'analysis_trait_names':generic_save_analysis_trait_names,
649 'analysis_statistical_ontology_term':generic_save_analysis_statistical_ontology_term,
650 'analysis_precomputed_design_optional':generic_save_analysis_precomputed_design_optional,
651 'analysis_result_values':generic_save_analysis_result_values,
652 'analysis_result_values_type':generic_save_analysis_result_values_type,
653 'analysis_result_summary':generic_save_analysis_result_summary_values,
654 'analysis_result_trait_compose_info':generic_save_analysis_result_compose_trait_info,
655 'analysis_model_id':analysis_model_id,
656 'analysis_model_name':generic_save_analysis_model_name,
657 'analysis_model_description':generic_save_analysis_model_description,
658 'analysis_model_is_public':generic_save_analysis_model_is_public,
659 'analysis_model_language':generic_save_analysis_model_language,
660 'analysis_model_type':generic_save_analysis_model_type,
661 'analysis_model_properties':generic_save_analysis_model_properties,
662 'analysis_model_application_name':generic_save_analysis_model_application_name,
663 'analysis_model_application_version':generic_save_analysis_model_application_version,
664 'analysis_model_file':generic_save_analysis_model_file,
665 'analysis_model_file_type':generic_save_analysis_model_archived_model_file_type,
666 'analysis_model_training_data_file':generic_save_analysis_model_training_data_file,
667 'analysis_model_training_data_file_type':generic_save_analysis_model_archived_training_data_file_type,
668 'analysis_model_auxiliary_files':generic_save_analysis_model_auxiliary_files
670 beforeSend: function() {
671 jQuery('#working_modal').modal('show');
673 success: function(response){
674 jQuery('#working_modal').modal('hide');
675 console.log(response);
676 if (response.error) {
677 alert(response.error);
679 if (response.success) {
680 alert('Analysis and/or model saved!');
681 var html = '<center>';
682 if (response.analysis_id) {
683 html = html + '<p>Go to saved <a href="/analyses/'+response.analysis_id+'" target=_blank >analysis</a></p>';
685 if (response.model_id) {
686 html = html + '<p>Go to saved <a href="/analyses_model/'+response.model_id+'" target=_blank >model</a></p>';
688 html = html + '</center>';
689 jQuery('#generic_save_analysis_response_div').html(html);
691 Workflow.complete("#generic_save_analysis_submit_button");
692 Workflow.focus('#generic_save_analysis_workflow', 3);
695 error: function(response){
696 jQuery('#working_modal').modal('hide');
697 alert('Error saving analysis!');