Merge pull request #5163 from solgenomics/audit-error-checking
[sgn.git] / lib / CXGN / Trial / TrialDesignStore / Analysis.pm
blobc7f7603b3093109b41571778a09371216e0efba8
2 package CXGN::Trial::TrialDesignStore::Analysis;
4 use Moose;
5 use Try::Tiny;
6 use SGN::Model::Cvterm;
8 extends 'CXGN::Trial::TrialDesignStore::AbstractTrial';
10 sub BUILD { # adjust the cvterm ids for phenotyping trials
11 my $self = shift;
13 print STDERR "PhenotypingTrial BUILD setting stock type id etc....\n";
14 my @source_stock_types;
15 $self->set_nd_experiment_type_id(SGN::Model::Cvterm->get_cvterm_row($self->get_bcs_schema(), 'analysis_experiment', 'experiment_type')->cvterm_id());
17 my $analysis_instance_type_id = SGN::Model::Cvterm->get_cvterm_row($self->get_bcs_schema(), 'analysis_instance', 'stock_type')->cvterm_id();
18 $self->set_stock_type_id($analysis_instance_type_id);
20 my $analysis_of_type_id = SGN::Model::Cvterm->get_cvterm_row($self->get_bcs_schema(), 'analysis_of', 'stock_relationship')->cvterm_id();
21 $self->set_stock_relationship_type_id($analysis_of_type_id);
22 @source_stock_types = ($self->get_accession_cvterm_id);
23 $self->set_source_stock_types(\@source_stock_types);
24 $self->set_valid_properties(
26 'stock_name',
27 'plot_name',
28 'plot_number',
29 'block_number',
30 'rep_number',
31 'is_a_control',
32 'row_number',
33 'col_number',
34 ]);
37 sub validate_design { #### IMPLEMENT!!!!!
38 my $self = shift;
39 my $error = "";
40 return $error;