changeset 3:78afd7f439f3 draft default tip

master branch Updating with tag :CI_COMMIT_TAG - - Fxx
author fgiacomoni
date Wed, 15 Feb 2023 15:57:49 +0000
parents 23970530a518
children
files HR2.xml hr2_manager.pl lib/hr.pm test-data/input06.tabular test-data/out6.html test-data/out6.tabular
diffstat 6 files changed, 186 insertions(+), 101 deletions(-) [+]
line wrap: on
line diff
--- a/HR2.xml	Tue Jan 17 10:31:32 2023 +0000
+++ b/HR2.xml	Wed Feb 15 15:57:49 2023 +0000
@@ -1,4 +1,4 @@
-<tool id="hr2" name="HR2 formula" version="1.1.3">
+<tool id="hr2" name="HR2 formula" version="1.2.0">
   <description>
         find a chemical formula from a accurate mass
   </description>
@@ -34,9 +34,27 @@
     #end if
     
     -regleOr "$regleOr" -atomes_basic "$atomes_basic" -atomes_sup "$atomes_sup"
+    
+    #if str($max_custom_atom_condition.max_custom_atom_choice) == "YES":
+    	-C12_max_value "${max_custom_atom_condition.C12_max_value}"
+    	-C13_max_value "${max_custom_atom_condition.C13_max_value}"
+    	-H_max_value "${max_custom_atom_condition.H_max_value}"
+    	-N_max_value "${max_custom_atom_condition.N_max_value}"
+    	-O_max_value "${max_custom_atom_condition.O_max_value}"
+    	-P_max_value "${max_custom_atom_condition.P_max_value}"
+    	-S_max_value "${max_custom_atom_condition.S_max_value}"
+    	-F_max_value "${max_custom_atom_condition.F_max_value}"
+    	-Cl_max_value "${max_custom_atom_condition.Cl_max_value}"
+    	-K_max_value "${max_custom_atom_condition.K_max_value}"
+    	-Br_max_value "${max_custom_atom_condition.Br_max_value}"
+    	-Na_max_value "${max_custom_atom_condition.Na_max_value}"
+    	
+    #end if
+    
     -output1 "$variableMetadata" -outputView "$hr2ResView"
     -verbose "$verbose"
   ]]></command>
+  <!--     	-customAtomValues "-C 0-${max_custom_atom_condition.C12_max_value} -1 0-${max_custom_atom_condition.C13_max_value} -H 0-${max_custom_atom_condition.H_max_value} -N 0-${max_custom_atom_condition.N_max_value} -O 0-${max_custom_atom_condition.O_max_value} -P 0-${max_custom_atom_condition.P_max_value} -S 0-${max_custom_atom_condition.S_max_value} -F 0-${max_custom_atom_condition.F_max_value} -L 0-${max_custom_atom_condition.Cl_max_value} -K 0-${max_custom_atom_condition.K_max_value} -B 0-${max_custom_atom_condition.Br_max_value} -A 0-${max_custom_atom_condition.Na_max_value}"  -->
   
   <inputs>
   	<conditional name="input_type">
@@ -104,6 +122,28 @@
       <option value="A">Na</option>
       <option value="1">13C</option>
     </param>
+    <conditional name="max_custom_atom_condition">
+      <param name="max_custom_atom_choice" label="Do you want to manage custom maximum number atoms?" type="select" display="radio" help="To work only with [13]C isotopes for example, use YES - ()Don't forget to select wanted atoms below)">
+        <option value="NO" selected="true">NO</option>
+        <option value="YES">YES</option>
+      </param>
+      <when value="YES">
+        <param name="C12_max_value" label="[12]C atom max number " type="integer" value="0" min="0" max="100" help="The maximum of [12]C you need to (should be between 0 and 100 atoms per structure). Default value is 0"/>
+        <param name="C13_max_value" label="[13]C atom max number " type="integer" value="40" min="0" max="100" help="The maximum of [13]C you need to (should be between 0 and 100 atoms per structure). Default value is 40"/>
+        <param name="H_max_value" label="[1]H atom max number " type="integer" value="200" min="0" max="200" help="The maximum of H you need to (should be between 0 and 200 atoms per structure). Default value is 200"/>
+        <param name="N_max_value" label="[15]N atom max number " type="integer" value="40" min="0" max="100" help="The maximum of N you need to (should be between 0 and 100 atoms per structure). Default value is 40"/>
+        <param name="O_max_value" label="[16]O atom max number " type="integer" value="70" min="0" max="100" help="The maximum of O you need to (should be between 0 and 100 atoms per structure). Default value is 70"/>
+        <param name="P_max_value" label="[31]P atom max number " type="integer" value="10" min="0" max="100" help="The maximum of P you need to (should be between 0 and 100 atoms per structure). Default value is 10"/>
+        <param name="S_max_value" label="[32]S atom max number " type="integer" value="10" min="0" max="100" help="The maximum of S you need to (should be between 0 and 100 atoms per structure). Default value is 10"/>
+        <param name="F_max_value" label="[19]F atom max number " type="integer" value="10" min="0" max="100" help="The maximum of F you need to (should be between 0 and 100 atoms per structure). Default value is 10"/>
+        <param name="Cl_max_value" label="[35]Cl atom max number " type="integer" value="10" min="0" max="100" help="The maximum of Cl you need to (should be between 0 and 100 atoms per structure). Default value is 10"/>
+        <param name="K_max_value" label="[13]K atom max number " type="integer" value="10" min="0" max="100" help="The maximum of K you need to (should be between 0 and 100 atoms per structure). Default value is 10"/>
+        <param name="Br_max_value" label="[80]Br atom max number " type="integer" value="10" min="0" max="100" help="The maximum of Br you need to (should be between 0 and 100 atoms per structure). Default value is 10"/>
+        <param name="Na_max_value" label="[23]Na atom max number " type="integer" value="10" min="0" max="100" help="The maximum of Na you need to (should be between 0 and 40 atoms per structure). Default value is 10"/>
+      </when>
+      <when value="NO">
+      </when>
+    </conditional>
     <param name="verbose" type="select" label="Verbose level" display="radio" help="">
         <option value="1" selected="true">Low</option>
         <option value="3" >High</option>
@@ -118,7 +158,7 @@
   	<test>
   		<param name="choice" value="NO"/>
   		<param name="masse" value="175.125"/>
-  		<param name="tolerance" value="1.0"/>
+  		<param name="tol" value="1.0"/>
   		<param name="mode" value="negative"/>
   		<param name="qtCharge" value="1"/>
   		<param name="atomes_basic" value="C,O,N,H"/>
@@ -129,7 +169,7 @@
     <test>
   		<param name="choice" value="NO"/>
   		<param name="masse" value="88.052"/>
-  		<param name="tolerance" value="1.0"/>
+  		<param name="tol" value="1.0"/>
   		<param name="mode" value="neutral"/>
   		<param name="qtCharge" value="1"/>
   		<param name="atomes_basic" value="C,O,H"/>
@@ -140,11 +180,12 @@
     <test>
   		<param name="choice" value="NO"/>
   		<param name="masse" value="427.019898895"/>
-  		<param name="tolerance" value="1.0"/>
+  		<param name="tol" value="1.0"/>
   		<param name="mode" value="neutral"/>
   		<param name="qtCharge" value="1"/>
   		<param name="atomes_basic" value="C,O,N,H,P"/>
   		<param name="atomes_sup" value="S"/>
+  		<param name="S_max_value" value="40"/>
   		<param name="regleOr" value="NO"/>
   		<param name="verbose" value="3"/>
   		<output name="variableMetadata" file="out3.tabular"/>
--- a/hr2_manager.pl	Tue Jan 17 10:31:32 2023 +0000
+++ b/hr2_manager.pl	Wed Feb 15 15:57:49 2023 +0000
@@ -4,6 +4,7 @@
 ## VERSIONS :
 #	- 01/03/2019 : Fix P issue, permit more flexible atom settings and add requirements for conda auto managing.
 #	- 09/12/2022 : Fix "Additional atomes not taken into account" - Ticket issue #7 
+#	- 15/02/2023 : New feature - optionnal managing max atom value
 
 #=============================================================================
 #                              Included modules and versions
@@ -32,6 +33,8 @@
 my ( $input_file, $line_header, $col_id, $col_mass ) = ( undef, undef, undef, undef ) ; # manage input option file of masses
 my ( $mass ) = ( undef ) ; # manage input option masses list
 my ( $tolerance, $mode, $charge, $has_golden_rules, $atomes, $atomes_basic ) = ( undef, undef, undef, undef, undef, undef ) ; # manage params
+my ( $C13_max_value, $C12_max_value, $H_max_value, $N_max_value, $O_max_value, $P_max_value, $S_max_value, $F_max_value, $Cl_max_value, $K_max_value, $Br_max_value, $Na_max_value) = (undef, undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef) ;
+my ($customAtomValues) = (undef) ;
 my ( $output_csv, $output_html ) = ( undef, undef) ; # manage ouputs
 my $verbose = 2 ;
 
@@ -50,6 +53,21 @@
 				"regleOr:s"		=>	\$has_golden_rules,
 				"atomes_basic:s"=>	\$atomes_basic, # [basic atoms like CNOHP]
 				"atomes_sup:s"	=>	\$atomes,
+				#"customAtomValues:s"=>	\$customAtomValues,
+				
+				"C12_max_value:i"	=>	\$C12_max_value, # OPTIONNAL
+		    	"C13_max_value:i"	=>	\$C13_max_value,
+		    	"H_max_value:i"		=>	\$H_max_value,
+		    	"N_max_value:i"		=>	\$N_max_value,
+		    	"O_max_value:i"		=>	\$O_max_value,
+		    	"P_max_value:i"		=>	\$P_max_value,
+		    	"S_max_value:i"		=>	\$S_max_value,
+		    	"F_max_value:i"		=>	\$F_max_value,
+		    	"Cl_max_value:i"	=>	\$Cl_max_value,
+		    	"K_max_value:i"		=>	\$K_max_value,
+		    	"Br_max_value:i"	=>	\$Br_max_value,
+		    	"Na_max_value:i"	=>	\$Na_max_value,
+				
 				"output1:s"		=>	\$output_csv,
 				"outputView:s"	=>	\$output_html,
 				"verbose:i"		=> 	\$verbose,
@@ -63,19 +81,19 @@
 #=============================================================================
 #                                MAIN SCRIPT
 #=============================================================================
-my %atomsConf = () ;
-$atomsConf{'C'} = {'min' => 0, 'max' =>  0} ;
-$atomsConf{	'H'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'N'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'O'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'P'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'S'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'F'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'L'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'K'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'B'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'A'} = {'min' => 0, 'max' => 0} ;
-$atomsConf{	'1'} = {'min' => 0, 'max' => 0} ;
+
+#print "CUSTOM C12: $C12_max_value\n" if (defined $C12_max_value) ;
+#print "CUSTOM H: $H_max_value if (defined $H_max_value) ;
+#print "CUSTOM N: $N_max_value if (defined $N_max_value) ;
+#print "CUSTOM O: $O_max_value if (defined $O_max_value) ;
+#print "CUSTOM P: $P_max_value if (defined $P_max_value) ;
+#print "CUSTOM S: $S_max_value if (defined $S_max_value) ;
+#print "CUSTOM F: $F_max_value if (defined $F_max_value) ;
+#print "CUSTOM Cl: $Cl_max_value if (defined $Cl_max_value) ;
+#print "CUSTOM K: $K_max_value if (defined $K_max_value) ;
+#print "CUSTOM Br: $Br_max_value if (defined $Br_max_value) ;
+#print "CUSTOM Na: $Na_max_value if (defined $Na_max_value) ;
+#print "CUSTOM C13: $C13_max_value if (defined $C13_max_value) ;
 
 ## -------------- Conf file and verbose ------------------------ :
 my ( $CONF ) = ( undef ) ; ## verbose level is 3 for debugg
@@ -104,18 +122,10 @@
 #$hr_atoms_list = $ohr->manage_atoms(\$atomes, \$CONF->{'DEFAULT_ATOMS'}) ; ## DEPRECATED
 
 # manage atoms and their ranges with a hash structure
-my $atomsCurrentConf = $ohr->manage_atoms_and_ranges(\%atomsConf, $CONF, $atomes_basic, $atomes) ;
 
-#if ( defined $hr_atoms_list ) {
-#	## implements range foreach atom
-#	foreach my $atom ( (split(",", $$hr_atoms_list )) ) {
-#		my $range_max = $CONF->{'DEFAULT_MAX'} ; # manage max value in case of
-#		if ( exists $CONF->{$atom} ) 	{ $range_max = $CONF->{$atom} ; }
-#		my $ref_range = $ohr->manage_atom_and_range(\$atom, \$CONF->{'DEFAULT_MIN'}, \$range_max ) ;
-#		$hr_atoms_and_ranges .= $$ref_range ; ## concat ranges
-#	}
-#}
-#else { 	croak "No atom detected with input params\n" ; }
+my $AtomsFullConf = $ohr->manageAtomsConf($CONF, $C12_max_value, $C13_max_value, $H_max_value, $N_max_value, $O_max_value, $P_max_value, $S_max_value, $F_max_value, $Cl_max_value, $K_max_value, $Br_max_value, $Na_max_value ) ;
+
+my $atomsCurrentConf = $ohr->manage_atoms_and_ranges($AtomsFullConf, $atomes_basic, $atomes) ;
 
 ## Parsing input file with masses/ids or unik mass :
 ## manage only one mass
@@ -155,12 +165,11 @@
 	## computes mass
 	my $ohr_mode = lib::hr->new() ;
 	my ( $exact_mass ) = $ohr_mode->manage_mode( \$mode, \$charge, \$CONF->{'electron'}, \$CONF->{'proton'}, \$mz ) ;
-	print "Current MZ send to HR\n"  if $verbose == 3 ;
-	print Dumper $exact_mass if $verbose == 3 ;
+	print "Current MZ $$exact_mass send to HR\n"  if $verbose == 3 ;
 	## build exe line
 	my $ohr_exe = lib::hr->new() ;
 	my $hr_cmd = $ohr_exe->config_hr_exe( \$CONF->{'HR2_EXE'}, \$tolerance, $exact_mass, \$has_golden_rules, \$atomsCurrentConf ) ;
-	print "$$hr_cmd\n" if $verbose == 3 ;
+	print "\t$$hr_cmd\n" if $verbose == 3 ;
 	push(@{$hr_cmds}, $$hr_cmd) ;
 }
 
@@ -225,7 +234,7 @@
 
 ### VERBOSE OUTPUTs
 if ( $verbose == 3 ) {
-	print "-- Conf file contains :\n" ;
+	print "\n\n-- Conf file contains :\n" ;
 	print Dumper $CONF ;
 	print "-- Atoms input list :\n" ;
 	print Dumper $atomes_basic ;
@@ -340,4 +349,6 @@
 
 version 5 : 09/12/2022
 
+version 6 : 15/02/2023
+
 =cut
\ No newline at end of file
--- a/lib/hr.pm	Tue Jan 17 10:31:32 2023 +0000
+++ b/lib/hr.pm	Wed Feb 15 15:57:49 2023 +0000
@@ -14,8 +14,8 @@
 
 our $VERSION = "1.0";
 our @ISA = qw(Exporter);
-our @EXPORT = qw( manage_atoms_and_ranges manage_atoms check_hr_exe manage_atom_and_range manage_tolerance manage_mode config_hr_exe );
-our %EXPORT_TAGS = ( ALL => [qw(manage_atoms_and_ranges manage_atoms check_hr_exe manage_atom_and_range manage_tolerance manage_mode config_hr_exe )] );
+our @EXPORT = qw( manageAtomsConf manage_atoms_and_ranges check_hr_exe manage_tolerance manage_mode config_hr_exe );
+our %EXPORT_TAGS = ( ALL => [qw(manageAtomsConf manage_atoms_and_ranges check_hr_exe manage_tolerance manage_mode config_hr_exe )] );
 
 =head1 NAME
 
@@ -54,6 +54,75 @@
 }
 ### END of SUB
 
+
+=head2 METHOD manageAtomsConf
+
+	## Description : take all max atom values from CONF file and personal choice 
+	## Input : $confFile, $C12_max_value, $C13_max_value, $H_max_value, $N_max_value, $O_max_value, $P_max_value, $S_max_value, $F_max_value, $Cl_max_value, $K_max_value, $Br_max_value, $Na_max_value
+	## Output : $atomFullConfig
+	## Usage : my ( $atomFullConfig ) = manageAtomsConf ( $confFile, $C12_max_value, $C13_max_value, $H_max_value, $N_max_value, $O_max_value, $P_max_value, $S_max_value, $F_max_value, $Cl_max_value, $K_max_value, $Br_max_value, $Na_max_value ) ;
+	
+=cut
+## START of SUB
+sub manageAtomsConf{
+    ## Retrieve Values
+    my $self = shift ;
+    my ($confFile, $C12_max_value, $C13_max_value, $H_max_value, $N_max_value, $O_max_value, $P_max_value, $S_max_value, $F_max_value, $Cl_max_value, $K_max_value, $Br_max_value, $Na_max_value) = @_ ;
+    
+    my %atomFullConfig = () ;
+	$atomFullConfig{'C'} = {'min' => 0, 'max' =>  0} ;
+	$atomFullConfig{'H'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'N'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'O'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'P'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'S'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'F'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'L'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'K'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'B'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'A'} = {'min' => 0, 'max' => 0} ;
+	$atomFullConfig{'1'} = {'min' => 0, 'max' => 0} ;
+	
+	if (defined $C12_max_value)	{ 	$atomFullConfig{'C'}{'max'} = $C12_max_value ; 	}
+	else 						{	$atomFullConfig{'C'}{'max'} = $confFile->{'C'}	}
+	
+	if (defined $H_max_value)	{ 	$atomFullConfig{'H'}{'max'} = $H_max_value ; 	}
+	else 						{	$atomFullConfig{'H'}{'max'} = $confFile->{'H'}	}
+	
+	if (defined $N_max_value)	{ 	$atomFullConfig{'N'}{'max'} = $N_max_value ; 	}
+	else 						{	$atomFullConfig{'N'}{'max'} = $confFile->{'N'}	}
+	
+	if (defined $O_max_value)	{ 	$atomFullConfig{'O'}{'max'} = $O_max_value ; 	}
+	else 						{	$atomFullConfig{'O'}{'max'} = $confFile->{'O'}	}
+	
+	if (defined $P_max_value)	{ 	$atomFullConfig{'P'}{'max'} = $P_max_value ; 	}
+	else 						{	$atomFullConfig{'P'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+	
+	if (defined $S_max_value)	{ 	$atomFullConfig{'S'}{'max'} = $S_max_value ; 	}
+	else 						{	$atomFullConfig{'S'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+	
+	if (defined $F_max_value)	{ 	$atomFullConfig{'F'}{'max'} = $F_max_value ; 	}
+	else 						{	$atomFullConfig{'F'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+	
+	if (defined $Cl_max_value)	{ 	$atomFullConfig{'L'}{'max'} = $Cl_max_value ; 	}
+	else 						{	$atomFullConfig{'L'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+	
+	if (defined $K_max_value)	{ 	$atomFullConfig{'K'}{'max'} = $K_max_value ; 	}
+	else 						{	$atomFullConfig{'K'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+	
+	if (defined $Br_max_value)	{ 	$atomFullConfig{'B'}{'max'} = $Br_max_value ; 	}
+	else 						{	$atomFullConfig{'B'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+	
+	if (defined $Na_max_value)	{ 	$atomFullConfig{'A'}{'max'} = $Na_max_value ; 	}
+	else 						{	$atomFullConfig{'A'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+	
+	if (defined $C13_max_value)	{ 	$atomFullConfig{'1'}{'max'} = $C13_max_value ; 	}
+	else 						{	$atomFullConfig{'1'}{'max'} = $confFile->{'DEFAULT_MAX'}	}
+    
+    return (\%atomFullConfig) ;
+}
+### END of SUB
+
 =head2 METHOD manage_atoms_and_ranges
 
 	## Description : allow from an initial config to add or delete atoms and their range
@@ -66,90 +135,45 @@
 sub manage_atoms_and_ranges {
     ## Retrieve Values
     my $self = shift ;
-    my ( $atomsconfig, $CONF, $atombasic, $atomsupp ) = @_;
-    my ( $atomcleanconfig ) = ( undef ) ;
+    my ( $atomFullconfig, $atombasic, $atomsupp ) = @_;
+    my ( $atomConfigCmd ) = ( undef ) ;
+    my %atomCurrentConfig = () ;
+		$atomCurrentConfig{'C'} = {'min' => 0, 'max' =>  0} ;
+		$atomCurrentConfig{'H'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'N'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'O'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'P'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'S'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'F'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'L'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'K'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'B'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'A'} = {'min' => 0, 'max' => 0} ;
+		$atomCurrentConfig{'1'} = {'min' => 0, 'max' => 0} ;
     
     # basic atoms case:
     foreach my $atom ( (split(",", $atombasic )) ) {
-    	if ( exists $CONF->{$atom} ) 	{ $atomsconfig->{$atom}{'max'} = $CONF->{$atom} ; }
+    	if ( exists $atomFullconfig->{$atom}{'max'} )     { $atomCurrentConfig{$atom}{'max'} = $atomFullconfig->{$atom}{'max'} ; }
     	else {  print "*** $atom not recognized***\n" ; }
     }
     
     # suppl. atoms case
     foreach my $atom ( (split(",", $atomsupp )) ) {
     	#print "*** $atom***\n" ;
-    	if ( exists $atomsconfig->{$atom} ) 	{ $atomsconfig->{$atom}{'max'} = $CONF->{'DEFAULT_MAX'} ; }
+    	if ( exists $atomFullconfig->{$atom}{'max'} ) 	{ $atomCurrentConfig{$atom}{'max'} = $atomFullconfig->{$atom}{'max'} ; }
     	else {  print "*** $atom not recognized***\n" ; }
     	
     }
     
     # Create atoms and range parameters:    
-    foreach my $selectedAtom ( keys %{$atomsconfig} ) {
-    	$atomcleanconfig .= ' -'.$selectedAtom.' '.$atomsconfig->{$selectedAtom}{'min'}.'-'.$atomsconfig->{$selectedAtom}{'max'} ;
+    foreach my $selectedAtom ( keys %atomCurrentConfig ) {
+    	$atomConfigCmd .= ' -'.$selectedAtom.' '.$atomCurrentConfig{$selectedAtom}{'min'}.'-'.$atomCurrentConfig{$selectedAtom}{'max'} ;
     }
     
-    return ($atomcleanconfig) ;
+    return ($atomConfigCmd) ;
 }
 ### END of SUB
 
-
-     
-=head2 METHOD manage_atoms ### DEPRECATED
-
-	## Description : controles atoms input list and prepare it like hr binary parameter 
-	## Input : $input_atoms, $conf_atoms
-	## Output : $hr_atoms_param
-	## Usage : my ( $hr_atoms_param ) = manage_atoms( $input_atoms, $conf_atoms ) ;
-	### DEPRECATED
-	
-=cut
-## START of SUB
-sub manage_atoms { ### DEPRECATED
-	## Retrieve Values
-    my $self = shift ;
-    my ( $input_atoms, $conf_atoms ) = @_ ;
-    my $hr_atoms_param = undef ;
-    
-    if ( ( defined $$input_atoms ) and ( defined $$conf_atoms )  ) {
-    	if ( ( $$input_atoms eq 'None' ) or ( $$input_atoms eq '' ) or ( $$input_atoms eq ' ' ) )	{  $hr_atoms_param =  $$conf_atoms ; 	}
-    	elsif ( $$input_atoms =~ /[P|S|F|L|K|B|A|1|,]+/ ) { $hr_atoms_param =  $$conf_atoms.','.$$input_atoms ;  }
-    	else 							{  $hr_atoms_param =  $$conf_atoms ;  	}
-    } ## END IF
-    elsif ( !defined $$input_atoms ) { 	$hr_atoms_param =  $$conf_atoms ; }
-    elsif ( !defined $$conf_atoms )  { 	warn "hr module can't manage any atom list (undef values in conf)\n" ; }
-    else {						    	warn "hr module musn't manage any atom list\n" ; }
-    
-    return(\$hr_atoms_param) ;
-}
-## END of SUB
-
-=head2 METHOD manage_atom_and_range ### DEPRECATED
-
-	## Description : build atom range with defined value in conf file
-	## Input : $atom, $min, $max
-	## Output : $hr_range
-	## Usage : my (  ) = manage_atom_and_range( $atom, $min, $max ) ;
-	### DEPRECATED
-	
-=cut
-## START of SUB
-sub manage_atom_and_range { ### DEPRECATED
-	## Retrieve Values
-    my $self = shift ;
-    my ( $atom, $min, $max ) = @_ ;
-    my $hr_range = undef ;
-    
-    if ( ( defined $$atom ) and ( defined $$min ) and ( defined $$max )  ) {
-    	## manage ragne like "-C 0-200"
-    	$hr_range = ' -'.$$atom.' '.$$min.'-'.$$max ;
-    } ## END IF
-    else {
-    	warn "Some argvts are missing to build the current atom range line\n" ;
-    }    
-    return(\$hr_range) ;
-}
-## END of SUB
-
 =head2 METHOD manage_tolerance
 
 	## Description : check range and format of tolerance
@@ -757,7 +781,7 @@
 
 =over 4
 
-=item :ALL is manage_atoms, check_hr_exe, manage_tolerance
+=item :ALL is manageAtomsConf manage_atoms_and_ranges check_hr_exe manage_tolerance manage_mode config_hr_exe
 
 =back
 
@@ -773,6 +797,6 @@
 
 version 1 : 02 / 20 / 2014
 
-version 2 : ??
+version 2 : 02/ 15 / 2023 - Add personal max value for each atom manager methods, remove deprecated methods
 
 =cut
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input06.tabular	Wed Feb 15 15:57:49 2023 +0000
@@ -0,0 +1,4 @@
+id	mz	formula
+01	257.1704	[13]C11 H20 O5 N
+02	305.1373	[13]C11 H20 O6 N S
+03	344.2046	[13]C13 H23 O6 N4
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/out6.html	Wed Feb 15 15:57:49 2023 +0000
@@ -0,0 +1,1 @@
+<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description" content=""><meta name="author" content="INRAE Clermont-Ferrand"><title>Galaxy HR2 queries - All results</title><link rel="stylesheet" href="css.php" media="all"><link rel="stylesheet" href="https://cdn.rawgit.com/fgiacomoni/galaxy_utils/master/style/simplePagination.css"/><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script src="https://cdn.rawgit.com/fgiacomoni/galaxy_utils/master/scripts/jquery.simplePagination.js"></script><style>body{padding-top:70px} div.lm-table-warning{font-size:1.4em;font-weight:bold;padding-right:25px;color:#21536a;margin-left:3px;}tr.green td{background-color:#eaf2d3;color:black;} tr.blank td{background-color:#9999CC;color:black;} table{font-family:\"Trebuchet MS\", Arial, Helvetica, sans-serif;width:100%;border-collapse:collapse;}table.detail, table.detail tr.parent, table.detail td, table.detail th, table.detail tr.category {border-collapse:collapse;border:1px solid #98bf21;}table.detail th {font-size:1.2em;text-align:center;padding-top:5px;padding-bottom:10px;background-color:#a7c942;color:#ffffff;}td {text-align:center;}footer{margin:50px 0;}</style><script>function test(pageNumber){var page="#page-id-"+pageNumber;$('.select').hide();$(page).show()}</script></head><body><div class="container"><div class="lm-table-warning">Results of HR elucidation queries - Mode used: positive / Charge: +1 / Mass tolerance: 1.0 / Composition:  -S 0-10 -O 0-70 -L 0-0 -K 0-0 -P 0-10 -F 0-0 -N 0-40 -B 0-0 -A 0-0 -1 0-40 -C 0-0 -H 0-200</div><div id="detail_table_source" style="display:none"></div><p><div id="choose"></div><p><div id="ms_search_0" class="ms-search-table"></div><table id="detail_table" class="detail"><col style="width:20px;"><!-- Ids (m/z)--><col style="width:20px;"><!-- Mass (m/z)--><col style="width:20px;"><!-- Formula--><col style="width:60px;"><!-- cpd mw--><col style="width:50px;"><!-- delta--><col style="width:50px;"><!-- total--><thead><th>ID from input</th><th>Mass (m/z)</th><th>Formula</th><th>Compound MW (Da)</th><th>Delta</th><th>Total</th></thead><tbody class="select" id="page-id-1"><tr class="white"><td>01</td><td id="1">257.1704</td><td colspan="3"></td><td>2</td></tr><tr class="white"><td colspan="2"></td><td >iC11H19N1O5</td><td >256.1632259</td><td >-0.10</td><td colspan="1"></td></tr><tr class="white"><td colspan="2"></td><td >iC12H21O3P1</td><td >256.1630892</td><td >0.03</td><td colspan="1"></td></tr><tr class="green"><td>02</td><td id="2">305.1373</td><td colspan="3"></td><td>3</td></tr><tr class="green"><td colspan="2"></td><td >iC13H13N3O5</td><td >304.1291334</td><td >0.89</td><td colspan="1"></td></tr><tr class="green"><td colspan="2"></td><td >iC11H19N1O6S1</td><td >304.1302113</td><td >-0.19</td><td colspan="1"></td></tr><tr class="green"><td colspan="2"></td><td >iC12H21O4P1S1</td><td >304.1300745</td><td >-0.05</td><td colspan="1"></td></tr><tr class="white"><td>03</td><td id="3">344.2046</td><td colspan="3"></td><td>7</td></tr><tr class="white"><td colspan="2"></td><td >iC7H20N12O4</td><td >343.1965311</td><td >0.79</td><td colspan="1"></td></tr><tr class="white"><td colspan="2"></td><td >iC13H22N4O6</td><td >343.1975474</td><td >-0.22</td><td colspan="1"></td></tr><tr class="white"><td colspan="2"></td><td >iC8H22N11O2P1</td><td >343.1963943</td><td >0.93</td><td colspan="1"></td></tr><tr class="white"><td colspan="2"></td><td >iC14H24N3O4P1</td><td >343.1974106</td><td >-0.09</td><td colspan="1"></td></tr><tr class="white"><td colspan="2"></td><td >iC15H26N2O2P2</td><td >343.1972739</td><td >0.05</td><td colspan="1"></td></tr><tr class="white"><td colspan="2"></td><td >iC16H28N1P3</td><td >343.1971372</td><td >0.19</td><td colspan="1"></td></tr><tr class="white"><td colspan="2"></td><td >iC13H30O5S2</td><td >343.1970783</td><td >0.25</td><td colspan="1"></td></tr></tbody></table></div><div class="container"><hr><footer><div class="row"><div class="col-lg-12"><p><a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" /></a></p><p>Copyright &copy; INRAE, N Paulhe, L Pavot, F Giacomoni 2023</a></p></div> </div></footer></div><script language="javascript">$(function() {$('#choose').pagination({items: 1,itemsOnPage: 1,currentPage: 1,onInit: function () { test(1); },cssStyle: 'light-theme',onPageClick: function(pageNumber){test(pageNumber)}}).pagination('redraw');});</script></body></html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/out6.tabular	Wed Feb 15 15:57:49 2023 +0000
@@ -0,0 +1,4 @@
+id	mz	formula	hr2
+01	257.1704	"[13]C11 H20 O5 N"	-0.10::(iC11H19N1O5)::256.1632259|0.03::(iC12H21O3P1)::256.1630892
+02	305.1373	"[13]C11 H20 O6 N S"	0.89::(iC13H13N3O5)::304.1291334|-0.19::(iC11H19N1O6S1)::304.1302113|-0.05::(iC12H21O4P1S1)::304.1300745
+03	344.2046	"[13]C13 H23 O6 N4"	0.79::(iC7H20N12O4)::343.1965311|-0.22::(iC13H22N4O6)::343.1975474|0.93::(iC8H22N11O2P1)::343.1963943|-0.09::(iC14H24N3O4P1)::343.1974106|0.05::(iC15H26N2O2P2)::343.1972739|0.19::(iC16H28N1P3)::343.1971372|0.25::(iC13H30O5S2)::343.1970783