Skip to content

Commit

Permalink
moved projectprop type_id requirement from where clause to join condi…
Browse files Browse the repository at this point in the history
…tion in get_trials query. now it should capture trials without locations
  • Loading branch information
bellerbrock committed Nov 16, 2016
1 parent 41abea5 commit 7c13333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/CXGN/Chado/Stock.pm
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ sub get_trials {
}

my $geolocation_type_id = SGN::Model::Cvterm->get_cvterm_row($self->get_schema(), 'project location', 'project_property')->cvterm_id();
my $q = "select distinct(project.project_id), project.name, projectprop.value from stock as accession join stock_relationship on (accession.stock_id=stock_relationship.object_id) JOIN stock as plot on (plot.stock_id=stock_relationship.subject_id) JOIN nd_experiment_stock ON (plot.stock_id=nd_experiment_stock.stock_id) JOIN nd_experiment_project USING(nd_experiment_id) JOIN project USING (project_id) LEFT JOIN projectprop ON (project.project_id=projectprop.project_id) where projectprop.type_id=$geolocation_type_id AND accession.stock_id=?;";
my $q = "select distinct(project.project_id), project.name, projectprop.value from stock as accession join stock_relationship on (accession.stock_id=stock_relationship.object_id) JOIN stock as plot on (plot.stock_id=stock_relationship.subject_id) JOIN nd_experiment_stock ON (plot.stock_id=nd_experiment_stock.stock_id) JOIN nd_experiment_project USING(nd_experiment_id) JOIN project USING (project_id) FULL OUTER JOIN projectprop ON (project.project_id=projectprop.project_id AND projectprop.type_id=$geolocation_type_id) WHERE accession.stock_id=?;";
my $h = $dbh->prepare($q);
$h->execute($self->get_stock_id());
my @trials;
Expand Down

0 comments on commit 7c13333

Please sign in to comment.