1 package CXGN
::Phenotypes
::Exact
;
5 CXGN::Phenotypes::Exact - an object to retrieve the exact phenotypes and plot/plant names for a given trial id
9 my $exact_obj = CXGN::Phenotypes::Exact->new({
10 bcs_schema => $schema,
13 my $exact_phenotypes = $exact_obj->search();
15 $exact_phenotypes is a hashref of hashrefs, where each phenotyped_trait is a key whose value is another hash where each plot_name is a key and trait value is the value
28 use SGN
::Model
::Cvterm
;
30 has
'bcs_schema' => ( isa
=> 'Bio::Chado::Schema',
49 my $schema = $self->bcs_schema;
50 my $trial_id = $self->trial_id;
51 my $data_level = $self->data_level;
53 my $stock_type_id = SGN
::Model
::Cvterm
->get_cvterm_row($schema, $data_level, 'stock_type')->cvterm_id();
55 my $h = $schema->storage->dbh->prepare("SELECT stock.name, (((cvterm.name::text || '|'::text) || db.name::text) || ':'::text) || dbxref.accession::text AS trait, phenotype.value
57 JOIN nd_experiment_project USING(project_id)
58 JOIN nd_experiment_stock AS all_stocks ON(nd_experiment_project.nd_experiment_id = all_stocks.nd_experiment_id)
59 JOIN stock USING(stock_id)
60 JOIN nd_experiment_stock AS my_stocks ON(stock.stock_id = my_stocks.stock_id)
61 JOIN nd_experiment_phenotype ON(my_stocks.nd_experiment_id = nd_experiment_phenotype.nd_experiment_id)
62 JOIN phenotype USING(phenotype_id)
63 JOIN cvterm ON(phenotype.cvalue_id = cvterm.cvterm_id)
64 JOIN dbxref ON cvterm.dbxref_id = dbxref.dbxref_id JOIN db ON dbxref.db_id = db.db_id
65 WHERE project_id = ? AND stock.type_id = ?
68 $h->execute($trial_id, $stock_type_id);
71 while (my ($stock, $synonym, $value) = $h->fetchrow_array()) {
72 $exact_phenotypes{$synonym}{$stock} = $value;
75 return \
%exact_phenotypes;