Commit 5aa1ee2d authored by Sebastien Carrere's avatar Sebastien Carrere

Gestion des parametres orthomcl passes individuellement dans la WebApp et...

Gestion des parametres orthomcl passes individuellement dans la WebApp et transformes en une seule cle --parameters dans le json du CLI
parent d5ae8a7f
......@@ -138,7 +138,8 @@ sub RunOrthomcl
my $orthomcl_outfile = `ls $WORKDIR/*/all_orthomcl.out`;
chomp $orthomcl_outfile;
symlink($orthomcl_outfile, "$WORKDIR/orthomcl.out");
&Log("INFO - Copy $orthomcl_outfile to $WORKDIR/orthomcl.out");
copy($orthomcl_outfile, "$WORKDIR/orthomcl.out");
$rh_analysis_params->{'orthomcl'}->{'outfile'} = "$WORKDIR/orthomcl.out";
return;
......
......@@ -35,11 +35,8 @@ sub SetGlobals
sub ValidAnalysisFile
{
my $cfg_file = shift;
local $/;
open(my $fh, '<', $cfg_file);
my $json_text = <$fh>;
$fh->close;
my $json_text = &Cat($cfg_file);
my $rh_analysis_params = {};
$rh_analysis_params = eval {from_json($json_text)};
......@@ -72,6 +69,7 @@ sub __SetOptionnalParameters
$rh_analysis_params->{'title'} = 'Orthomcl analysis - ' . $DATE unless (defined $rh_analysis_params->{'title'});
$rh_analysis_params->{'date'} = $DATE;
if (defined $rh_analysis_params->{'orthomcl'}->{'outfile'})
{
if (!defined $rh_analysis_params->{'orthomcl'}->{'version'})
......@@ -139,6 +137,18 @@ sub __CheckMandatoryParameters
my @a_errors = ();
if (! defined $rh_analysis_params->{'orthomcl'}->{'parameters'} or ($rh_analysis_params->{'orthomcl'}->{'parameters'} eq ''))
{
my $parameters = '';
my @a_params = ('pi_cutoff','pv_cutoff','pmatch_cutoff','inflation');
foreach my $param (@a_params)
{
$parameters .= " --$param=" . $rh_analysis_params->{'orthomcl'}->{$param} if (defined $rh_analysis_params->{'orthomcl'}->{$param});
}
$rh_analysis_params->{'orthomcl'}->{'parameters'} = $parameters;
}
if (!defined $rh_analysis_params->{'contact'})
{
push(@a_errors, 'Contact email not defined');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment