From 42cd60f80a367a1f2941d29cf94f7285fb48ec5b Mon Sep 17 00:00:00 2001 From: Lukas Mueller Date: Fri, 22 May 2020 13:45:41 -0400 Subject: [PATCH] add trial design store subclasses. --- lib/CXGN/Trial/TrialDesignStore/CrossingTrial.pm | 40 ++++++++++++++++++++++++ lib/CXGN/Trial/TrialDesignStore/FamilyTrial.pm | 40 ++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 lib/CXGN/Trial/TrialDesignStore/CrossingTrial.pm create mode 100644 lib/CXGN/Trial/TrialDesignStore/FamilyTrial.pm diff --git a/lib/CXGN/Trial/TrialDesignStore/CrossingTrial.pm b/lib/CXGN/Trial/TrialDesignStore/CrossingTrial.pm new file mode 100644 index 000000000..0febb6836 --- /dev/null +++ b/lib/CXGN/Trial/TrialDesignStore/CrossingTrial.pm @@ -0,0 +1,40 @@ +package CXGN::Trial::TrialDesignStore::CrossingTrial; + +use Moose; +use Try::Tiny; + +extends 'CXGN::Trial::TrialDesignStore::PhenotypingTrial'; + +sub BUILD { # adjust the cvterm ids for phenotyping trials + my $self = shift; + + #print STDERR "PhenotypingTrial BUILD setting stock type id etc....\n"; + my @source_stock_types; + $self->set_nd_experiment_type_id(SGN::Model::Cvterm->get_cvterm_row($self->get_bcs_schema(), 'field_layout', 'experiment_type')->cvterm_id()); + $self->set_stock_type_id($self->get_plot_cvterm_id()); + $self->set_source_stock_types( [ $self->get_cross_cvterm_id() ] ); + $self->set_stock_relationship_type_id($self->get_plot_of_cvterm_id()); + $self->set_valid_properties( + [ + 'seedlot_name', + 'num_seed_per_plot', + 'weight_gram_seed_per_plot', + 'stock_name', + 'plot_name', + 'plot_number', + 'block_number', + 'rep_number', + 'is_a_control', + 'range_number', + 'row_number', + 'col_number', + 'plant_names', + 'plot_num_per_block', + 'subplots_names', #For splotplot + 'treatments', #For splitplot + 'subplots_plant_names', #For splitplot + ]); + +} + +1; diff --git a/lib/CXGN/Trial/TrialDesignStore/FamilyTrial.pm b/lib/CXGN/Trial/TrialDesignStore/FamilyTrial.pm new file mode 100644 index 000000000..ad9c83dce --- /dev/null +++ b/lib/CXGN/Trial/TrialDesignStore/FamilyTrial.pm @@ -0,0 +1,40 @@ +package CXGN::Trial::TrialDesignStore::FamilyTrial; + +use Moose; +use Try::Tiny; + +extends 'CXGN::Trial::TrialDesignStore::PhenotypingTrial'; + +sub BUILD { # adjust the cvterm ids for FamilyTrials, from phenotyping trials + my $self = shift; + + #print STDERR "PhenotypingTrial BUILD setting stock type id etc....\n"; + my @source_stock_types; + $self->set_nd_experiment_type_id(SGN::Model::Cvterm->get_cvterm_row($self->get_bcs_schema(), 'field_layout', 'experiment_type')->cvterm_id()); + $self->set_stock_type_id($self->get_plot_cvterm_id() ); + $self->set_source_stock_types([ $self->get_family_name_cvterm_id() ] ); + $self->set_stock_relationship_type_id($self->get_plot_of_cvterm_id() ); + $self->set_valid_properties( + [ + 'seedlot_name', + 'num_seed_per_plot', + 'weight_gram_seed_per_plot', + 'stock_name', + 'plot_name', + 'plot_number', + 'block_number', + 'rep_number', + 'is_a_control', + 'range_number', + 'row_number', + 'col_number', + 'plant_names', + 'plot_num_per_block', + 'subplots_names', #For splotplot + 'treatments', #For splitplot + 'subplots_plant_names', #For splitplot + ]); + +} + +1; -- 2.11.4.GIT