Skip to content

Commit

Permalink
move up json decoding logic..
Browse files Browse the repository at this point in the history
  • Loading branch information
isaak committed Jun 21, 2016
1 parent 856f2fe commit b0be945
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
6 changes: 2 additions & 4 deletions lib/SGN/Controller/solGS/AnalysisProfile.pm
Expand Up @@ -185,20 +185,18 @@ sub run_saved_analysis :Path('/solgs/run/saved/analysis/') Args(0) {
if ($c->stash->{dependency})
{
my $dependency = $c->stash->{dependency};
print STDERR "\nanalysis profile: depenencies... $dependency ..\n";
my $report_file = $c->stash->{report_file};
nstore $output_details, $report_file
or croak "check_analysis_status: $! serializing output_details to $report_file";
}
else
{
print STDERR "\nanalysis profile: running analysis report call..\n";
my $output_details_file = $c->controller('solGS::solGS')->create_tempfile($c, 'analysis_report_args');
nstore $output_details, $output_details_file
or croak "check_analysis_status: $! serializing output_details to $output_details_file";

my $cmd = 'mx-run solGS::AnalysisReport --output_details_file ' . $output_details_file;
print STDERR "analysis report cmd: $cmd\n";

my $async = CXGN::Tools::Run->run_async($cmd,
{
working_dir => $c->stash->{solgs_tempfiles_dir},
Expand Down Expand Up @@ -545,7 +543,7 @@ sub run_analysis {
my @selected_traits = @{$c->stash->{selected_traits}} if $c->stash->{selected_traits};

if ($analysis_page =~ /solgs\/analyze\/traits\//)
{
{
$c->controller('solGS::solGS')->build_multiple_traits_models($c);
}
elsif ($analysis_page =~ /solgs\/models\/combined\/trials\// )
Expand Down
14 changes: 7 additions & 7 deletions lib/SGN/Controller/solGS/solGS.pm
Expand Up @@ -2693,19 +2693,19 @@ sub build_multiple_traits_models {

my $pop_id = $c->stash->{pop_id};
my $prediction_id = $c->stash->{prediction_pop_id};

my @selected_traits = $c->req->param('trait_id');

if (!@selected_traits)
{
my $params = $c->stash->{analysis_profile};
my $args = $params->{arguments};

my $json = JSON->new();
$args = $json->decode($args);

if (keys %{$args})
{
my $json = JSON->new();
$args = $json->decode($args);

{
foreach my $k ( keys %{$args} )
{
if ($k eq 'trait_id')
Expand Down Expand Up @@ -2811,8 +2811,8 @@ sub build_multiple_traits_models {

$traits .= $r->[0];
$traits .= "\t" unless ($i == $#selected_traits);
$trait_ids .= $trait_id;
}
$trait_ids .= $trait_id;
}
}
}
}
Expand Down

0 comments on commit b0be945

Please sign in to comment.