annotate lib/hr.pm @ 1:e2cbcf6fa22e draft

master branch Updating with tag :CI_COMMIT_TAG - - Fxx
author fgiacomoni
date Sun, 11 Dec 2022 17:16:43 +0000
parents 86296c048e46
children 23970530a518
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
1 package lib::hr ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
2
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
3 use strict;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
4 no strict "refs" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
5 use warnings ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
6 use Exporter ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
7 use threads ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
8 use HTML::Template ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
9 use Carp ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
10
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
11 use Data::Dumper ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
12
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
13 use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS);
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
14
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
15 our $VERSION = "1.0";
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
16 our @ISA = qw(Exporter);
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
17 our @EXPORT = qw( manage_atoms_and_ranges manage_atoms check_hr_exe manage_atom_and_range manage_tolerance manage_mode config_hr_exe );
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
18 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 )] );
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
19
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
20 =head1 NAME
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
21
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
22 lib::hr - A module for managing / launching hr binary (structure elucidation c++ progr)
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
23
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
24 =head1 SYNOPSIS
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
25
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
26 use lib::hr;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
27 my $object = lib::hr->new();
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
28 print $object->as_string;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
29
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
30 =head1 DESCRIPTION
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
31
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
32 This module does not really exist, it
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
33 was made for the sole purpose of
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
34 demonstrating how POD works.
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
35
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
36 =head1 METHODS
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
37
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
38 Methods are :
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
39
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
40 =head2 METHOD new
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
41
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
42 ## Description : new
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
43 ## Input : $self
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
44 ## Ouput : bless $self ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
45 ## Usage : new() ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
46
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
47 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
48
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
49 sub new {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
50 ## Variables
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
51 my $self={};
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
52 bless($self) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
53 return $self ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
54 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
55 ### END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
56
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
57 =head2 METHOD manage_atoms_and_ranges
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
58
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
59 ## Description : allow from an initial config to add or delete atoms and their range
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
60 ## Input : $atomsconfig, $atombasic, $atomsupp
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
61 ## Output : $atomcleanconfig
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
62 ## Usage : my ( $atomcleanconfig ) = manage_atoms_and_ranges ( $atomsconfig, $atombasic, $atomsupp ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
63
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
64 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
65 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
66 sub manage_atoms_and_ranges {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
67 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
68 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
69 my ( $atomsconfig, $CONF, $atombasic, $atomsupp ) = @_;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
70 my ( $atomcleanconfig ) = ( undef ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
71
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
72 # basic atoms case:
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
73 foreach my $atom ( (split(",", $atombasic )) ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
74 if ( exists $CONF->{$atom} ) { $atomsconfig->{$atom}{'max'} = $CONF->{$atom} ; }
1
e2cbcf6fa22e master branch Updating with tag :CI_COMMIT_TAG - - Fxx
fgiacomoni
parents: 0
diff changeset
75 else { print "*** $atom not recognized***\n" ; }
0
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
76 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
77
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
78 # suppl. atoms case
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
79 foreach my $atom ( (split(",", $atomsupp )) ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
80 print "*** $atom***\n" ;
1
e2cbcf6fa22e master branch Updating with tag :CI_COMMIT_TAG - - Fxx
fgiacomoni
parents: 0
diff changeset
81 if ( exists $atomsconfig->{$atom} ) { $atomsconfig->{$atom}{'max'} = $CONF->{'DEFAULT_MAX'} ; }
e2cbcf6fa22e master branch Updating with tag :CI_COMMIT_TAG - - Fxx
fgiacomoni
parents: 0
diff changeset
82 else { print "*** $atom not recognized***\n" ; }
e2cbcf6fa22e master branch Updating with tag :CI_COMMIT_TAG - - Fxx
fgiacomoni
parents: 0
diff changeset
83
0
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
84 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
85
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
86 # Create atoms and range parameters:
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
87 foreach my $selectedAtom ( keys %{$atomsconfig} ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
88 $atomcleanconfig .= ' -'.$selectedAtom.' '.$atomsconfig->{$selectedAtom}{'min'}.'-'.$atomsconfig->{$selectedAtom}{'max'} ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
89 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
90
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
91 return ($atomcleanconfig) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
92 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
93 ### END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
94
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
95
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
96
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
97 =head2 METHOD manage_atoms ### DEPRECATED
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
98
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
99 ## Description : controles atoms input list and prepare it like hr binary parameter
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
100 ## Input : $input_atoms, $conf_atoms
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
101 ## Output : $hr_atoms_param
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
102 ## Usage : my ( $hr_atoms_param ) = manage_atoms( $input_atoms, $conf_atoms ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
103 ### DEPRECATED
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
104
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
105 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
106 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
107 sub manage_atoms { ### DEPRECATED
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
108 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
109 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
110 my ( $input_atoms, $conf_atoms ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
111 my $hr_atoms_param = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
112
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
113 if ( ( defined $$input_atoms ) and ( defined $$conf_atoms ) ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
114 if ( ( $$input_atoms eq 'None' ) or ( $$input_atoms eq '' ) or ( $$input_atoms eq ' ' ) ) { $hr_atoms_param = $$conf_atoms ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
115 elsif ( $$input_atoms =~ /[P|S|F|L|K|B|A|1|,]+/ ) { $hr_atoms_param = $$conf_atoms.','.$$input_atoms ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
116 else { $hr_atoms_param = $$conf_atoms ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
117 } ## END IF
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
118 elsif ( !defined $$input_atoms ) { $hr_atoms_param = $$conf_atoms ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
119 elsif ( !defined $$conf_atoms ) { warn "hr module can't manage any atom list (undef values in conf)\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
120 else { warn "hr module musn't manage any atom list\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
121
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
122 return(\$hr_atoms_param) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
123 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
124 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
125
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
126 =head2 METHOD manage_atom_and_range ### DEPRECATED
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
127
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
128 ## Description : build atom range with defined value in conf file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
129 ## Input : $atom, $min, $max
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
130 ## Output : $hr_range
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
131 ## Usage : my ( ) = manage_atom_and_range( $atom, $min, $max ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
132 ### DEPRECATED
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
133
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
134 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
135 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
136 sub manage_atom_and_range { ### DEPRECATED
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
137 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
138 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
139 my ( $atom, $min, $max ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
140 my $hr_range = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
141
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
142 if ( ( defined $$atom ) and ( defined $$min ) and ( defined $$max ) ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
143 ## manage ragne like "-C 0-200"
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
144 $hr_range = ' -'.$$atom.' '.$$min.'-'.$$max ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
145 } ## END IF
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
146 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
147 warn "Some argvts are missing to build the current atom range line\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
148 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
149 return(\$hr_range) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
150 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
151 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
152
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
153 =head2 METHOD manage_tolerance
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
154
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
155 ## Description : check range and format of tolerance
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
156 ## Input : $tolerance, $default_value
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
157 ## Output : $set_tol
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
158 ## Usage : my ( $set_tol ) = manage_tolerance( $tolerance, $default_value ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
159
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
160 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
161 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
162 sub manage_tolerance {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
163 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
164 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
165 my ( $tolerance, $default_value ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
166 my ($set_tol, $tmp_tol ) = (undef, undef) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
167
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
168 if ( ( defined $$tolerance ) and ( defined $$default_value )) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
169 $tmp_tol = $$tolerance ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
170 $tmp_tol =~ tr/,/./;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
171 ## tolerance doit etre >0 et <10
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
172 if ( $tmp_tol <= 0 || $tmp_tol >= 10 ){
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
173 $set_tol = $$default_value ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
174 warn "The used tolerance is set to $$default_value (out of authorized range)\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
175 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
176 else{ $set_tol = $tmp_tol ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
177 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
178 else { warn "Your tolerance or the default tol are not defined\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
179
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
180 return(\$set_tol) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
181 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
182 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
183
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
184 =head2 METHOD manage_mode
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
185
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
186 ## Description : manage mode and apply mass correction (positive/negative/neutral)
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
187 ## Input : $mode, $charge, $electron, $proton, $mass
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
188 ## Output : $exact_mass
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
189 ## Usage : my ( $exact_mass ) = manage_mode( $mode, $charge, $electron, $proton, $mass ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
190
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
191 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
192 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
193 sub manage_mode {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
194 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
195 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
196 my ( $mode, $charge, $electron, $proton, $mass ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
197 my ($exact_mass, $tmp_mass) = ( undef, undef ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
198
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
199 ## some explanations :
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
200 # MS in + mode = adds H+ (proton) and molecule is positive : el+ => $charge = "positive"
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
201 # For HR, need to subtrack proton mz and to add electron mz (1 electron per charge) to the input mass which comes neutral!
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
202
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
203 if ( ( defined $$electron ) and ( defined $$proton ) ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
204 # check mass
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
205 if ( defined $$mass ) { $tmp_mass = $$mass ; $tmp_mass =~ tr/,/./ ; } # manage . and , in case of...
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
206 else { warn "No mass is defined\n" }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
207
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
208 # manage charge
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
209 if ( ( !defined $$charge ) || ($$charge < 0) ){ warn "Charge is not defined or value is less than zero\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
210
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
211 # set neutral mass in function of ms mode
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
212 if($$mode eq 'positive') { $exact_mass = ( $tmp_mass - $$proton + $$electron) * $$charge ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
213 elsif($$mode eq 'negative') { $exact_mass = ( $tmp_mass + $$proton - $$electron) * $$charge ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
214 elsif($$mode eq "neutral") { $exact_mass = $tmp_mass ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
215 else { warn "This mode doesn't exist : please select positive/negative or neutral mode\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
216 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
217 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
218 warn "Missing some parameter values (electron, neutron masses), please check your conf file\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
219 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
220 return(\$exact_mass) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
221 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
222 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
223
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
224 =head2 METHOD check_hr_exe
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
225
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
226 ## Description : permit to check the path of hr.exe and its full availability
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
227 ## Input : $hr_path, $hr_version
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
228 ## Output : true/false
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
229 ## Usage : my ( $res ) = check_hr_exe( $hr_path, $hr_version ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
230
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
231 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
232 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
233 sub check_hr_exe {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
234 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
235 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
236 my ( $hr_path, $hr_version ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
237 my $success = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
238 my $check_res = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
239
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
240 ## test path :
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
241 if ( ( defined $$hr_path ) and ( defined $$hr_version ) ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
242 if ( defined $$hr_path ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
243 $success = `$$hr_path -version`;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
244 print "$success\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
245 if ($success !~/^$$hr_version/) { warn "You do not use the expected version of hr2 ($$hr_version)\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
246 else { $check_res = 1 ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
247 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
248 else { warn "Can't use HR because the binary file doesn't exist at the specified path ($$hr_path)\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
249
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
250 } ## END IF
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
251 else { warn "No HR path or Hr version defined\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
252
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
253 return($check_res) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
254 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
255 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
256
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
257 =head2 METHOD config_hr_exe
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
258
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
259 ## Description : builds hr execute line with needed params
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
260 ## Input : $hr_path, $hr_delta, $mass, $has_goldenrules, $atoms_and_ranks
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
261 ## Output : var2
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
262 ## Usage : my ( var2 ) = config_hr_exe( $hr_path, $hr_delta, $mass, $has_goldenrules, $atoms_and_ranks ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
263
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
264 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
265 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
266 sub config_hr_exe {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
267 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
268 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
269 my ( $hr_path, $hr_delta, $mass, $has_goldenrules, $atoms_and_ranks ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
270 my $hr_cmd = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
271
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
272 if ( ( defined $$hr_path ) and ( defined $$hr_delta ) and ( defined $$mass ) and ( defined $$atoms_and_ranks ) ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
273 $hr_cmd = $$hr_path.' -t '.$$hr_delta.' -m '.$$mass.' '.$$atoms_and_ranks ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
274 if ( defined $$has_goldenrules ) { $$hr_cmd .= ' -g ' ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
275 } ## END IF
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
276 else { warn "Some argvts are missing to build the current hr exec line\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
277
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
278 return(\$hr_cmd) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
279 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
280 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
281
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
282 =head2 METHOD threading_hr_exe
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
283
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
284 ## Description : prepare 5 threads for hr executing
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
285 ## Input : $method, $list
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
286 ## Output : $results
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
287 ## Usage : my ( $results ) = threading_hr_exe( $method, $list ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
288
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
289 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
290 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
291 sub threading_hr_exe {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
292 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
293 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
294 my ( $method, $list ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
295
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
296 my @results = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
297
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
298 if ( ( defined $list ) and ( defined $method )) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
299
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
300 for (my $i = 0; $i < (scalar @{$list}); $i+=6 ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
301 my $thr1 = threads->create($method, $self, $list->[$i]) if $list->[$i] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
302 my $thr2 = threads->create($method, $self, $list->[$i+1]) if $list->[$i+1] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
303 my $thr3 = threads->create($method, $self, $list->[$i+2]) if $list->[$i+2] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
304 my $thr4 = threads->create($method, $self, $list->[$i+3]) if $list->[$i+3] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
305 my $thr5 = threads->create($method, $self, $list->[$i+4]) if $list->[$i+4] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
306 my $thr6 = threads->create($method, $self, $list->[$i+5]) if $list->[$i+5] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
307 push ( @results, $thr1->join ) if $list->[$i] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
308 push ( @results, $thr2->join ) if $list->[$i+1] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
309 push ( @results, $thr3->join ) if $list->[$i+2] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
310 push ( @results, $thr4->join ) if $list->[$i+3] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
311 push ( @results, $thr5->join ) if $list->[$i+4] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
312 push ( @results, $thr6->join ) if $list->[$i+5] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
313 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
314 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
315 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
316 warn "Your input list or your method is undefined\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
317 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
318
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
319 return(\@results) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
320 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
321 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
322
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
323 =head2 METHOD hr_exe
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
324
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
325 ## Description : hr_exe launches hr and catches result
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
326 ## Input : $cmd
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
327 ## Output : $res
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
328 ## Usage : my ( $res ) = hr_exe( $cmd ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
329
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
330 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
331 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
332 sub hr_exe {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
333 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
334 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
335 my ( $cmd ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
336 my $res = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
337
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
338 if (defined $cmd){
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
339 #print "\n--CMD used : $cmd\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
340 $res = `$cmd` ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
341 sleep(0.5) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
342 #print "Results : $res\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
343 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
344
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
345 return (\$res) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
346 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
347 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
348
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
349
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
350 =head2 METHOD hr_out_parser
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
351
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
352 ## Description : parse output of hr and return a hash of features
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
353 ## Input : $res
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
354 ## Output : $parsed_res
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
355 ## Usage : my ( $parsed_res ) = hr_out_parser( $res ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
356
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
357 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
358 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
359 sub hr_out_parser {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
360 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
361 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
362 my ( $res ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
363
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
364 my %parsed_res = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
365 my ( @formula, @rings_and_double_bond_equivalents, @formula_mz, @mmus ) = ( (), (), (), () ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
366 my ( $formula_nb, $formula_total, $time ) = ( undef, undef, undef ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
367
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
368 if ( defined $$res ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
369 # foreach line
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
370 foreach my $line (split(/\n/,$$res)){
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
371 ## v1.02 - parse result line "C7.H17.N5. 2.0 171.1484 +17.2 mmu"
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
372 ## v1.03 - parse result line "C10.H25.N5.O5.P2.S2. C10H25N5O5P2S2 8.00 421.0772333 0 0 +0.40"
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
373 ## $1 = "C10.H25.N5.O5.P2.S2. " $2 = "C10H25N5O5P2S2" $3 = "8.00" $4="421.0772333" $5="0" $6="0" $7="+0.40"
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
374 ## if ( $line =~ /([\w|\.]+)\s+(\d+.?\d*)\s+(\d+.?\d*)\s+([+|-]\d+.?\d*)\s+(.*)/ ) { ## for hr2 1.02
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
375
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
376 if ( $line =~ /([\w|\.]+)\s+(\w+)\s+(\d+.?\d*)\s+(\d+.?\d*)\s+(\d+.?\d*)\s+(\d+.?\d*)\s+([+|-]\d+.?\d*)/ ) { # for hr2 1.03
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
377 my ( $formula, $cleanformula, $rings_and_double_bond_equivalent, $formula_mz, $abscharge, $nadd, $mmu_value ) = ( $1, $2, $3, $4, $5, $6, $7 ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
378
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
379 if (defined $formula ) { $formula =~ s/\.//g ; push (@formula, $formula) ; } # clean \.
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
380 if (defined $rings_and_double_bond_equivalent ) { push (@rings_and_double_bond_equivalents, $rings_and_double_bond_equivalent) ; } #
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
381 if (defined $formula_mz ) { push (@formula_mz, $formula_mz) ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
382 if (defined $mmu_value ) { $mmu_value =~ s/\+// ; push (@mmus, $mmu_value) ; } # clean (+)
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
383 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
384 elsif ( $line =~ /(\d+)\s+formulas.+\s+(\d+)\s+seconds.+\s+(\d+)\s+formulae/ ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
385 ( $formula_nb, $time, $formula_total ) = ( $1, $2, $3 ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
386 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
387 else { next; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
388 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
389 # build parser
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
390 if ( scalar(@formula) > 0 ){
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
391 $parsed_res{'ENTRY_FORMULA'} = \@formula ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
392 $parsed_res{'rings_and_double_bond_equivalents'} = \@rings_and_double_bond_equivalents ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
393 $parsed_res{'ENTRY_CPD_MZ'} = \@formula_mz ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
394 $parsed_res{'ENTRY_DELTA'} = \@mmus ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
395 $parsed_res{'MASSES_TOTAL'} = \$formula_nb ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
396 $parsed_res{'time'} = \$time ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
397 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
398 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
399 return(\%parsed_res) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
400 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
401 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
402
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
403
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
404 =head2 METHOD set_html_tbody_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
405
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
406 ## Description : initializes and build the tbody object (perl array) need to html template
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
407 ## Input : $nb_pages, $nb_items_per_page
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
408 ## Output : $tbody_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
409 ## Usage : my ( $tbody_object ) = set_html_tbody_object($nb_pages, $nb_items_per_page) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
410
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
411 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
412 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
413 sub set_html_tbody_object {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
414 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
415 my ( $nb_pages, $nb_items_per_page ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
416
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
417 my ( @tbody_object ) = ( ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
418
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
419 for ( my $i = 1 ; $i <= $nb_pages ; $i++ ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
420
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
421 my %pages = (
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
422 # tbody feature
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
423 PAGE_NB => $i,
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
424 MASSES => [], ## end MASSES
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
425 ) ; ## end TBODY N
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
426 push (@tbody_object, \%pages) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
427 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
428 return(\@tbody_object) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
429 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
430 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
431
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
432 =head2 METHOD add_mz_to_tbody_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
433
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
434 ## Description : initializes and build the mz object (perl array) need to html template
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
435 ## Input : $tbody_object, $nb_items_per_page, $mz_list
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
436 ## Output : $tbody_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
437 ## Usage : my ( $tbody_object ) = add_mz_to_tbody_object( $tbody_object, $nb_items_per_page, $mz_list ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
438
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
439 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
440 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
441 sub add_mz_to_tbody_object {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
442 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
443 my ( $tbody_object, $nb_items_per_page, $mz_list, $ids_list, $totals ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
444
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
445 my ( $current_page, $mz_index ) = ( 0, 0 ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
446
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
447 foreach my $page ( @{$tbody_object} ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
448
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
449 my @colors = ('white', 'green') ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
450 my ( $current_index, , $icolor ) = ( 0, 0 ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
451
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
452 for ( my $i = 1 ; $i <= $nb_items_per_page ; $i++ ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
453 #
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
454 if ( $current_index > $nb_items_per_page ) { ## manage exact mz per html page
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
455 $current_index = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
456 last ; ##
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
457 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
458 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
459 $current_index++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
460 if ( $icolor > 1 ) { $icolor = 0 ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
461
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
462 if ( exists $mz_list->[$mz_index] ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
463 my $total = \0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
464 if ( $totals->[$mz_index]{'MASSES_TOTAL'} ) { $total = $totals->[$mz_index]{'MASSES_TOTAL'} }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
465
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
466 my %mz = (
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
467 # mass feature
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
468 MASSES_ID_QUERY => $ids_list->[$mz_index],
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
469 MASSES_MZ_QUERY => $mz_list->[$mz_index],
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
470 MZ_COLOR => $colors[$icolor],
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
471 MASSES_NB => $mz_index+1,
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
472 MASSES_TOTAL => $$total ,
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
473 ENTRIES => [] ,
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
474 ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
475 push ( @{ $tbody_object->[$current_page]{MASSES} }, \%mz ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
476 # Html attr for mass
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
477 $icolor++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
478 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
479 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
480 $mz_index++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
481 } ## foreach mz
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
482
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
483 $current_page++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
484 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
485 return($tbody_object) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
486 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
487 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
488
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
489 =head2 METHOD add_entries_to_tbody_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
490
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
491 ## Description : initializes and build the mz object (perl array) need to html template
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
492 ## Input : $tbody_object, $nb_items_per_page, $mz_list, $entries
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
493 ## Output : $tbody_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
494 ## Usage : my ( $tbody_object ) = add_entries_to_tbody_object( $tbody_object, $nb_items_per_page, $mz_list, $entries ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
495
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
496 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
497 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
498 sub add_entries_to_tbody_object {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
499 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
500 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
501 my ( $tbody_object, $results ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
502
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
503 my $index_page = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
504 my $index_mz_continous = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
505
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
506 foreach my $page (@{$tbody_object}) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
507
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
508 my $index_mz = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
509
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
510 foreach my $mz (@{ $tbody_object->[$index_page]{MASSES} }) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
511
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
512 my $index_res = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
513 if ( $results->[$index_mz_continous]{ENTRY_FORMULA} ){
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
514
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
515 my $entry_nb = scalar( @{ $results->[$index_mz_continous]{ENTRY_FORMULA} } ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
516 for( my $i = 0 ; $i<$entry_nb; $i++ ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
517 my %entry = (
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
518 ENTRY_COLOR => $tbody_object->[$index_page]{MASSES}[$index_mz]{MZ_COLOR},
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
519 ENTRY_FORMULA => $results->[$index_mz_continous]->{ENTRY_FORMULA}[$i],
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
520 ENTRY_CPD_MZ => $results->[$index_mz_continous]->{ENTRY_CPD_MZ}[$i],
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
521 ENTRY_DELTA => $results->[$index_mz_continous]->{ENTRY_DELTA}[$i]
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
522 ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
523 push ( @{ $tbody_object->[$index_page]{MASSES}[$index_mz]{ENTRIES} }, \%entry) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
524 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
525 $index_res++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
526 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
527 $index_mz ++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
528 $index_mz_continous ++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
529 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
530 $index_page++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
531 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
532 return($tbody_object) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
533 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
534 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
535
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
536 =head2 METHOD write_html_skel
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
537
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
538 ## Description : prepare and write the html output file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
539 ## Input : $html_file_name, $html_object, $html_template
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
540 ## Output : $html_file_name
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
541 ## Usage : my ( $html_file_name ) = write_html_skel( $html_file_name, $html_object ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
542
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
543 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
544 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
545 sub write_html_skel {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
546 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
547 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
548 my ( $html_file_name, $html_object, $pages , $search_condition, $html_template, $js_path, $css_path ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
549
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
550 my $html_file = $$html_file_name ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
551
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
552 if ( defined $html_file ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
553 open ( HTML, ">$html_file" ) or die "Can't create the output file $html_file " ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
554
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
555 if (-e $html_template) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
556 my $ohtml = HTML::Template->new(filename => $html_template);
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
557 $ohtml->param( JS_GALAXY_PATH => $js_path, CSS_GALAXY_PATH => $css_path ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
558 $ohtml->param( CONDITIONS => $search_condition ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
559 $ohtml->param( PAGES_NB => $pages ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
560 $ohtml->param( PAGES => $html_object ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
561 print HTML $ohtml->output ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
562 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
563 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
564 croak "Can't fill any html output : No template available ($html_template)\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
565 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
566
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
567 close (HTML) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
568 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
569 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
570 croak "No output file name available to write HTML file\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
571 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
572 return(\$html_file) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
573 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
574 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
575
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
576 =head2 METHOD write_csv_one_mass
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
577
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
578 ## Description : print a csv file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
579 ## Input : $masses, $ids, $results, $file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
580 ## Output : N/A
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
581 ## Usage : write_csv_one_mass( $ids, $results, $file ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
582
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
583 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
584 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
585 sub write_csv_one_mass {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
586 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
587 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
588 my ( $masses, $ids, $results, $file, ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
589
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
590 open(CSV, '>:utf8', "$file") or die "Cant' create the file $file\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
591 print CSV "ID\tMASS_SUBMIT\tCPD_FORMULA\tCPD_MW\tDELTA\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
592
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
593 my $i = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
594
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
595 foreach my $id (@{$ids}) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
596 my $mass = $masses->[$i] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
597
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
598 if ( $results->[$i] ) { ## an requested id has a result in the list of hashes $results.
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
599
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
600 my $entry_nb = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
601
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
602 ## in case of no results -- Hr_parsed Results : $VAR1 = [ { 'ENTRY_FORMULA' => [] } ];
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
603 if ( !$results->[$i]{'ENTRY_FORMULA'} ) { print CSV "$id\t$mass\tN/A\t0.0\t0.0\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
604
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
605 foreach (@{$results->[$i]{'ENTRY_FORMULA'}}) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
606
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
607 print CSV "$id\t$mass\t" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
608 ## print cpd formula
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
609 if ( $results->[$i]{'ENTRY_FORMULA'}[$entry_nb] ) { print CSV "$results->[$i]{'ENTRY_FORMULA'}[$entry_nb]\t" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
610 else { print CSV "N/A\t" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
611 ## print cpd name
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
612 if ( $results->[$i]{'ENTRY_CPD_MZ'}[$entry_nb] ) { print CSV "$results->[$i]{'ENTRY_CPD_MZ'}[$entry_nb]\t" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
613 else { print CSV "0.0\t" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
614 ## print delta
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
615 if ( $results->[$i]{'ENTRY_DELTA'}[$entry_nb] ) { print CSV "$results->[$i]{'ENTRY_DELTA'}[$entry_nb]\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
616 else { print CSV "0.0\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
617 $entry_nb++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
618 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
619 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
620 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
621 print CSV "$id\t$mass\tN/A\t0.0\t0.0\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
622 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
623 $i++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
624 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
625 close(CSV) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
626 return() ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
627 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
628 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
629
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
630 =head2 METHOD add_hr_matrix_to_input_matrix
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
631
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
632 ## Description : build a full matrix (input + lm column)
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
633 ## Input : $input_matrix_object, $lm_matrix_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
634 ## Output : $output_matrix_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
635 ## Usage : my ( $output_matrix_object ) = add_hr_matrix_to_input_matrix( $input_matrix_object, $hr_matrix_object ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
636
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
637 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
638 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
639 sub add_hr_matrix_to_input_matrix {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
640 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
641 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
642 my ( $input_matrix_object, $hr_matrix_object ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
643
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
644 my @output_matrix_object = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
645 my $index_row = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
646
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
647 foreach my $row ( @{$input_matrix_object} ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
648 my @init_row = @{$row} ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
649
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
650 if ( $hr_matrix_object->[$index_row] ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
651 my $dim = scalar(@{$hr_matrix_object->[$index_row]}) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
652
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
653 if ($dim > 1) { warn "the add method can't manage more than one column\n" ;}
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
654 my $lm_col = $hr_matrix_object->[$index_row][$dim-1] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
655
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
656 push (@init_row, $lm_col) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
657 $index_row++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
658 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
659 push (@output_matrix_object, \@init_row) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
660 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
661 return(\@output_matrix_object) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
662 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
663 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
664
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
665 =head2 METHOD write_csv_skel
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
666
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
667 ## Description : prepare and write csv output file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
668 ## Input : $csv_file, $rows
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
669 ## Output : $csv_file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
670 ## Usage : my ( $csv_file ) = write_csv_skel( $csv_file, $rows ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
671
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
672 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
673 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
674 sub write_csv_skel {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
675 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
676 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
677 my ( $csv_file, $rows ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
678
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
679 my $ocsv = lib::csv::new() ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
680 my $csv = $ocsv->get_csv_object("\t") ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
681 $ocsv->write_csv_from_arrays($csv, $$csv_file, $rows) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
682
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
683 return($csv_file) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
684 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
685 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
686
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
687 =head2 METHOD set_hr_matrix_object
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
688
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
689 ## Description : build the hr_row under its ref form
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
690 ## Input : $header, $init_mzs, $entries
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
691 ## Output : $hr_matrix
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
692 ## Usage : my ( $hmdb_matrix ) = set_hr_matrix_object( $header, $init_mzs, $entries ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
693
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
694 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
695 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
696 sub set_hr_matrix_object {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
697 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
698 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
699 my ( $header, $init_mzs, $entries ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
700
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
701 my @hr_matrix = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
702
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
703 if ( defined $header ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
704 my @headers = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
705 push @headers, $header ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
706 push @hr_matrix, \@headers ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
707 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
708
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
709 my $index_mz = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
710
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
711 foreach my $mz ( @{$init_mzs} ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
712
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
713 my $index_entries = 0 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
714 my @clusters = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
715 my $cluster_col = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
716
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
717 my $nb_entries = $entries->[$index_mz]{MASSES_TOTAL} ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
718
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
719 foreach (@{$entries->[$index_mz]{'ENTRY_FORMULA'}}) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
720
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
721 my $delta = $entries->[$index_mz]{'ENTRY_DELTA'}[$index_entries] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
722 my $hr_formula = $entries->[$index_mz]{'ENTRY_FORMULA'}[$index_entries] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
723 my $hr_mz = $entries->[$index_mz]{'ENTRY_CPD_MZ'}[$index_entries] ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
724
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
725
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
726 ## METLIN data display model
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
727 ## entry1=VAR1::VAR2::VAR3::VAR4|entry2=VAR1::VAR2::VAR3::VAR4|...
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
728 # manage final pipe
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
729 if ($index_entries < $$nb_entries-1 ) { $cluster_col .= $delta.'::('.$hr_formula.')::'.$hr_mz.'|' ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
730 else { $cluster_col .= $delta.'::('.$hr_formula.')::'.$hr_mz ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
731
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
732 $index_entries++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
733 } ## end foreach
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
734 if ( !defined $cluster_col ) { $cluster_col = 'No_result_found_with HR' ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
735 push (@clusters, $cluster_col) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
736 push (@hr_matrix, \@clusters) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
737 $index_mz++ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
738 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
739 return(\@hr_matrix) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
740 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
741 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
742
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
743
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
744
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
745 1 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
746
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
747
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
748 __END__
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
749
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
750 =head1 SUPPORT
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
751
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
752 You can find documentation for this module with the perldoc command.
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
753
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
754 perldoc hr.pm
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
755
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
756 =head1 Exports
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
757
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
758 =over 4
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
759
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
760 =item :ALL is manage_atoms, check_hr_exe, manage_tolerance
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
761
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
762 =back
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
763
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
764 =head1 AUTHOR
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
765
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
766 Franck Giacomoni E<lt>franck.giacomoni@clermont.inra.frE<gt>
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
767
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
768 =head1 LICENSE
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
769
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
770 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
771
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
772 =head1 VERSION
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
773
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
774 version 1 : 02 / 20 / 2014
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
775
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
776 version 2 : ??
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
777
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
778 =cut