Repository 'hr2'
hg clone https://toolshed.g2.bx.psu.edu/repos/fgiacomoni/hr2

Changeset 3:78afd7f439f3 (2023-02-15)
Previous changeset 2:23970530a518 (2023-01-17)
Commit message:
master branch Updating with tag :CI_COMMIT_TAG - - Fxx
modified:
HR2.xml
hr2_manager.pl
lib/hr.pm
added:
test-data/input06.tabular
test-data/out6.html
test-data/out6.tabular
b
diff -r 23970530a518 -r 78afd7f439f3 HR2.xml
--- 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"/>
b
diff -r 23970530a518 -r 78afd7f439f3 hr2_manager.pl
--- 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
b
diff -r 23970530a518 -r 78afd7f439f3 lib/hr.pm
--- a/lib/hr.pm Tue Jan 17 10:31:32 2023 +0000
+++ b/lib/hr.pm Wed Feb 15 15:57:49 2023 +0000
[
b'@@ -14,8 +14,8 @@\n \r\n our $VERSION = "1.0";\r\n our @ISA = qw(Exporter);\r\n-our @EXPORT = qw( manage_atoms_and_ranges manage_atoms check_hr_exe manage_atom_and_range manage_tolerance manage_mode config_hr_exe );\r\n-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 )] );\r\n+our @EXPORT = qw( manageAtomsConf manage_atoms_and_ranges check_hr_exe manage_tolerance manage_mode config_hr_exe );\r\n+our %EXPORT_TAGS = ( ALL => [qw(manageAtomsConf manage_atoms_and_ranges check_hr_exe manage_tolerance manage_mode config_hr_exe )] );\r\n \r\n =head1 NAME\r\n \r\n@@ -54,6 +54,75 @@\n }\r\n ### END of SUB\r\n \r\n+\r\n+=head2 METHOD manageAtomsConf\r\n+\r\n+\t## Description : take all max atom values from CONF file and personal choice \r\n+\t## 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\r\n+\t## Output : $atomFullConfig\r\n+\t## 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 ) ;\r\n+\t\r\n+=cut\r\n+## START of SUB\r\n+sub manageAtomsConf{\r\n+    ## Retrieve Values\r\n+    my $self = shift ;\r\n+    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) = @_ ;\r\n+    \r\n+    my %atomFullConfig = () ;\r\n+\t$atomFullConfig{\'C\'} = {\'min\' => 0, \'max\' =>  0} ;\r\n+\t$atomFullConfig{\'H\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'N\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'O\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'P\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'S\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'F\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'L\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'K\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'B\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'A\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t$atomFullConfig{\'1\'} = {\'min\' => 0, \'max\' => 0} ;\r\n+\t\r\n+\tif (defined $C12_max_value)\t{ \t$atomFullConfig{\'C\'}{\'max\'} = $C12_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'C\'}{\'max\'} = $confFile->{\'C\'}\t}\r\n+\t\r\n+\tif (defined $H_max_value)\t{ \t$atomFullConfig{\'H\'}{\'max\'} = $H_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'H\'}{\'max\'} = $confFile->{\'H\'}\t}\r\n+\t\r\n+\tif (defined $N_max_value)\t{ \t$atomFullConfig{\'N\'}{\'max\'} = $N_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'N\'}{\'max\'} = $confFile->{\'N\'}\t}\r\n+\t\r\n+\tif (defined $O_max_value)\t{ \t$atomFullConfig{\'O\'}{\'max\'} = $O_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'O\'}{\'max\'} = $confFile->{\'O\'}\t}\r\n+\t\r\n+\tif (defined $P_max_value)\t{ \t$atomFullConfig{\'P\'}{\'max\'} = $P_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'P\'}{\'max\'} = $confFile->{\'DEFAULT_MAX\'}\t}\r\n+\t\r\n+\tif (defined $S_max_value)\t{ \t$atomFullConfig{\'S\'}{\'max\'} = $S_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'S\'}{\'max\'} = $confFile->{\'DEFAULT_MAX\'}\t}\r\n+\t\r\n+\tif (defined $F_max_value)\t{ \t$atomFullConfig{\'F\'}{\'max\'} = $F_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'F\'}{\'max\'} = $confFile->{\'DEFAULT_MAX\'}\t}\r\n+\t\r\n+\tif (defined $Cl_max_value)\t{ \t$atomFullConfig{\'L\'}{\'max\'} = $Cl_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'L\'}{\'max\'} = $confFile->{\'DEFAULT_MAX\'}\t}\r\n+\t\r\n+\tif (defined $K_max_value)\t{ \t$atomFullConfig{\'K\'}{\'max\'} = $K_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'K\'}{\'max\'} = $confFile->{\'DEFAULT_MAX\'}\t}\r\n+\t\r\n+\tif (defined $Br_max_value)\t{ \t$atomFullConfig{\'B\'}{\'max\'} = $Br_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'B\'}{\'max\'} = $confFile->{\'DEFAULT_MAX\'}\t}\r\n+\t\r\n+\tif (defined $Na_max_value)\t{ \t$atomFullConfig{\'A\'}{\'max\'} = $Na_max_value ; \t}\r\n+\telse \t\t\t\t\t\t{\t$atomFullConfig{\'A\'}{\'max\'} = $confFile->{\'DEFAULT_MAX\'}\t}\r\n+\t\r\n+\tif (defined $C1'..b'ax\' => 0} ;\r\n+\t\t$atomCurrentConfig{\'1\'} = {\'min\' => 0, \'max\' => 0} ;\r\n     \r\n     # basic atoms case:\r\n     foreach my $atom ( (split(",", $atombasic )) ) {\r\n-    \tif ( exists $CONF->{$atom} ) \t{ $atomsconfig->{$atom}{\'max\'} = $CONF->{$atom} ; }\r\n+    \tif ( exists $atomFullconfig->{$atom}{\'max\'} )     { $atomCurrentConfig{$atom}{\'max\'} = $atomFullconfig->{$atom}{\'max\'} ; }\r\n     \telse {  print "*** $atom not recognized***\\n" ; }\r\n     }\r\n     \r\n     # suppl. atoms case\r\n     foreach my $atom ( (split(",", $atomsupp )) ) {\r\n     \t#print "*** $atom***\\n" ;\r\n-    \tif ( exists $atomsconfig->{$atom} ) \t{ $atomsconfig->{$atom}{\'max\'} = $CONF->{\'DEFAULT_MAX\'} ; }\r\n+    \tif ( exists $atomFullconfig->{$atom}{\'max\'} ) \t{ $atomCurrentConfig{$atom}{\'max\'} = $atomFullconfig->{$atom}{\'max\'} ; }\r\n     \telse {  print "*** $atom not recognized***\\n" ; }\r\n     \t\r\n     }\r\n     \r\n     # Create atoms and range parameters:    \r\n-    foreach my $selectedAtom ( keys %{$atomsconfig} ) {\r\n-    \t$atomcleanconfig .= \' -\'.$selectedAtom.\' \'.$atomsconfig->{$selectedAtom}{\'min\'}.\'-\'.$atomsconfig->{$selectedAtom}{\'max\'} ;\r\n+    foreach my $selectedAtom ( keys %atomCurrentConfig ) {\r\n+    \t$atomConfigCmd .= \' -\'.$selectedAtom.\' \'.$atomCurrentConfig{$selectedAtom}{\'min\'}.\'-\'.$atomCurrentConfig{$selectedAtom}{\'max\'} ;\r\n     }\r\n     \r\n-    return ($atomcleanconfig) ;\r\n+    return ($atomConfigCmd) ;\r\n }\r\n ### END of SUB\r\n \r\n-\r\n-     \r\n-=head2 METHOD manage_atoms ### DEPRECATED\r\n-\r\n-\t## Description : controles atoms input list and prepare it like hr binary parameter \r\n-\t## Input : $input_atoms, $conf_atoms\r\n-\t## Output : $hr_atoms_param\r\n-\t## Usage : my ( $hr_atoms_param ) = manage_atoms( $input_atoms, $conf_atoms ) ;\r\n-\t### DEPRECATED\r\n-\t\r\n-=cut\r\n-## START of SUB\r\n-sub manage_atoms { ### DEPRECATED\r\n-\t## Retrieve Values\r\n-    my $self = shift ;\r\n-    my ( $input_atoms, $conf_atoms ) = @_ ;\r\n-    my $hr_atoms_param = undef ;\r\n-    \r\n-    if ( ( defined $$input_atoms ) and ( defined $$conf_atoms )  ) {\r\n-    \tif ( ( $$input_atoms eq \'None\' ) or ( $$input_atoms eq \'\' ) or ( $$input_atoms eq \' \' ) )\t{  $hr_atoms_param =  $$conf_atoms ; \t}\r\n-    \telsif ( $$input_atoms =~ /[P|S|F|L|K|B|A|1|,]+/ ) { $hr_atoms_param =  $$conf_atoms.\',\'.$$input_atoms ;  }\r\n-    \telse \t\t\t\t\t\t\t{  $hr_atoms_param =  $$conf_atoms ;  \t}\r\n-    } ## END IF\r\n-    elsif ( !defined $$input_atoms ) { \t$hr_atoms_param =  $$conf_atoms ; }\r\n-    elsif ( !defined $$conf_atoms )  { \twarn "hr module can\'t manage any atom list (undef values in conf)\\n" ; }\r\n-    else {\t\t\t\t\t\t    \twarn "hr module musn\'t manage any atom list\\n" ; }\r\n-    \r\n-    return(\\$hr_atoms_param) ;\r\n-}\r\n-## END of SUB\r\n-\r\n-=head2 METHOD manage_atom_and_range ### DEPRECATED\r\n-\r\n-\t## Description : build atom range with defined value in conf file\r\n-\t## Input : $atom, $min, $max\r\n-\t## Output : $hr_range\r\n-\t## Usage : my (  ) = manage_atom_and_range( $atom, $min, $max ) ;\r\n-\t### DEPRECATED\r\n-\t\r\n-=cut\r\n-## START of SUB\r\n-sub manage_atom_and_range { ### DEPRECATED\r\n-\t## Retrieve Values\r\n-    my $self = shift ;\r\n-    my ( $atom, $min, $max ) = @_ ;\r\n-    my $hr_range = undef ;\r\n-    \r\n-    if ( ( defined $$atom ) and ( defined $$min ) and ( defined $$max )  ) {\r\n-    \t## manage ragne like "-C 0-200"\r\n-    \t$hr_range = \' -\'.$$atom.\' \'.$$min.\'-\'.$$max ;\r\n-    } ## END IF\r\n-    else {\r\n-    \twarn "Some argvts are missing to build the current atom range line\\n" ;\r\n-    }    \r\n-    return(\\$hr_range) ;\r\n-}\r\n-## END of SUB\r\n-\r\n =head2 METHOD manage_tolerance\r\n \r\n \t## Description : check range and format of tolerance\r\n@@ -757,7 +781,7 @@\n \r\n =over 4\r\n \r\n-=item :ALL is manage_atoms, check_hr_exe, manage_tolerance\r\n+=item :ALL is manageAtomsConf manage_atoms_and_ranges check_hr_exe manage_tolerance manage_mode config_hr_exe\r\n \r\n =back\r\n \r\n@@ -773,6 +797,6 @@\n \r\n version 1 : 02 / 20 / 2014\r\n \r\n-version 2 : ??\r\n+version 2 : 02/ 15 / 2023 - Add personal max value for each atom manager methods, remove deprecated methods\r\n \r\n =cut\n\\ No newline at end of file\n'
b
diff -r 23970530a518 -r 78afd7f439f3 test-data/input06.tabular
--- /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
b
diff -r 23970530a518 -r 78afd7f439f3 test-data/out6.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/out6.html Wed Feb 15 15:57:49 2023 +0000
b
@@ -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
b
diff -r 23970530a518 -r 78afd7f439f3 test-data/out6.tabular
--- /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