annotate wsdl_hmdb.pl @ 17:49f87ddb2c78 draft

Master branch Updating - - Fxx
author fgiacomoni
date Wed, 23 Jan 2019 02:57:07 -0500
parents 8b2fbd449ffd
children f8c8a990688a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
1 #!perl
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
2
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
3 ## script : wsdl_hmdb.pl
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
4 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
5 # Included modules and versions
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
6 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
7 ## Perl modules
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
8 use strict ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
9 use warnings ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
10 use Carp qw (cluck croak carp) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
11
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
12 use Data::Dumper ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
13 use Getopt::Long ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
14 use POSIX ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
15 use FindBin ; ## Permet de localisez le repertoire du script perl d'origine
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
16
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
17 ## Specific Modules (Home made...)
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
18 use lib $FindBin::Bin ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
19 my $binPath = $FindBin::Bin ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
20 use lib::hmdb qw( :ALL ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
21 ## PFEM Perl Modules
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
22 use lib::conf qw( :ALL ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
23 use lib::csv qw( :ALL ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
24
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
25 ## Initialized values
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
26 my ( $help ) = undef ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
27 my ( $mass ) = undef ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
28 my ( $masses_file, $col_id, $col_mass, $header_choice, $nbline_header ) = ( undef, undef, undef, undef, undef ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
29 my $max_query = undef ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
30 my ( $delta, $molecular_species, $out_tab, $out_html, $out_xls ) = ( undef, undef, undef, undef, undef ) ;
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
31 my $advancedFeatures = 0 ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
32 my $VERBOSE = ( 3 ) ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
33
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
34
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
35 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
36 # Manage EXCEPTIONS
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
37 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
38
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
39 &GetOptions ( "h" => \$help, # HELP
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
40 "mass:s" => \$mass, ## option : one masse
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
41 "masses:s" => \$masses_file, ## option : path to the input
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
42 "header_choice:s" => \$header_choice, ## Presence or not of header in tabular file
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
43 "nblineheader:i" => \$nbline_header, ## numbre of header line present in file
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
44 "colfactor:i" => \$col_mass, ## Column id for retrieve formula list in tabular file
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
45 "delta:f" => \$delta,
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
46 "mode:s" => \$molecular_species, ## Molecular species (positive/negative/neutral)
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
47 "maxquery:i" => \$max_query, ## Maximum query return (default is 20 entries by query // min 1 & max 50 )
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
48 "output_tabular:s" => \$out_tab, ## option : path to the ouput (tabular : input+results )
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
49 "output_html|v:s" => \$out_html, ## option : path to the results view (output2)
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
50 "output_xlsx:s" => \$out_xls, ## option : path to the xls-like format output
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
51 "advancedFeatures:s"=> \$advancedFeatures, ## option : set to 1 to get advanced options or 0 to get first level only.
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
52 "verbose:i" => \$VERBOSE, ## VERBOSE Of the tool
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
53 ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
54
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
55 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
56 # EXCEPTIONS
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
57 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
58 $help and &help ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
59
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
60 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
61 # MAIN SCRIPT
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
62 #=============================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
63
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
64 print "* * * The hmdb client program is launched: * * *\n" if ($VERBOSE>1) ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
65
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
66 ## -------------- Conf file ------------------------ :
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
67 my ( $CONF ) = ( undef ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
68 foreach my $conf ( <$binPath/*.cfg> ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
69 my $oConf = lib::conf::new() ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
70 $CONF = $oConf->as_conf($conf) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
71 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
72
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
73 ## -------------- HTML template file ------------------------ :
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
74 foreach my $html_template ( <$binPath/*.tmpl> ) { $CONF->{'HTML_TEMPLATE'} = $html_template ; }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
75
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
76 if (!defined $max_query) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
77 $max_query = $CONF->{'HMDB_MAX_QUERY'} ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
78 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
79
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
80
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
81 ## --------------- Global parameters ---------------- :
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
82 my ( $ids, $masses, $results ) = ( undef, undef, undef ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
83 my ( $complete_rows, $nb_pages_for_html_out ) = ( undef, 1 ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
84 my $metabocard_features = undef ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
85 my $search_condition = "Search params : Molecular specie = $molecular_species / delta (mass-to-charge ratio) = $delta" ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
86
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
87 print "\t with $search_condition\n" if ($VERBOSE>1) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
88
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
89 ## --------------- retrieve input data -------------- :
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
90
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
91 ## manage only one mass
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
92 if ( ( defined $mass ) and ( $mass ne '' ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
93 my @masses = split(" ", $mass);
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
94 $masses = \@masses ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
95 for (my $i=1 ; $i<=$#masses+1 ; $i++){ push (@$ids,"mz_0".sprintf("%04s", $i ) ); }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
96 } ## END IF
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
97 ## manage csv file containing list of masses
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
98 elsif ( ( defined $masses_file ) and ( $masses_file ne "" ) and ( -e $masses_file ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
99 ## parse all csv for later : output csv build
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
100 my $ocsv_input = lib::csv->new() ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
101 my $complete_csv = $ocsv_input->get_csv_object( "\t" ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
102 $complete_rows = $ocsv_input->parse_csv_object($complete_csv, \$masses_file) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
103
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
104 ## parse masses and set ids
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
105 my $ocsv = lib::csv->new() ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
106 my $csv = $ocsv->get_csv_object( "\t" ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
107 if ( ( !defined $nbline_header ) or ( $nbline_header < 0 ) ) { $nbline_header = 0 ; }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
108 $masses = $ocsv->get_value_from_csv_multi_header( $csv, $masses_file, $col_mass, $header_choice, $nbline_header ) ; ## retrieve mz values on csv
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
109 my $nbmz = @$masses ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
110 for (my $i=1 ; $i<=$nbmz+1 ; $i++){ push (@$ids,"mz_0".sprintf("%04s", $i ) ); }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
111 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
112 else {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
113 warn "[warning] Input data are missing : none mass or file of masses\n" ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
114 &help ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
115 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
116 #print Dumper $masses ;
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
117
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
118 ## ---------------- launch queries -------------------- :
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
119
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
120 if ( ( defined $delta ) and ( $delta > 0 ) and ( defined $molecular_species ) and ( $molecular_species ne '' ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
121 ## prepare masses list and execute query
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
122 my $oHmdb = lib::hmdb::new() ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
123 my $hmdb_pages = undef ;
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
124 my $status = undef ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
125 my $hmdb_ids = undef ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
126
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
127 $results = [] ; # prepare arrays ref
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
128 my $submasses = $oHmdb->extract_sub_mz_lists($masses, $CONF->{HMDB_LIMITS} ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
129
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
130 print "\t and ".scalar(@$masses)." masses are submitted as ".scalar(@$submasses)." queries to HMDB \n\n" if ($VERBOSE>1) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
131
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
132 ## get the hmdb server status by a test query - continuous queries or kill script.
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
133 $status = $oHmdb->test_matches_from_hmdb_ua() ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
134 $oHmdb->check_state_from_hmdb_ua($status) ; ## can kill the script execution
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
135
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
136 my $cluster = 1 ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
137 foreach my $mzs ( @{$submasses} ) {
10
4eb2de7c24d1 Master branch Updating - - Fxx
fgiacomoni
parents: 8
diff changeset
138 # print Dumper $mzs ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
139 my $result = undef ;
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
140
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
141 my ( $hmdb_masses, $nb_masses_to_submit ) = $oHmdb->prepare_multi_masses_query($mzs) ;
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
142
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
143 print "\t Submission of m/z cluster ".sprintf '%04s',$cluster."" if ($VERBOSE>1) ;
14
625fa968d99a Master branch Updating - - Fxx
fgiacomoni
parents: 10
diff changeset
144
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
145 ($hmdb_pages, $status) = $oHmdb->get_matches_from_hmdb_ua($hmdb_masses, $delta, $molecular_species) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
146 print "...HMDB reply results with status: $status\n" if ($VERBOSE>1) ;
14
625fa968d99a Master branch Updating - - Fxx
fgiacomoni
parents: 10
diff changeset
147
16
8b2fbd449ffd Master branch Updating - - Fxx
fgiacomoni
parents: 15
diff changeset
148 # print Dumper $hmdb_pages ;
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
149
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
150 sleep(1) ;
14
625fa968d99a Master branch Updating - - Fxx
fgiacomoni
parents: 10
diff changeset
151
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
152 ($result) = $oHmdb->parse_hmdb_csv_results($hmdb_pages, $mzs, $max_query) ; ## hash format result
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
153 ## This previous step return results with cutoff on the number of entries returned !
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
154 $results = [ @$results, @$result ] ;
14
625fa968d99a Master branch Updating - - Fxx
fgiacomoni
parents: 10
diff changeset
155
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
156 # sleep(1) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
157 $cluster ++ ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
158 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
159
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
160 ## Add more information of each found metabolite (1 for extra or 0 by default)
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
161 if ($advancedFeatures > 0) {
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
162
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
163 ## foreach metabolite get its own metabocard
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
164 $hmdb_ids = $oHmdb->get_unik_ids_from_results($results) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
165
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
166 print "\tComplementary annotation: asking for ".scalar(@$hmdb_ids)."metabocards\n" if ($VERBOSE>1) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
167
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
168 # $hmdb_ids->{'HMDB03125'} = 1 ,
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
169 $metabocard_features = $oHmdb->get_hmdb_metabocard_from_id($hmdb_ids, $CONF->{'HMDB_METABOCARD_URL'}) ; ## Try to multithread the querying
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
170 # print Dumper $results ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
171 # print Dumper $hmdb_ids ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
172 # print Dumper $metabocard_features ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
173 ## Map metabocards with results (add supplementary data)
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
174 if ( ( defined $results ) and ( defined $metabocard_features ) ) {
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
175 $results = $oHmdb->map_suppl_data_on_hmdb_results($results, $metabocard_features) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
176 }
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
177 }
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
178 else {
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
179 print "\tNo complementary annotation asked\n" if ($VERBOSE>1) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
180 ## Fill with msg not asked advanced annotation
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
181 $results = $oHmdb->map_suppl_data_on_hmdb_results($results, undef) ;
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
182 }
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
183
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
184
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
185
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
186 ## Uses N mz and theirs entries per page (see config file).
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
187 # how many pages you need with your input mz list?
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
188 $nb_pages_for_html_out = ceil( scalar(@{$masses} ) / $CONF->{HTML_ENTRIES_PER_PAGE} ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
189
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
190 # print Dumper $results ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
191 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
192 else {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
193 croak "Can't work with HMDB : missing paramaters (list of masses, delta or molecular species)\n" ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
194 } ## end ELSE
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
195
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
196 ## -------------- Produce HTML/CSV output ------------------ :
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
197 print "\n\tProducing html and tabular outputs\n" if ($VERBOSE>1) ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
198
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
199 if ( ( defined $out_html ) and ( defined $results ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
200 my $oHtml = lib::hmdb::new() ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
201 my ($tbody_object) = $oHtml->set_html_tbody_object( $nb_pages_for_html_out, $CONF->{HTML_ENTRIES_PER_PAGE} ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
202 ($tbody_object) = $oHtml->add_mz_to_tbody_object($tbody_object, $CONF->{HTML_ENTRIES_PER_PAGE}, $masses, $ids) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
203 ($tbody_object) = $oHtml->add_entries_to_tbody_object($tbody_object, $CONF->{HTML_ENTRIES_PER_PAGE}, $masses, $results) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
204 my $output_html = $oHtml->write_html_skel(\$out_html, $tbody_object, $nb_pages_for_html_out, $search_condition, $CONF->{'HTML_TEMPLATE'}, $CONF->{'JS_GALAXY_PATH'}, $CONF->{'CSS_GALAXY_PATH'}) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
205
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
206 } ## END IF
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
207 else {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
208 warn "Can't create a HTML output for HMDB : no result found or your output file is not defined\n" ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
209 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
210
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
211 if ( ( defined $out_tab ) and ( defined $results ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
212 # produce a csv based on METLIN format
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
213 my $ocsv = lib::hmdb::new() ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
214 if (defined $masses_file) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
215 my $lm_matrix = undef ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
216 if ( ( defined $nbline_header ) and ( $header_choice eq 'yes' ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
217 # $lm_matrix = $ocsv->set_lm_matrix_object('hmdb', $masses, $results ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
218 $lm_matrix = $ocsv->set_hmdb_matrix_object_with_ids('hmdb', $masses, $results ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
219 $lm_matrix = $ocsv->add_lm_matrix_to_input_matrix($complete_rows, $lm_matrix, $nbline_header-1) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
220 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
221 elsif ( ( $header_choice eq 'no' ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
222 # $lm_matrix = $ocsv->set_lm_matrix_object(undef, $masses, $results ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
223 $lm_matrix = $ocsv->set_hmdb_matrix_object_with_ids(undef, $masses, $results ) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
224 $lm_matrix = $ocsv->add_lm_matrix_to_input_matrix($complete_rows, $lm_matrix, 0) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
225 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
226 $ocsv->write_csv_skel(\$out_tab, $lm_matrix) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
227 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
228 elsif (defined $mass) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
229 $ocsv->write_csv_one_mass($masses, $ids, $results, $out_tab) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
230 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
231 } ## END IF
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
232 else {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
233 warn "Can't create a tabular output for HMDB : no result found or your output file is not defined\n" ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
234 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
235
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
236 ## Write XLS like format
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
237 if ( ( defined $out_xls ) and ( defined $results ) ) {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
238 my $ocsv = lib::hmdb::new() ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
239 $ocsv->write_csv_one_mass($masses, $ids, $results, $out_xls) ;
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
240 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
241
15
beb9619263b0 Master branch Updating - - Fxx
fgiacomoni
parents: 14
diff changeset
242 print "\n* * * The hmdb client program ended * * *\n" if ($VERBOSE>1) ;
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
243
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
244 #====================================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
245 # Help subroutine called with -h option
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
246 # number of arguments : 0
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
247 # Argument(s) :
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
248 # Return : 1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
249 #====================================================================================
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
250 sub help {
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
251 print STDERR "
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
252 help of wsdl_hmdb
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
253
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
254 # wsdl_hmdb is a script to query HMDB website using mz and return a list of candidates sent by HMDB based on the ms search tool.
4
6091a80df951 planemo upload commit e2dfb6f7afeeb7767ef83e9e2c3a2d3e6a94ae98
fgiacomoni
parents: 1
diff changeset
255 # Input : accurate mz or list of accurate masses
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
256 # Author : Franck Giacomoni and Marion Landi
4
6091a80df951 planemo upload commit e2dfb6f7afeeb7767ef83e9e2c3a2d3e6a94ae98
fgiacomoni
parents: 1
diff changeset
257 # Email : fgiacomoni\@inra.fr
17
49f87ddb2c78 Master branch Updating - - Fxx
fgiacomoni
parents: 16
diff changeset
258 # Version : 1.6
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
259 # Created : 08/07/2012
17
49f87ddb2c78 Master branch Updating - - Fxx
fgiacomoni
parents: 16
diff changeset
260 # Updated : 23/01/2019 - 1.6
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
261 USAGE :
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
262 wsdl_hmdb.pl -mass [one mass or a string list of exact masses] -delta [mz delta] -mode [molecular species: positive|negative|neutral] -output [output tabular file] -view [output html file]
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
263
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
264 or
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
265 wsdl_hmdb.pl -masses [an input file of mzs] -colfactor [col of mz] -header_choice [yes|no] -nblineheader [nb of lines containing file header : 0-n]
17
49f87ddb2c78 Master branch Updating - - Fxx
fgiacomoni
parents: 16
diff changeset
266 -delta [mz delta] -mode [molecular species: positive|negative|neutral] -output [output tabular file] -view [output html file]
49f87ddb2c78 Master branch Updating - - Fxx
fgiacomoni
parents: 16
diff changeset
267 -advancedFeatures [Default 0, set to 1 for advanced features as logp, inchi, ...]
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
268
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
269 or
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
270 wsdl_hmdb.pl -h for help
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
271
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
272 ";
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
273 exit(1);
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
274 }
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
275
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
276 ## END of script - F Giacomoni
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
277
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
278 __END__
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
279
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
280 =head1 NAME
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
281
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
282 wsdl_hmdb.pl -- script to query HMDB website using mz and return a list of candidates sent by HMDB based on the ms search tool.
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
283
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
284 =head1 USAGE
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
285
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
286 wsdl_hmdb.pl -mass [one mass or a string list of exact masses] -delta [mz delta] -mode [molecular species: positive|negative|neutral] -output [output tabular file] -view [output html file]
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
287
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
288 or
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
289 wsdl_hmdb.pl -masses [an input file of mzs] -colfactor [col of mz] -header_choice [yes|no] -nblineheader [nb of lines containing file header : 0-n]
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
290 -delta [mz delta] -mode [molecular species: positive|negative|neutral] -output [output tabular file] -view [output html file]
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
291
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
292 =head1 SYNOPSIS
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
293
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
294 This script manages batch queries on HMDB server.
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
295
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
296 =head1 DESCRIPTION
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
297
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
298 This main program is a script to query HMDB website using mz and return a list of candidates sent by HMDB based on the ms search tool.
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
299
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
300 =over 4
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
301
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
302 =item B<function01>
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
303
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
304 =item B<function02>
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
305
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
306 =back
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
307
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
308 =head1 AUTHOR
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
309
4
6091a80df951 planemo upload commit e2dfb6f7afeeb7767ef83e9e2c3a2d3e6a94ae98
fgiacomoni
parents: 1
diff changeset
310 Franck Giacomoni E<lt>franck.giacomoni@inra.frE<gt>
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
311
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
312 =head1 LICENSE
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
313
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
314 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
315
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
316 =head1 VERSION
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
317
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
318 version 1.0 : 06 / 06 / 2013
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
319
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
320 version 1.2 : 27 / 01 / 2014
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
321
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
322 version 1.3 : 19 / 11 / 2014
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
323
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
324 version 1.4 : 21 / 01 / 2016 - a clean version for community
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
325
17
49f87ddb2c78 Master branch Updating - - Fxx
fgiacomoni
parents: 16
diff changeset
326 version 1.5 : 19 / 01 / 2018 - modify parser to match HMDB V4.0 formats
49f87ddb2c78 Master branch Updating - - Fxx
fgiacomoni
parents: 16
diff changeset
327
49f87ddb2c78 Master branch Updating - - Fxx
fgiacomoni
parents: 16
diff changeset
328 version 1.6 : 23 / 01 / 2019 - Manage UA http error and advanced feature from hmdb.
4
6091a80df951 planemo upload commit e2dfb6f7afeeb7767ef83e9e2c3a2d3e6a94ae98
fgiacomoni
parents: 1
diff changeset
329
1
6d0a0f8f672a planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff changeset
330 =cut