From 2b605463e8184c0204a21b0421f17464ccb43f3f Mon Sep 17 00:00:00 2001 From: titima15 Date: Tue, 16 Jun 2026 17:52:02 -0400 Subject: [PATCH 1/7] pedigree option --- js/source/modules/wizard-downloads.js | 11 ++++---- .../Controller/BreedersToolbox/Download.pm | 2 +- .../breeders_toolbox/breeder_search_page.mas | 27 ++++++++++++++----- .../trial/download_phenotypes_dialog.mas | 17 +++++++++++- sgn.conf | 1 + 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/js/source/modules/wizard-downloads.js b/js/source/modules/wizard-downloads.js index 37a8c55561..ca7cb5af53 100644 --- a/js/source/modules/wizard-downloads.js +++ b/js/source/modules/wizard-downloads.js @@ -196,6 +196,7 @@ export function WizardDownloads(main_id,wizard){ var entry_numbers = d3.selectAll('.wizard-download-phenotypes-entry-numbers').property('checked')?1:0; var trait_synonyms = d3.selectAll('.wizard-download-phenotypes-trait-synonyms').property('checked')?1:0; var intercrop = d3.selectAll('.wizard-download-phenotypes-intercrop').property('checked')?1:0; + var pedigree_parents = d3.selectAll('.wizard-download-phenotypes-pedigree_parents').property('checked')?1:0; var outliers = d3.selectAll('.wizard-download-phenotypes-outliers').property('checked')?1:0; var names = JSON.stringify(d3.select(".wizard-download-phenotypes-name").node().value.split(",")); var min = d3.select(".wizard-download-phenotypes-min").node().value; @@ -206,7 +207,7 @@ export function WizardDownloads(main_id,wizard){ //alert('start date = '+phenotype_start_date); //alert('repetitive type = '+repetitive_measurements); - + var url = document.location.origin+'/breeders/trials/phenotype/download'; openWindowWithPost(url, { trial_list: trial_ids, @@ -229,7 +230,7 @@ export function WizardDownloads(main_id,wizard){ trait_contains: names, include_row_and_column_numbers: 1, exclude_phenotype_outlier: outliers, - include_pedigree_parents: 0, + include_pedigree_parents: pedigree_parents, repetitive_measurements: repetitive_measurements, phenotype_start_date: phenotype_start_date, phenotype_end_date: phenotype_end_date @@ -244,7 +245,7 @@ export function WizardDownloads(main_id,wizard){ var years = categories.indexOf("years")!=-1 ? selections["years"] : []; var tissue_samples = categories.indexOf("tissue_sample")!=-1 ? selections["tissue_sample"] : []; var protocols = categories.indexOf("protocols")!=-1 ? selections["protocols"] : []; - var instances = categories.indexOf("instances")!=-1 ? selections["instances"] : []; + var instances = categories.indexOf("instances")!=-1 ? selections["instances"] : []; main.selectAll(".wizard-download-high-dim-phenotypes-info") .attr("value",`${trials.length||"Too few"} trials`); @@ -279,7 +280,7 @@ export function WizardDownloads(main_id,wizard){ //alert('start date = '+phenotype_start_date); //alert('repetitive type = '+repetitive_measurements); - + var url = document.location.origin+'/breeders/trials/phenotype/download'; openWindowWithPost(url, { trial_list: trial_ids, @@ -302,7 +303,7 @@ export function WizardDownloads(main_id,wizard){ intercrop: intercrop, include_row_and_column_numbers: 1, //exclude_phenotype_outlier: outliers, - include_pedigree_parents: 0, + include_pedigree_parents: pedigree_parents, //repetitive_measurements: repetitive_measurements, phenotype_start_date: phenotype_start_date, phenotype_end_date: phenotype_end_date diff --git a/lib/SGN/Controller/BreedersToolbox/Download.pm b/lib/SGN/Controller/BreedersToolbox/Download.pm index dd33977fd1..7c6d28480d 100644 --- a/lib/SGN/Controller/BreedersToolbox/Download.pm +++ b/lib/SGN/Controller/BreedersToolbox/Download.pm @@ -249,7 +249,7 @@ sub download_phenotypes_action : Path('/breeders/trials/phenotype/download') Arg my $repetitive_measurements = $c->req->param("repetitive_measurements") || "average"; my $timestamp_option = $c->req->param("timestamp") && $c->req->param("timestamp") ne 'null' ? $c->req->param("timestamp") : 0; my $exclude_phenotype_outlier = $c->req->param("exclude_phenotype_outlier") && $c->req->param("exclude_phenotype_outlier") ne 'null' && $c->req->param("exclude_phenotype_outlier") ne 'undefined' ? $c->req->param("exclude_phenotype_outlier") : 0; - my $include_pedigree_parents = $c->req->param('include_pedigree_parents'); + my $include_pedigree_parents = $c->req->param("include_pedigree_parents") && $c->req->param("include_pedigree_parents") ne 'null' && $c->req->param("include_pedigree_parents") ne 'undefined' ? $c->req->param("include_pedigree_parents") : 0; my $include_intercrop_stocks = $c->req->param("intercrop") && $c->req->param("intercrop") ne 'null' && $c->req->param("intercrop") ne 'undefined' ? $c->req->param("intercrop") : 0; my $include_entry_numbers = $c->req->param("entry_numbers") && $c->req->param("entry_numbers") ne 'null' ? $c->req->param("entry_numbers") : 0; my $include_trait_synonyms = $c->req->param("trait_synonyms") && $c->req->param("trait_synonyms") ne 'null' ? $c->req->param("trait_synonyms") : 0; diff --git a/mason/breeders_toolbox/breeder_search_page.mas b/mason/breeders_toolbox/breeder_search_page.mas index c2cfcb928d..b49a8c721f 100644 --- a/mason/breeders_toolbox/breeder_search_page.mas +++ b/mason/breeders_toolbox/breeder_search_page.mas @@ -10,6 +10,7 @@ $dataset_id => undef my $default_include_entry_numbers = $c->get_conf('pheno_download_default_include_entry_numbers'); my $default_include_trait_synonyms = $c->get_conf('pheno_download_default_include_trait_synonyms'); my $default_supress_outliers = $c->get_conf('exclude_phenotype_outliers'); + my $default_include_pedigree_parents = $c->get_conf('pheno_download_default_include_pedigree_parents'); <& /util/import_javascript.mas, entries => ["wizard"] &> @@ -453,6 +454,16 @@ $dataset_id => undef + + +
+ +
+ + Repetitive measurements:
@@ -471,7 +482,7 @@ $dataset_id => undef From:
- To:
+ To:
@@ -600,7 +611,7 @@ $dataset_id => undef From:
- To:
+ To:
@@ -684,6 +695,7 @@ $dataset_id => undef var default_include_entry_numbers = <% $default_include_entry_numbers %>; var default_include_trait_synonyms = <% $default_include_trait_synonyms %>; var default_supress_outliers = <% $default_supress_outliers %>; + var default_include_pedigree_parents = <% $default_include_pedigree_parents %>; jQuery(".wizard-download-repetitive-measurements-type").each(function() { jQuery(this).val(default_repeat_measurements) }); jQuery(".wizard-download-phenotypes-timestamp").each(function() { jQuery(this).prop('checked', default_include_timestamps === 1) }); @@ -691,6 +703,7 @@ $dataset_id => undef jQuery(".wizard-download-phenotypes-trait-synonyms").each(function() { jQuery(this).prop('checked', default_include_trait_synonyms === 1) }); jQuery(".wizard-download-phenotypes-intercrop").each(function() { jQuery(this).prop('checked', default_include_intercrop_accessions === 1) }); jQuery(".wizard-download-phenotypes-outliers").each(function() { jQuery(this).prop('checked', default_supress_outliers === 1) }); + jQuery(".wizard-download-phenotypes-pedigree_parents").each(function() { jQuery(this).prop('checked', default_include_pedigree_parents === 1) }); } d3.select('#update_wizard_show').on('click', function () { @@ -748,7 +761,7 @@ $dataset_id => undef } }); updateArchivedVCFFiles({ no_geno_selected: true }); - + // Set the display of the Archived Genotype Data section function updateArchivedVCFFiles({ no_geno_selected = false, loading = false, error = false, data = {} } = {}) { let html = ''; @@ -870,7 +883,7 @@ $dataset_id => undef // console.log(genotyping_protocol[0]["protocol_name"]); if ( selected_genotyping_protocols.length < 1 ) { $(".wizard-download-genotypes-info3").show(); - $(".wizard-download-genotypes-info3").val("genotype protocol \"" + genotyping_protocol[0]["protocol_name"] + "\""); + $(".wizard-download-genotypes-info3").val("genotype protocol \"" + genotyping_protocol[0]["protocol_name"] + "\""); } } jQuery.ajax({ @@ -916,7 +929,7 @@ $dataset_id => undef } else { var protocol_name = '<% $c->config->{default_genotyping_protocol} %>'; $(".wizard-download-genotypes-info3").show(); - $(".wizard-download-genotypes-info3").val("genotype protocol \"" + protocol_name + "\""); + $(".wizard-download-genotypes-info3").val("genotype protocol \"" + protocol_name + "\""); jQuery.ajax({ url: '/get/genotyping/protocols/', method: "POST", @@ -988,7 +1001,7 @@ $dataset_id => undef "yearSelect" : true, "minDate": "1960-01-01", "maxDate": "2030-12-31", - locale: { + locale: { format: 'YYYY-MM-DD' } }, @@ -1005,7 +1018,7 @@ jQuery('input[title="phenotype_end_date"]').daterangepicker( "yearSelect" : true, "minDate": "1960-01-01", "maxDate": "2030-12-31", - locale: { + locale: { format: 'YYYY-MM-DD' } }, diff --git a/mason/breeders_toolbox/trial/download_phenotypes_dialog.mas b/mason/breeders_toolbox/trial/download_phenotypes_dialog.mas index facea4f85b..5d268d13ae 100644 --- a/mason/breeders_toolbox/trial/download_phenotypes_dialog.mas +++ b/mason/breeders_toolbox/trial/download_phenotypes_dialog.mas @@ -12,6 +12,7 @@ $dialog_name => undef my $default_include_entry_numbers = $c->get_conf('pheno_download_default_include_entry_numbers'); my $default_include_trait_synonyms = $c->get_conf('pheno_download_default_include_trait_synonyms'); my $default_supress_outliers = $c->get_conf('exclude_phenotype_outliers'); + my $default_include_pedigree_parents = $c->get_conf('pheno_download_default_include_pedigree_parents'); +
+ +
+ +
+
+
@@ -208,8 +219,9 @@ jQuery(document).ready(function() { var phenotype_max_value = jQuery("#download_trial_phenotype_phenotype_max").val(); var exclude_phenotype_outlier = jQuery("#download_trial_phenotypes_exclude_outliers").val(); var include_trait_synonyms = jQuery("#download_trial_phenotypes_trait_synonyms_option").val(); + var include_pedigree_parents = jQuery("#download_trial_phenotypes_pedigrees_option").val(); - window.open("/breeders/trials/phenotype/download?trial_list="+JSON.stringify(trial_id_array)+"&speed="+speed+"&format="+format+"×tamp="+timestamp+"&intercrop="+intercrop+"&entry_numbers="+entry_numbers+"&trait_contains="+JSON.stringify(trait_contains_array)+"&trait_component_list="+JSON.stringify(trait_components)+"&trait_list="+JSON.stringify(traits)+"&dataLevel="+data_level+"&phenotype_min_value="+phenotype_min_value+"&phenotype_max_value="+phenotype_max_value+"&exclude_phenotype_outlier="+exclude_phenotype_outlier+"&repetitive_measurements="+repetitive_measurements+"&trait_synonyms="+include_trait_synonyms); + window.open("/breeders/trials/phenotype/download?trial_list="+JSON.stringify(trial_id_array)+"&speed="+speed+"&format="+format+"×tamp="+timestamp+"&intercrop="+intercrop+"&entry_numbers="+entry_numbers+"&trait_contains="+JSON.stringify(trait_contains_array)+"&trait_component_list="+JSON.stringify(trait_components)+"&trait_list="+JSON.stringify(traits)+"&dataLevel="+data_level+"&phenotype_min_value="+phenotype_min_value+"&phenotype_max_value="+phenotype_max_value+"&exclude_phenotype_outlier="+exclude_phenotype_outlier+"&repetitive_measurements="+repetitive_measurements+"&trait_synonyms="+include_trait_synonyms+"&include_pedigree_parents="+include_pedigree_parents); }); @@ -227,6 +239,7 @@ function setDefaultOptions() { var default_include_entry_numbers = <% $default_include_entry_numbers %>; var default_include_trait_synonyms = <% $default_include_trait_synonyms %>; var default_supress_outliers = <% $default_supress_outliers %>; + var default_include_pedigree_parents = <% $default_include_pedigree_parents %>; jQuery("#download_trial_phenotypes_repetitive_measurements_option").val(default_repeat_measurements); jQuery("#download_trial_phenotypes_timestamp_option").val(default_include_timestamps); @@ -234,5 +247,7 @@ function setDefaultOptions() { jQuery("#download_trial_phenotypes_entry_numbers_option").val(default_include_entry_numbers); jQuery("#download_trial_phenotypes_trait_synonyms_option").val(default_include_trait_synonyms); jQuery("#download_trial_phenotypes_exclude_outliers").val(default_supress_outliers); + jQuery("#download_trial_phenotypes_pedigrees_option").val(default_include_pedigree_parents); + } diff --git a/sgn.conf b/sgn.conf index 60e1f70006..556d55abe6 100644 --- a/sgn.conf +++ b/sgn.conf @@ -27,6 +27,7 @@ pheno_download_default_include_intercrop_accessions 0 # include inte pheno_download_default_include_entry_numbers 0 # include entry numbers column - boolean pheno_download_default_include_trait_synonyms 0 # include trait synonyms - boolean exclude_phenotype_outliers 0 # supress user-defined outliers - boolean (used in downloads and some analysis tools) +pheno_download_default_include_pedigree_parents 0 # include pedigree parents - boolean image_analysis_services { "necrosis" : { "server_endpoint" : "http://unet.mcrops.org/api/", "image_type_name" : "image_analysis_necrosis_solomon_nsumba", "description" : "Necrosis Analysis, Makerere University", "service_traits" : { "CBSDpct|CO_334:0002078" : "Cassava" } }, "whitefly_count" : { "server_endpoint" : "http://18.216.149.204/home/api2/", "image_type_name" : "image_analysis_white_fly_count_solomon_nsumba", "description": "Whitefly count, Makarere University" }, "count_contours" : { "image_type_name" : "image_analysis_contours", "trait_name" : "count_contours", "script" : "GetContours.py", "input_image" : "image_path", "outfile_image" : "outfile_path", "results_outfile" : "results_outfile_path", "description" : "Count Contours" }, "largest_contour_percent" : { "image_type_name" : "image_analysis_largest_contour", "trait_name" : "percent_largest_contour", "script" : "GetLargestContour.py", "input_image" : "image_path", "outfile_image" : "outfile_path", "results_outfile" : "results_outfile_path", "description" : "Largest Contour Percent" }, "count_sift" : { "image_type_name" : "image_analysis_sift", "trait_name" : "count_sift", "script" : "ImageProcess/CalculatePhenotypeSift.py", "input_image" : "image_paths", "outfile_image" : "outfile_paths", "results_outfile" : "results_outfile_path", "description" : "SIFT analysis" } } # image_analysis_services { "plantcv_citrus_app": { "server_endpoint": "http://fake-image-analysis-service/", "image_type_name": "image_analysis_contours", "description": "Citrus Image Analysis (Mocked)", "service_traits": { "Fruit Diameter|INV:0000118": "INV" } } } From 2da084e37002eff56c22d438775f7b7c3a3b0375 Mon Sep 17 00:00:00 2001 From: titima15 Date: Wed, 17 Jun 2026 14:28:03 -0400 Subject: [PATCH 2/7] pedigree option on manage trials page and stock details page --- lib/SGN/Controller/BreedersToolbox/Download.pm | 2 ++ mason/breeders_toolbox/download.mas | 6 ++++++ .../download_trials_phenotypes_dialog.mas | 18 ++++++++++++++++-- .../stock/download_stock_phenotypes_dialog.mas | 16 +++++++++++++++- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/lib/SGN/Controller/BreedersToolbox/Download.pm b/lib/SGN/Controller/BreedersToolbox/Download.pm index 7c6d28480d..f2afb0a0a7 100644 --- a/lib/SGN/Controller/BreedersToolbox/Download.pm +++ b/lib/SGN/Controller/BreedersToolbox/Download.pm @@ -577,6 +577,7 @@ sub download_action : Path('/breeders/download_action') Args(0) { my $include_entry_numbers = $c->req->param("entry_numbers") || 0; my $include_trait_synonyms = $c->req->param("trait_synonyms") || 0; my $timestamp_included = $c->req->param("timestamp") || 0; + my $include_pedigree_parents = $c->req->param("pedigrees") || 0; # parameters for outliers download my @trait_ids = split(',', $c->req->param("trait_ids_list")); @@ -693,6 +694,7 @@ sub download_action : Path('/breeders/download_action') Args(0) { include_entry_numbers=>$include_entry_numbers, include_trait_synonyms=>$include_trait_synonyms, data_level=>$datalevel, + include_pedigree_parents=>$include_pedigree_parents, ); @data = $phenotypes_search->get_phenotype_matrix(); } diff --git a/mason/breeders_toolbox/download.mas b/mason/breeders_toolbox/download.mas index 1732a5e9c0..86e13fa489 100644 --- a/mason/breeders_toolbox/download.mas +++ b/mason/breeders_toolbox/download.mas @@ -88,6 +88,12 @@ Choose a list for each parameter and click "Download". +
+ Include Pedigrees:
+ diff --git a/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas b/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas index 5cfd6ed472..c375f3ed57 100644 --- a/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas +++ b/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas @@ -8,6 +8,7 @@ my $default_include_entry_numbers = $c->get_conf('pheno_download_default_include_entry_numbers'); my $default_include_trait_synonyms = $c->get_conf('pheno_download_default_include_trait_synonyms'); my $default_supress_outliers = $c->get_conf('exclude_phenotype_outliers'); + my $default_include_pedigree_parents = $c->get_conf('pheno_download_default_include_pedigree_parents');
+
+ +
+ +
+
+
@@ -212,8 +223,9 @@ jQuery(document).ready(function() { var intercrop_accessions = jQuery("#download_trials_phenotypes_intercrop_accessions_option").val(); var entry_numbers = jQuery("#download_trials_phenotypes_entry_numbers_option").val(); var trait_synonyms = jQuery("#download_trials_phenotypes_trait_synonyms_option").val(); + var pedigrees = jQuery("#download_trials_phenotypes_pedigrees_option").val(); var traits = []; - + if (jQuery("#download_trials_phenotypes_traits_list_select").val()) { traits = list.getList(jQuery("#download_trials_phenotypes_traits_list_select").val()); } @@ -231,7 +243,7 @@ jQuery(document).ready(function() { } if (selected.length !== 0) { - window.open("/breeders/trials/phenotype/download?trial_list="+JSON.stringify(trial_id_array)+"&format="+format+"×tamp="+timestamp+"&trait_contains="+JSON.stringify(trait_contains_array)+"&trait_list="+JSON.stringify(traits)+"&accession_list="+JSON.stringify(accessions)+"&plot_list="+JSON.stringify(plots)+"&plant_list="+JSON.stringify(plants)+"&dataLevel="+data_level+"&phenotype_min_value="+phenotype_min_value+"&phenotype_max_value="+phenotype_max_value+"&exclude_phenotype_outlier="+exclude_phenotype_outlier+"&repetitive_measurements="+repetitive_measurements+"&intercrop="+intercrop_accessions+"&entry_numbers="+entry_numbers+"&trait_synonyms="+trait_synonyms); + window.open("/breeders/trials/phenotype/download?trial_list="+JSON.stringify(trial_id_array)+"&format="+format+"×tamp="+timestamp+"&trait_contains="+JSON.stringify(trait_contains_array)+"&trait_list="+JSON.stringify(traits)+"&accession_list="+JSON.stringify(accessions)+"&plot_list="+JSON.stringify(plots)+"&plant_list="+JSON.stringify(plants)+"&dataLevel="+data_level+"&phenotype_min_value="+phenotype_min_value+"&phenotype_max_value="+phenotype_max_value+"&exclude_phenotype_outlier="+exclude_phenotype_outlier+"&repetitive_measurements="+repetitive_measurements+"&intercrop="+intercrop_accessions+"&entry_numbers="+entry_numbers+"&trait_synonyms="+trait_synonyms+"&include_pedigree_parents="+pedigrees); } else { alert("No leaf nodes selected for download."); } }); @@ -245,6 +257,7 @@ function setDefaultOptions() { var default_include_entry_numbers = <% $default_include_entry_numbers %>; var default_include_trait_synonyms = <% $default_include_trait_synonyms %>; var default_supress_outliers = <% $default_supress_outliers %>; + var default_include_pedigree_parents = <% $default_include_pedigree_parents %>; jQuery("#download_repetitive_measurements_trials_option").val(default_repeat_measurements); jQuery("#download_trials_phenotypes_timestamp_option").val(default_include_timestamps); @@ -252,6 +265,7 @@ function setDefaultOptions() { jQuery("#download_trials_phenotypes_entry_numbers_option").val(default_include_entry_numbers); jQuery("#download_trials_phenotypes_trait_synonyms_option").val(default_include_trait_synonyms); jQuery("#download_trials_phenotype_exclude_outliers").val(default_supress_outliers); + jQuery("#download_trials_phenotypes_pedigrees_option").val(default_include_pedigree_parents); } diff --git a/mason/stock/download_stock_phenotypes_dialog.mas b/mason/stock/download_stock_phenotypes_dialog.mas index bc75a3f912..c23e1e945b 100644 --- a/mason/stock/download_stock_phenotypes_dialog.mas +++ b/mason/stock/download_stock_phenotypes_dialog.mas @@ -12,6 +12,7 @@ $stock_name => undef my $default_include_entry_numbers = $c->get_conf('pheno_download_default_include_entry_numbers'); my $default_include_trait_synonyms = $c->get_conf('pheno_download_default_include_trait_synonyms'); my $default_supress_outliers = $c->get_conf('exclude_phenotype_outliers'); + my $default_include_pedigree_parents = $c->get_conf('pheno_download_default_include_pedigree_parents'); @@ -112,6 +113,16 @@ $stock_name => undef
+
+ +
+ +
+
+
@@ -176,6 +187,7 @@ jQuery(document).ready(function() { var intercrop = jQuery("#download_stock_phenotypes_intercrop_accessions_option").val(); var entry_numbers = jQuery("#download_stock_phenotypes_entry_numbers_option").val(); var trait_synonyms = jQuery("#download_stock_phenotypes_trait_synonyms_option").val(); + var pedigrees = jQuery("#download_stock_phenotypes_pedigrees_option").val(); var traits = jQuery("#download_stock_phenotypes_traits_select").val(); if (! Array.isArray(traits) ) { traits = [ traits ]; @@ -183,7 +195,7 @@ jQuery(document).ready(function() { var datalevel = jQuery("#download_stock_phenotypes_level_option").val(); var exclude_phenotype_outlier = jQuery("#download_stock_phenotypes_exclude_outliers").val(); - window.open("/breeders/trials/phenotype/download?"+stock_type+"_list="+JSON.stringify(stock_id)+"&dataLevel="+datalevel+"&format="+format+"×tamp="+timestamp+"&trait_list="+JSON.stringify(traits)+"&exclude_phenotype_outlier="+exclude_phenotype_outlier+"&repetitive_measurements="+repetitive_measurements+"&intercrop="+intercrop+"&entry_numbers="+entry_numbers+"&trait_synonyms="+trait_synonyms); + window.open("/breeders/trials/phenotype/download?"+stock_type+"_list="+JSON.stringify(stock_id)+"&dataLevel="+datalevel+"&format="+format+"×tamp="+timestamp+"&trait_list="+JSON.stringify(traits)+"&exclude_phenotype_outlier="+exclude_phenotype_outlier+"&repetitive_measurements="+repetitive_measurements+"&intercrop="+intercrop+"&entry_numbers="+entry_numbers+"&trait_synonyms="+trait_synonyms+"&include_pedigree_parents="+pedigrees); }); }); @@ -195,6 +207,7 @@ function setDefaultOptions() { var default_include_entry_numbers = <% $default_include_entry_numbers %>; var default_include_trait_synonyms = <% $default_include_trait_synonyms %>; var default_supress_outliers = <% $default_supress_outliers %>; + var default_include_pedigree_parents = <% $default_include_pedigree_parents %>; jQuery("#download_stock_phenotypes_repetitive_measurements_option").val(default_repeat_measurements); jQuery("#download_stock_phenotypes_timestamp_option").val(default_include_timestamps); @@ -202,6 +215,7 @@ function setDefaultOptions() { jQuery("#download_stock_phenotypes_entry_numbers_option").val(default_include_entry_numbers); jQuery("#download_stock_phenotypes_trait_synonyms_option").val(default_include_trait_synonyms); jQuery("#download_stock_phenotypes_exclude_outliers").val(default_supress_outliers); + jQuery("#download_stock_phenotypes_pedigrees_option").val(default_include_pedigree_parents); } function data_level_change_traits() { From 3579e7ca33c68b33c13807d5d1e7ef5d40142461 Mon Sep 17 00:00:00 2001 From: titima15 Date: Fri, 19 Jun 2026 18:14:37 -0400 Subject: [PATCH 3/7] retrieve parents --- lib/CXGN/Phenotypes/PhenotypeMatrix.pm | 12 +++++++++++- .../Trial/Download/Plugin/TrialPhenotypeExcel.pm | 7 ++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/CXGN/Phenotypes/PhenotypeMatrix.pm b/lib/CXGN/Phenotypes/PhenotypeMatrix.pm index a20e0ecf07..28d2843691 100644 --- a/lib/CXGN/Phenotypes/PhenotypeMatrix.pm +++ b/lib/CXGN/Phenotypes/PhenotypeMatrix.pm @@ -244,7 +244,6 @@ sub get_phenotype_matrix { my $include_entry_numbers = $self->include_entry_numbers; my $include_trait_synonyms = $self->include_trait_synonyms; my %trial_entry_numbers; - $self->trait_repeat_types( $self->retrieve_trait_repeat_types() ); print STDERR "GET PHENOMATRIX ".$self->search_type."\n"; @@ -274,6 +273,7 @@ sub get_phenotype_matrix { end_date => $self->end_date(), include_dateless_items => $self->include_dateless_items(), include_intercrop_stocks => $include_intercrop_stocks, + include_pedigree_parents => $include_pedigree_parents, limit=>$self->limit, offset=>$self->offset } @@ -445,6 +445,10 @@ sub get_phenotype_matrix { my @unique_obsunit_list = (); my %seen_obsunits; + if ($include_pedigree_parents){ + push @metadata_headers, ('germplasmPedigreeFemaleParentName', 'germplasmPedigreeFemaleParentDbId', 'germplasmPedigreeMaleParentName', 'germplasmPedigreeMaleParentDbId'); + } + # Add intercrop stock headers, if requested if ( $include_intercrop_stocks ) { push(@metadata_headers, 'intercropGermplasmDbId', 'intercropGermplasmName'); @@ -535,6 +539,12 @@ sub get_phenotype_matrix { $d->{plant_number} ]; + if ($include_pedigree_parents) { + my $germplasm = CXGN::Stock->new({schema => $self->bcs_schema, stock_id=>$d->{accession_stock_id}}); + my $parents = $germplasm->get_parents(); + push(@{$obsunit_data{$obsunit_id}->{metadata}}, ($parents->{'mother'}, $parents->{'mother_id'}, $parents->{'father'}, $parents->{'father_id'})); + } + # add intercrop stocks, if requested if ( $include_intercrop_stocks ) { my @ic_stock_ids; diff --git a/lib/CXGN/Trial/Download/Plugin/TrialPhenotypeExcel.pm b/lib/CXGN/Trial/Download/Plugin/TrialPhenotypeExcel.pm index 22ae2ebcbc..43ec8408f5 100644 --- a/lib/CXGN/Trial/Download/Plugin/TrialPhenotypeExcel.pm +++ b/lib/CXGN/Trial/Download/Plugin/TrialPhenotypeExcel.pm @@ -100,11 +100,11 @@ sub download { my $phenotype_start_date = $self->start_date(); my $phenotype_end_date = $self->end_date(); my $repetitive_measurements = $self->repetitive_measurements(); - + my $include_pedigree_parents = $self->include_pedigree_parents(); $self->trial_download_log($trial_id, "trial phenotypes"); - + my @data; if ($self->data_level() eq 'metadata'){ my $metadata_search = CXGN::Phenotypes::MetaDataMatrix->new( @@ -137,7 +137,8 @@ sub download { include_trait_synonyms=>$include_trait_synonyms, phenotype_start_date => $phenotype_start_date, phenotype_end_date => $phenotype_end_date, - repetitive_measurements => $repetitive_measurements + repetitive_measurements => $repetitive_measurements, + include_pedigree_parents=>$include_pedigree_parents, ); @data = $phenotypes_search->get_phenotype_matrix(); } From 31ba6aed94b3be63440b3e5c4a502a49f085802e Mon Sep 17 00:00:00 2001 From: titima15 Date: Mon, 22 Jun 2026 14:34:59 -0400 Subject: [PATCH 4/7] modified dialog titles --- mason/breeders_toolbox/breeder_search_page.mas | 2 +- mason/breeders_toolbox/download.mas | 2 +- mason/breeders_toolbox/trial/download_phenotypes_dialog.mas | 2 +- .../trial/download_trials_phenotypes_dialog.mas | 2 +- mason/stock/download_stock_phenotypes_dialog.mas | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mason/breeders_toolbox/breeder_search_page.mas b/mason/breeders_toolbox/breeder_search_page.mas index b49a8c721f..083f6bb12f 100644 --- a/mason/breeders_toolbox/breeder_search_page.mas +++ b/mason/breeders_toolbox/breeder_search_page.mas @@ -459,7 +459,7 @@ $dataset_id => undef
diff --git a/mason/breeders_toolbox/download.mas b/mason/breeders_toolbox/download.mas index 86e13fa489..1676dc8835 100644 --- a/mason/breeders_toolbox/download.mas +++ b/mason/breeders_toolbox/download.mas @@ -89,7 +89,7 @@ Choose a list for each parameter and click "Download".
- Include Pedigrees:
+ Include Parents:
diff --git a/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas b/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas index c375f3ed57..c3484c2b16 100644 --- a/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas +++ b/mason/breeders_toolbox/trial/download_trials_phenotypes_dialog.mas @@ -91,7 +91,7 @@
- +
From fabfc4a8bbeb31d13978ef1d251c8793a64e15e0 Mon Sep 17 00:00:00 2001 From: titima15 Date: Mon, 22 Jun 2026 16:55:05 -0400 Subject: [PATCH 5/7] include parent search in query --- lib/CXGN/Phenotypes/PhenotypeMatrix.pm | 12 +- lib/CXGN/Phenotypes/Search/Native.pm | 166 ++++++++++++++----------- 2 files changed, 97 insertions(+), 81 deletions(-) diff --git a/lib/CXGN/Phenotypes/PhenotypeMatrix.pm b/lib/CXGN/Phenotypes/PhenotypeMatrix.pm index 28d2843691..c321454b7b 100644 --- a/lib/CXGN/Phenotypes/PhenotypeMatrix.pm +++ b/lib/CXGN/Phenotypes/PhenotypeMatrix.pm @@ -365,9 +365,9 @@ sub get_phenotype_matrix { my @line = ($obs_unit->{year}, $obs_unit->{breeding_program_id}, $obs_unit->{breeding_program_name}, $obs_unit->{breeding_program_description}, $obs_unit->{trial_id}, $trial_name, $trial_desc, $obs_unit->{design}, $obs_unit->{plot_width}, $obs_unit->{plot_length}, $obs_unit->{field_size}, $obs_unit->{field_trial_is_planned_to_be_genotyped}, $obs_unit->{field_trial_is_planned_to_cross}, $obs_unit->{planting_date}, $obs_unit->{harvest_date}, $obs_unit->{trial_location_id}, $obs_unit->{trial_location_name}, $obs_unit->{germplasm_stock_id}, $obs_unit->{germplasm_uniquename}, $synonym_string, $obs_unit->{observationunit_type_name}, $obs_unit->{observationunit_stock_id}, $obs_unit->{observationunit_uniquename}, $obs_unit->{obsunit_rep}, $obs_unit->{obsunit_block}, $obs_unit->{obsunit_plot_number}, $obs_unit->{obsunit_row_number}, $obs_unit->{obsunit_col_number}, $entry_type, $obs_unit->{obsunit_plant_number}, $obs_unit->{seedlot_stock_id}, $obs_unit->{seedlot_uniquename}, $obs_unit->{seedlot_current_count}, $obs_unit->{seedlot_current_weight_gram}, $obs_unit->{seedlot_box_name}, $obs_unit->{seedlot_transaction_amount}, $obs_unit->{seedlot_transaction_weight_gram}, $obs_unit->{seedlot_transaction_description}, $available_germplasm_seedlots_uniquenames); if ($include_pedigree_parents) { - my $germplasm = CXGN::Stock->new({schema => $self->bcs_schema, stock_id=>$obs_unit->{germplasm_stock_id}}); - my $parents = $germplasm->get_parents(); - push @line, ($parents->{'mother'}, $parents->{'mother_id'}, $parents->{'father'}, $parents->{'father_id'}); +# my $germplasm = CXGN::Stock->new({schema => $self->bcs_schema, stock_id=>$obs_unit->{germplasm_stock_id}}); +# my $parents = $germplasm->get_parents(); +# push @line, ($parents->{'mother'}, $parents->{'mother_id'}, $parents->{'father'}, $parents->{'father_id'}); } if ( $include_intercrop_stocks ) { @@ -435,7 +435,7 @@ sub get_phenotype_matrix { else { ### NATIVE ??!! $data = $phenotypes_search->search(); - #print STDERR "the download data structure =". Dumper($data)."\n"; +# print STDERR "the download data structure =". Dumper($data)."\n"; my %obsunit_data; my %traits; @@ -540,9 +540,7 @@ sub get_phenotype_matrix { ]; if ($include_pedigree_parents) { - my $germplasm = CXGN::Stock->new({schema => $self->bcs_schema, stock_id=>$d->{accession_stock_id}}); - my $parents = $germplasm->get_parents(); - push(@{$obsunit_data{$obsunit_id}->{metadata}}, ($parents->{'mother'}, $parents->{'mother_id'}, $parents->{'father'}, $parents->{'father_id'})); + push(@{$obsunit_data{$obsunit_id}->{metadata}}, ($d->{'female_parent_name'}, $d->{'female_parent_id'}, $d->{'male_parent_name'}, $d->{'male_parent_id'})); } # add intercrop stocks, if requested diff --git a/lib/CXGN/Phenotypes/Search/Native.pm b/lib/CXGN/Phenotypes/Search/Native.pm index 39328804e4..f618870600 100644 --- a/lib/CXGN/Phenotypes/Search/Native.pm +++ b/lib/CXGN/Phenotypes/Search/Native.pm @@ -227,6 +227,8 @@ sub search { my $plant_of_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'plant_of', 'stock_relationship')->cvterm_id(); my $subplot_of_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'subplot_of', 'stock_relationship')->cvterm_id(); my $tissue_sample_of_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'tissue_sample_of', 'stock_relationship')->cvterm_id(); + my $female_parent_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'female_parent', 'stock_relationship')->cvterm_id(); + my $male_parent_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'male_parent', 'stock_relationship')->cvterm_id(); my $include_timestamp = $self->include_timestamp; my $numeric_regex = '^-?[0-9]+([,.][0-9]+)?$'; @@ -274,7 +276,7 @@ sub search { } } - + #For performace reasons it is faster to include specific stock_ids in the query. if ($self->data_level eq 'analysis_instance'){ if (!$self->plot_list){ @@ -346,7 +348,7 @@ sub search { LEFT JOIN stockprop AS is_a_control ON (observationunit.stock_id=is_a_control.stock_id AND is_a_control.type_id = $is_a_control_type_id) "; $design_layout_select = " ,rep.value, block_number.value, plot_number.value, is_a_control.value, row_number.value, col_number.value, plant_number.value"; } - + if ($self->exclude_phenotype_outlier) { $phenotypeprop_sql = "JOIN ( SELECT phenotype_id @@ -360,13 +362,17 @@ sub search { ON not_outliers.phenotype_id = nd_experiment_phenotype.phenotype_id" }; - my $from_clause = " FROM stock as observationunit + my $from_clause = " FROM stock as observationunit LEFT JOIN stock_relationship ON (observationunit.stock_id=stock_relationship.subject_id) AND stock_relationship.type_id IN ($analysis_instance_of_type_id, $plot_of_type_id, $plant_of_type_id, $subplot_of_type_id, $tissue_sample_of_type_id) LEFT JOIN stock_relationship AS icsr ON (observationunit.stock_id=icsr.subject_id) AND icsr.type_id = $intercrop_plot_rel_type_id LEFT JOIN stock AS ics ON (icsr.object_id=ics.stock_id) LEFT JOIN cvterm as observationunit_type ON (observationunit_type.cvterm_id = observationunit.type_id) JOIN stock as germplasm ON (stock_relationship.object_id=germplasm.stock_id) AND germplasm.type_id IN ($accession_type_id, $analysis_result_type_id, $cross_type_id, $family_name_type_id) $design_layout_sql + LEFT JOIN stock_relationship AS female_relationship ON (germplasm.stock_id = female_relationship.object_id) AND female_relationship.type_id = $female_parent_type_id + LEFT JOIN stock AS female_parent ON (female_relationship.subject_id = female_parent.stock_id) + LEFT JOIN stock_relationship AS male_relationship ON (germplasm.stock_id = male_relationship.object_id) AND male_relationship.type_id = $male_parent_type_id + LEFT JOIN stock AS male_parent ON (male_relationship.subject_id = male_parent.stock_id) LEFT JOIN nd_experiment_stock ON(nd_experiment_stock.stock_id=observationunit.stock_id) LEFT JOIN nd_experiment_phenotype ON (nd_experiment_phenotype.nd_experiment_id=nd_experiment_stock.nd_experiment_id) LEFT JOIN phenotype USING(phenotype_id) @@ -395,80 +401,88 @@ sub search { LEFT JOIN project_relationship folder_rel ON (project.project_id = folder_rel.subject_project_id AND folder_rel.type_id = $folder_rel_type_id) LEFT JOIN project folder ON (folder.project_id = folder_rel.object_project_id)"; - my $select_clause = "SELECT observationunit.stock_id, - observationunit.uniquename, - observationunit_type.name, - germplasm.uniquename, - germplasm.stock_id, - project.project_id, - project.name, - project.description, - plot_width.value, - plot_length.value, - field_size.value, - field_trial_is_planned_to_be_genotyped.value, - field_trial_is_planned_to_cross.value, - breeding_program.project_id, - breeding_program.name, - breeding_program.description, - year.value, - design.value, - location.value, - planting_date.value, - harvest_date.value, - folder.project_id, - folder.name, - folder.description, - cvterm.cvterm_id, - (((cvterm.name::text || '|'::text) || db.name::text) || ':'::text) || dbxref.accession::text, + my $select_clause = "SELECT observationunit.stock_id, + observationunit.uniquename, + observationunit_type.name, + germplasm.uniquename, + germplasm.stock_id, + female_parent.uniquename, + female_parent.stock_id, + male_parent.uniquename, + male_parent.stock_id, + project.project_id, + project.name, + project.description, + plot_width.value, + plot_length.value, + field_size.value, + field_trial_is_planned_to_be_genotyped.value, + field_trial_is_planned_to_cross.value, + breeding_program.project_id, + breeding_program.name, + breeding_program.description, + year.value, + design.value, + location.value, + planting_date.value, + harvest_date.value, + folder.project_id, + folder.name, + folder.description, + cvterm.cvterm_id, + (((cvterm.name::text || '|'::text) || db.name::text) || ':'::text) || dbxref.accession::text, MIN(cvtermsynonym.synonym), - phenotype.value, - phenotype.uniquename, - phenotype.phenotype_id, - phenotype.collect_date, - phenotype.operator, - additional_info.value, - external_references.value, - count(phenotype.phenotype_id) OVER() AS full_count, + phenotype.value, + phenotype.uniquename, + phenotype.phenotype_id, + phenotype.collect_date, + phenotype.operator, + additional_info.value, + external_references.value, + count(phenotype.phenotype_id) OVER() AS full_count, string_agg(distinct(notes.value), ', ') AS notes, - STRING_AGG(DISTINCT(ics.stock_id)::text, '|'), + STRING_AGG(DISTINCT(ics.stock_id)::text, '|'), STRING_AGG(DISTINCT(ics.uniquename), ',') ".$design_layout_select; my $order_clause = " ORDER BY 6, 2, 30"; - my $group_by = " GROUP BY observationunit.stock_id, - observationunit.uniquename, - observationunit_type.name, - germplasm.uniquename, - germplasm.stock_id, - project.project_id, - project.name, + my $group_by = " GROUP BY observationunit.stock_id, + observationunit.uniquename, + observationunit_type.name, + germplasm.uniquename, + germplasm.stock_id, + female_parent.uniquename, + female_parent.stock_id, + male_parent.uniquename, + male_parent.stock_id, + project.project_id, + project.name, project.description, - plot_width.value, - plot_length.value, - field_size.value, - field_trial_is_planned_to_be_genotyped.value, - field_trial_is_planned_to_cross.value, - breeding_program.project_id, - breeding_program.name, - breeding_program.description, - year.value, - design.value, - location.value, - planting_date.value, - harvest_date.value, - folder.project_id, - folder.name, - folder.description, - cvterm.cvterm_id, - (((cvterm.name::text || '|'::text) || db.name::text) || ':'::text) || dbxref.accession::text, - phenotype.value, - phenotype.uniquename, - phenotype.phenotype_id, - phenotype.collect_date, - phenotype.operator, - additional_info.value, + plot_width.value, + plot_length.value, + field_size.value, + field_trial_is_planned_to_be_genotyped.value, + field_trial_is_planned_to_cross.value, + breeding_program.project_id, + breeding_program.name, + breeding_program.description, + year.value, + design.value, + location.value, + planting_date.value, + harvest_date.value, + folder.project_id, + folder.name, + folder.description, + cvterm.cvterm_id, + (((cvterm.name::text || '|'::text) || db.name::text) || ':'::text) || dbxref.accession::text, + phenotype.value, + phenotype.uniquename, + phenotype.phenotype_id, + phenotype.collect_date, + phenotype.operator, + additional_info.value, external_references.value ".$design_layout_select; my @where_clause; @@ -476,7 +490,7 @@ sub search { print STDERR "Native search Accession list is ".Dumper($accession_list)."\n"; my $analysis_result_stock_list = $self->analysis_result_stock_list; - + if ($self->analysis_result_stock_list && scalar(@{$self->analysis_result_stock_list})>0) { print STDERR "Native search adding analysis result_stock_list to sql\n"; my $accession_sql = _sql_from_arrayref($self->analysis_result_stock_list); @@ -607,10 +621,10 @@ sub search { my $stock_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, $data_level, 'stock_type')->cvterm_id(); push @where_clause, "observationunit.type_id = $stock_type_id"; #ONLY plot or plant or subplot or tissue_sample } else { - push @where_clause, "(observationunit.type_id = $plot_type_id + push @where_clause, "(observationunit.type_id = $plot_type_id OR observationunit.type_id = $plant_type_id - OR observationunit.type_id = $analysis_instance_id - OR observationunit.type_id = $subplot_type_id + OR observationunit.type_id = $analysis_instance_id + OR observationunit.type_id = $subplot_type_id OR observationunit.type_id = $tissue_sample_type_id)"; #plots AND plants AND subplots AND tissue_samples } @@ -638,7 +652,7 @@ sub search { my $calendar_funcs = CXGN::Calendar->new({}); - while (my ($observationunit_stock_id, $observationunit_uniquename, $observationunit_type_name, $germplasm_uniquename, $germplasm_stock_id, $project_project_id, $project_name, $project_description, $plot_width, $plot_length, $field_size, $field_trial_is_planned_to_be_genotyped, $field_trial_is_planned_to_cross, $breeding_program_project_id, $breeding_program_name, $breeding_program_description, $year, $design, $location_id, $planting_date, $harvest_date, $folder_id, $folder_name, $folder_description, $trait_id, $trait_name, $trait_synonym, $phenotype_value, $phenotype_uniquename, $phenotype_id, $phenotype_collect_date, $phenotype_operator, $phenotype_additional_info, $phenotype_external_references, $full_count, $notes, $intercrop_stock_id, $intercrop_stock_name, $rep_select, $block_number_select, $plot_number_select, $is_a_control_select, $row_number_select, $col_number_select, $plant_number) = $h->fetchrow_array()) { + while (my ($observationunit_stock_id, $observationunit_uniquename, $observationunit_type_name, $germplasm_uniquename, $germplasm_stock_id, $female_parent_name, $female_parent_id, $male_parent_name, $male_parent_id, $project_project_id, $project_name, $project_description, $plot_width, $plot_length, $field_size, $field_trial_is_planned_to_be_genotyped, $field_trial_is_planned_to_cross, $breeding_program_project_id, $breeding_program_name, $breeding_program_description, $year, $design, $location_id, $planting_date, $harvest_date, $folder_id, $folder_name, $folder_description, $trait_id, $trait_name, $trait_synonym, $phenotype_value, $phenotype_uniquename, $phenotype_id, $phenotype_collect_date, $phenotype_operator, $phenotype_additional_info, $phenotype_external_references, $full_count, $notes, $intercrop_stock_id, $intercrop_stock_name, $rep_select, $block_number_select, $plot_number_select, $is_a_control_select, $row_number_select, $col_number_select, $plant_number) = $h->fetchrow_array()) { my $timestamp_value; my $operator_value; if ($include_timestamp) { @@ -712,6 +726,10 @@ sub search { obsunit_type_name => $observationunit_type_name, accession_uniquename => $germplasm_uniquename, accession_stock_id => $germplasm_stock_id, + female_parent_name => $female_parent_name, + female_parent_id => $female_parent_id, + male_parent_name => $male_parent_name, + male_parent_id => $male_parent_id, synonyms => $synonyms, trial_id => $project_project_id, trial_name => $project_name, From 9f56f9da8f3f1bee34ff46d9009177203ea6a1be Mon Sep 17 00:00:00 2001 From: titima15 Date: Mon, 22 Jun 2026 17:06:36 -0400 Subject: [PATCH 6/7] clean up --- lib/CXGN/Phenotypes/PhenotypeMatrix.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CXGN/Phenotypes/PhenotypeMatrix.pm b/lib/CXGN/Phenotypes/PhenotypeMatrix.pm index c321454b7b..d83a82691b 100644 --- a/lib/CXGN/Phenotypes/PhenotypeMatrix.pm +++ b/lib/CXGN/Phenotypes/PhenotypeMatrix.pm @@ -365,9 +365,9 @@ sub get_phenotype_matrix { my @line = ($obs_unit->{year}, $obs_unit->{breeding_program_id}, $obs_unit->{breeding_program_name}, $obs_unit->{breeding_program_description}, $obs_unit->{trial_id}, $trial_name, $trial_desc, $obs_unit->{design}, $obs_unit->{plot_width}, $obs_unit->{plot_length}, $obs_unit->{field_size}, $obs_unit->{field_trial_is_planned_to_be_genotyped}, $obs_unit->{field_trial_is_planned_to_cross}, $obs_unit->{planting_date}, $obs_unit->{harvest_date}, $obs_unit->{trial_location_id}, $obs_unit->{trial_location_name}, $obs_unit->{germplasm_stock_id}, $obs_unit->{germplasm_uniquename}, $synonym_string, $obs_unit->{observationunit_type_name}, $obs_unit->{observationunit_stock_id}, $obs_unit->{observationunit_uniquename}, $obs_unit->{obsunit_rep}, $obs_unit->{obsunit_block}, $obs_unit->{obsunit_plot_number}, $obs_unit->{obsunit_row_number}, $obs_unit->{obsunit_col_number}, $entry_type, $obs_unit->{obsunit_plant_number}, $obs_unit->{seedlot_stock_id}, $obs_unit->{seedlot_uniquename}, $obs_unit->{seedlot_current_count}, $obs_unit->{seedlot_current_weight_gram}, $obs_unit->{seedlot_box_name}, $obs_unit->{seedlot_transaction_amount}, $obs_unit->{seedlot_transaction_weight_gram}, $obs_unit->{seedlot_transaction_description}, $available_germplasm_seedlots_uniquenames); if ($include_pedigree_parents) { -# my $germplasm = CXGN::Stock->new({schema => $self->bcs_schema, stock_id=>$obs_unit->{germplasm_stock_id}}); -# my $parents = $germplasm->get_parents(); -# push @line, ($parents->{'mother'}, $parents->{'mother_id'}, $parents->{'father'}, $parents->{'father_id'}); + my $germplasm = CXGN::Stock->new({schema => $self->bcs_schema, stock_id=>$obs_unit->{germplasm_stock_id}}); + my $parents = $germplasm->get_parents(); + push @line, ($parents->{'mother'}, $parents->{'mother_id'}, $parents->{'father'}, $parents->{'father_id'}); } if ( $include_intercrop_stocks ) { From dd304cf8a5a7d88365f13c6983261f2c2b5e9342 Mon Sep 17 00:00:00 2001 From: titima15 Date: Tue, 23 Jun 2026 14:59:21 -0400 Subject: [PATCH 7/7] fix ordering --- lib/CXGN/Phenotypes/Search/Native.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/CXGN/Phenotypes/Search/Native.pm b/lib/CXGN/Phenotypes/Search/Native.pm index f618870600..4b21990504 100644 --- a/lib/CXGN/Phenotypes/Search/Native.pm +++ b/lib/CXGN/Phenotypes/Search/Native.pm @@ -406,10 +406,6 @@ sub search { observationunit_type.name, germplasm.uniquename, germplasm.stock_id, - female_parent.uniquename, - female_parent.stock_id, - male_parent.uniquename, - male_parent.stock_id, project.project_id, project.name, project.description, @@ -438,6 +434,10 @@ sub search { phenotype.collect_date, phenotype.operator, additional_info.value, + female_parent.uniquename, + female_parent.stock_id, + male_parent.uniquename, + male_parent.stock_id, external_references.value, count(phenotype.phenotype_id) OVER() AS full_count, string_agg(distinct(notes.value), ', ') AS notes, @@ -452,10 +452,6 @@ sub search { observationunit_type.name, germplasm.uniquename, germplasm.stock_id, - female_parent.uniquename, - female_parent.stock_id, - male_parent.uniquename, - male_parent.stock_id, project.project_id, project.name, project.description, @@ -483,6 +479,10 @@ sub search { phenotype.collect_date, phenotype.operator, additional_info.value, + female_parent.uniquename, + female_parent.stock_id, + male_parent.uniquename, + male_parent.stock_id, external_references.value ".$design_layout_select; my @where_clause; @@ -652,7 +652,7 @@ sub search { my $calendar_funcs = CXGN::Calendar->new({}); - while (my ($observationunit_stock_id, $observationunit_uniquename, $observationunit_type_name, $germplasm_uniquename, $germplasm_stock_id, $female_parent_name, $female_parent_id, $male_parent_name, $male_parent_id, $project_project_id, $project_name, $project_description, $plot_width, $plot_length, $field_size, $field_trial_is_planned_to_be_genotyped, $field_trial_is_planned_to_cross, $breeding_program_project_id, $breeding_program_name, $breeding_program_description, $year, $design, $location_id, $planting_date, $harvest_date, $folder_id, $folder_name, $folder_description, $trait_id, $trait_name, $trait_synonym, $phenotype_value, $phenotype_uniquename, $phenotype_id, $phenotype_collect_date, $phenotype_operator, $phenotype_additional_info, $phenotype_external_references, $full_count, $notes, $intercrop_stock_id, $intercrop_stock_name, $rep_select, $block_number_select, $plot_number_select, $is_a_control_select, $row_number_select, $col_number_select, $plant_number) = $h->fetchrow_array()) { + while (my ($observationunit_stock_id, $observationunit_uniquename, $observationunit_type_name, $germplasm_uniquename, $germplasm_stock_id, $project_project_id, $project_name, $project_description, $plot_width, $plot_length, $field_size, $field_trial_is_planned_to_be_genotyped, $field_trial_is_planned_to_cross, $breeding_program_project_id, $breeding_program_name, $breeding_program_description, $year, $design, $location_id, $planting_date, $harvest_date, $folder_id, $folder_name, $folder_description, $trait_id, $trait_name, $trait_synonym, $phenotype_value, $phenotype_uniquename, $phenotype_id, $phenotype_collect_date, $phenotype_operator, $phenotype_additional_info, $female_parent_name, $female_parent_id, $male_parent_name, $male_parent_id, $phenotype_external_references, $full_count, $notes, $intercrop_stock_id, $intercrop_stock_name, $rep_select, $block_number_select, $plot_number_select, $is_a_control_select, $row_number_select, $col_number_select, $plant_number) = $h->fetchrow_array()) { my $timestamp_value; my $operator_value; if ($include_timestamp) {