annotate golm_ws_lib_search.pl @ 3:28d579fa1718 draft default tip

Master branch Updating - - Fxx
author fgiacomoni
date Wed, 03 Oct 2018 05:35:16 -0400
parents 11779b6402bc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
1 #!perl
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
2
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
3 ## script : XXX.pl
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
4 #=============================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
5 # Included modules and versions
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
6 #=============================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
7 ## Perl modules
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
8 use strict ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
9 use warnings ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
10 use Carp qw (cluck croak carp) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
11
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
12 use Data::Dumper ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
13 use Getopt::Long ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
14 use FindBin ; ## Allows you to locate the directory of original perl script
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
15
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
16 ## Specific Perl Modules (PFEM)
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
17 use lib $FindBin::Bin ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
18 my $binPath = $FindBin::Bin ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
19 use JSON ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
20
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
21 ## Dedicate Perl Modules PFEM
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
22 use lib::golm_ws_api qw( :ALL ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
23 use lib::msp qw( :ALL ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
24 use lib::output qw( :ALL ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
25 use lib::conf qw( :ALL ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
26
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
27 ## Initialized values
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
28 my ($OptHelp,$ri,$riWindow,$gcColumn,$inputFile,$inputMasses) = (undef,undef,undef,undef,undef,undef) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
29 my ($maxHits,$mzRes,$maxIons,$threshold,$relative,$noise_threshold) = (undef,undef,undef,undef,undef,undef) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
30 my ($JaccardDistanceThreshold,$s12GowerLegendreDistanceThreshold) = (undef,undef,undef,undef,undef) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
31 my ($DotproductDistanceThreshold,$HammingDistanceThreshold,$EuclideanDistanceThreshold) = (undef,undef,undef) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
32 my ($excel_file,$html_file,$html_template,$json_file,$csv_file) = (undef,undef,undef,undef,undef) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
33 my (@hits, @ojson) = ( () , () ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
34 my $encoded_spectra ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
35
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
36 ## if you put no arguments, function help is started
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
37 if (!@ARGV){ &help ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
38
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
39 #=============================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
40 # Manage EXCEPTIONS
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
41 #=============================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
42 &GetOptions (
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
43 "help|h" => \$OptHelp, # HELP
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
44 "inputFile:s" => \$inputFile,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
45 "inputMasses:s" => \$inputMasses,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
46 "ri:i" => \$ri,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
47 "riWindow:i" => \$riWindow,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
48 "gcColumn:s" => \$gcColumn,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
49 "maxHits:i" => \$maxHits,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
50 "mzRes:i" => \$mzRes,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
51 "maxIons:i" => \$maxIons,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
52 #"noiseThreshold:f" => \$noise_threshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
53 "JaccardDistanceThreshold:f" => \$JaccardDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
54 "s12GowerLegendreDistanceThreshold:f" => \$s12GowerLegendreDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
55 "DotproductDistanceThreshold:f" => \$DotproductDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
56 "HammingDistanceThreshold:f" => \$HammingDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
57 "EuclideanDistanceThreshold:f" => \$EuclideanDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
58 "relative:s" => \$relative,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
59 "output_xls:s" => \$excel_file,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
60 "output_html:s" => \$html_file,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
61 "output_json:s" => \$json_file,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
62 "output_tabular:s" => \$csv_file,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
63 ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
64
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
65 die "maxHits must be >= 0\n" unless ($maxHits >= 0) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
66 die "mzRes must be >= 0 \n" unless ($mzRes >= 0) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
67 die "maxIons must be >= 0\n" unless ($maxIons >= 0) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
68 #die "noiseThreshold must be > 0\n" unless ($noise_threshold > 0) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
69
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
70 ## if you put the option -help or -h function help is started
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
71 if(defined($OptHelp)){ &help ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
72
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
73 if( (!defined ($inputFile)) and (!defined($inputMasses) )){ warn "The input data is not defined (File or mass/intensity list AS string)\n" ; &help ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
74
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
75 #=============================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
76 # MAIN SCRIPT
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
77 #=============================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
78
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
79 ## Create module objects ###
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
80
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
81 my $oapi = lib::golm_ws_api->new() ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
82 my $omsp = lib::msp->new() ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
83 my $o_output = lib::output->new() ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
84 my $oConf = lib::conf->new() ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
85
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
86
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
87 ## -------------- Conf file ------------------------ :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
88 my ( $CONF ) = ( undef ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
89 foreach my $conf ( <$binPath/*.cfg> ) {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
90 $CONF = $oConf->as_conf($conf) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
91 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
92
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
93 ## -------------- HTML template file ------------------------ :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
94 $html_template = <$binPath/golm_out.tmpl> ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
95 $CONF->{'HTML_TEMPLATE'} = $html_template ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
96
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
97
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
98 ## -------------- Retrieve values from conf file ------------------------ :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
99 my $ws_url = $CONF->{'WS_URL'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
100 my $ws_proxy = $CONF->{'WS_PROXY'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
101 my $default_ri = $CONF->{'RI'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
102 my $default_ri_window = $CONF->{'RI_WINDOW'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
103 my $default_gc_column = $CONF->{'GC_COLUMN'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
104 my $default_entries = $CONF->{'DEFAULT_ENTRIES'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
105 my $analyte_ref = $CONF->{'ANALYTE_REF'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
106 my $metabolite_ref = $CONF->{'METABOLITE_REF'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
107 my $spectrum_ref = $CONF->{'SPECTRUM_REF'} ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
108
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
109 ############# -------------- Test the Golm web service -------------- ############# :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
110
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
111 $oapi->test_query_golm($ws_url, $ws_proxy) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
112
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
113 ############# -------------- Parse the .msp file -------------- ############# :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
114
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
115
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
116 my $ref_mzs_res ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
117 my $ref_ints_res ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
118
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
119 ## Case when masses are entered manually
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
120 if (defined $inputMasses && !defined $inputFile) {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
121
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
122 ## Retrieve masses from msp file
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
123 $ref_mzs_res = $omsp->get_masses_from_string($inputMasses, $mzRes) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
124
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
125 ## Retrieve intensities from msp file
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
126 $ref_ints_res = $omsp->get_intensities_from_string($inputMasses) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
127
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
128 ## Sorting intensities
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
129 my ($mzs_res_sorted, $ints_res_sorted) = $omsp->sorting_descending_intensities($ref_mzs_res, $ref_ints_res) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
130
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
131 #************************
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
132 # Noise threshold: uncomment if it is not managed in MetaMS
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
133 #************************
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
134
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
135 ## Apply noise threshold
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
136 #my ($mzs_res_noise_threshold, $ints_res_noise_threshold) = $omsp->keep_ions_above_threshold($mzs_res_sorted, $ints_res_sorted) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
137
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
138 #************************
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
139
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
140 ## Keep a limited number of ions according to $maxIons
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
141 if($maxIons > 0){
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
142
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
143 ## To uncomment if "Apply noise threshold is used"
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
144 #$ref_mzs_res = $omsp->keep_only_max_masses( $mzs_res_noise_threshold, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
145 #$ref_ints_res = $omsp->keep_only_max_intensities( $ints_res_noise_threshold, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
146
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
147 ## To uncomment if "Apply noise threshold is used"
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
148 $ref_mzs_res = $omsp->keep_only_max_masses( $mzs_res_sorted, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
149 $ref_ints_res = $omsp->keep_only_max_intensities( $ints_res_sorted, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
150 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
151
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
152 ## Remove redundant masses
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
153 my ($uniq_masses , $uniq_intensities) = $omsp->remove_redundants($ref_mzs_res, $ref_ints_res) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
154
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
155 ## Relative intensity
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
156 my $relative_ints_res = undef ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
157 if ($relative eq "true") {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
158 my @relative_ints = map { ($_ * 100)/@$ints_res_sorted[0] } @$ints_res_sorted ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
159 $relative_ints_res = \@relative_ints ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
160 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
161
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
162 ## Encode spectra
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
163 if (defined $relative_ints_res) {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
164 $encoded_spectra = $omsp->encode_spectrum_for_query($mzs_res_sorted, $relative_ints_res) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
165 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
166 else { $encoded_spectra = $omsp->encode_spectrum_for_query($mzs_res_sorted, $ints_res_sorted) ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
167
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
168 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
169 ## Case with the msp file
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
170 elsif (defined $inputFile and -e $inputFile and !defined $inputMasses and defined $mzRes and defined $maxIons and defined $maxHits) {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
171
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
172 unless (-f $inputFile) { croak "$inputFile is not a file" ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
173 unless (-s $inputFile) { croak "$inputFile is empty" ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
174
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
175 ## Get masses and their intensities
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
176 $ref_mzs_res = $omsp->get_mzs($inputFile, $mzRes) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
177 $ref_ints_res = $omsp->get_intensities($inputFile, $maxIons) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
178
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
179 ## Sorting intensities
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
180 my ($mzs_res_sorted, $ints_res_sorted) = $omsp->sorting_descending_intensities($ref_mzs_res, $ref_ints_res) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
181
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
182 #************************
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
183 # Noise threshold: uncomment if it is not managed in MetaMS
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
184 #************************
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
185
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
186 ## Apply noise threshold if exists
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
187 #my ($mzs_res_noise_threshold, $ints_res_noise_threshold) = $omsp->keep_ions_above_threshold($mzs_res_sorted, $ints_res_sorted) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
188
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
189 #************************
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
190
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
191
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
192 ## Keep only $maxIons ions
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
193 if($maxIons > 0){
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
194
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
195 ## To uncomment if "Apply noise threshold is used"
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
196 #$ref_mzs_res = $omsp->keep_only_max_masses( $mzs_res_noise_threshold, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
197 #$ref_ints_res = $omsp->keep_only_max_intensities( $ints_res_noise_threshold, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
198
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
199 ## To uncomment if "Apply noise threshold is used"
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
200 $mzs_res_sorted = $omsp->keep_only_max_masses( $mzs_res_sorted, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
201 $ints_res_sorted = $omsp->keep_only_max_intensities( $ints_res_sorted, $maxIons ) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
202 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
203
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
204 ## Remove redundant masses
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
205 my ($uniq_masses , $uniq_intensities) = (undef,undef) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
206 my @uniq_total_masses = () ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
207 my @uniq_total_intensities = () ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
208
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
209 for (my $i=0 ; $i<@$mzs_res_sorted && $i<@$ints_res_sorted ; $i++) {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
210
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
211 ($uniq_masses , $uniq_intensities) = $omsp->remove_redundants(@$mzs_res_sorted[$i], @$ints_res_sorted[$i]) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
212 push (@uniq_total_masses , $uniq_masses) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
213 push (@uniq_total_intensities, $uniq_intensities) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
214 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
215
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
216 ## Relative intensity
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
217 my $relative_ints_res = undef ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
218 if ($relative eq "true") {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
219 $relative_ints_res = $omsp->apply_relative_intensity(\@uniq_total_intensities) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
220 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
221
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
222 ## Encode spectra
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
223 if (defined $relative_ints_res) {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
224 $encoded_spectra = $omsp->encode_spectrum_for_query(\@uniq_total_masses, $relative_ints_res) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
225 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
226 else { $encoded_spectra = $omsp->encode_spectrum_for_query(\@uniq_total_masses, \@uniq_total_intensities) ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
227
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
228 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
229 elsif (!defined $maxHits or !defined $maxIons or !defined $mzRes) { croak "Parameters mzRes or maxIons or maxHits are undefined\n"; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
230 elsif (!-f $inputFile) { croak "$inputFile does not exist" ; }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
231
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
232 ############# -------------- Send queries to Golm -------------- ############# :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
233
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
234 my $limited_hits ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
235 foreach my $spectrum (@$encoded_spectra){
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
236 ($limited_hits) = $oapi->LibrarySearch ($ri, $riWindow, $gcColumn, $spectrum, $maxHits, $JaccardDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
237 $s12GowerLegendreDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
238 $DotproductDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
239 $HammingDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
240 $EuclideanDistanceThreshold,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
241 $ws_url, $ws_proxy,
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
242 $default_ri, $default_ri_window, $default_gc_column) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
243 push (@hits , $limited_hits) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
244 }
2
11779b6402bc planemo upload for repository https://github.com/workflow4metabolomics/tool-bank-golm-lib_search.git commit a2892b221abe5a68ef271266a36b66894fcf9bde
fgiacomoni
parents: 0
diff changeset
245
0
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
246
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
247 ############# -------------- Build outputs -------------- ############# :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
248
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
249 my $jsons_obj = $o_output->build_json_res_object(\@hits) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
250 #$o_output->write_json_skel(\$json_file, $jsons_obj) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
251
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
252 # Build the ajax data source for html view
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
253 #my $ajax = $o_output->write_ajax_data_source($jsons_obj) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
254
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
255
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
256 my $tbody_entries = $o_output->add_entries_to_tbody_object($jsons_obj,$analyte_ref,$metabolite_ref,$spectrum_ref) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
257 $o_output->write_html_body($jsons_obj, $tbody_entries, $html_file, $html_template, $default_entries, $jsons_obj) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
258 $o_output->excel_like_output($excel_file, $jsons_obj) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
259 $o_output->write_csv($csv_file , $jsons_obj) ;
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
260
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
261
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
262 #====================================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
263 # Help subroutine called with -h option
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
264 # number of arguments : 0
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
265 # Argument(s) :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
266 # Return : 1
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
267 #====================================================================================
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
268 sub help {
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
269 print STDERR "
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
270 golm_ws_lib_search.pl
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
271
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
272 # golm_ws_lib_search.pl is a script to use SOAP Golm webservice and send specific queries about spectra searches.
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
273 # Input : a list of masses (m/z) and their intensities.
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
274 # Authors : Gabriel Cretin / Franck Giacomoni / Yann Guitton
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
275 # Emails : franck.giacomoni\@clermont.inra.fr
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
276 # gabriel.cretin\@clermont.inra.fr
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
277 # yann.guitton\@oniris-nantes.fr
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
278 # Version : 1.2
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
279 # Created : 03/06/2016
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
280 # Updated : 28/11/2016
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
281 USAGE :
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
282 golm_ws_lib_search.pl -help OR
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
283
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
284 golm_ws_lib_search.pl
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
285 -spectraFile [.msp file]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
286 -spectraMasses [masses + intensities of an ion: 'mz1 int1 mz2 int2 mzx intx...']
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
287 -ri [Rentention Index: float or integer]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
288 -riWindow [Retention Index Window: 1500 or the value of your choice]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
289 -gcColumn [AlkaneRetentionIndexGcColumnComposition: 'VAR5' or 'MDN35' or 'None']
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
290 -maxHits [Maximum hits per queried spectra: integer >= 1 (100 for all of them)]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
291 -mzRes [Number of digits after the decimal point for m/z values: integer (0 if none)]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
292 -maxIons [Number of m/z per spectra you want to keep for the queries, default 0 for all detected ions]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
293 -noiseThreshold [Ions having intensity values less than this value are ignored]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
294 -JaccardDistanceThreshold...............[
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
295 -s12GowerLegendreDistanceThreshold......[ Threshold for each score. Hits with greater scores are ignored: 0 (perfect match) < threshlold <= 1 (mismatch) ]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
296 -DotproductDistanceThreshold............[
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
297 -EuclideanDistanceThreshold.............[
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
298 -HammingDistanceThreshold[Threshold for hamming score. Hits with greater scores are ignored: 0 - perfect match to higher values indicating a mismatch]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
299 -relative [Transforms absolute intensities in the msp file into relative intensities: (intensity * 100)/ max(intensitiess), otherwise, leave them absolute: true or false]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
300 -output_xls [name of the xls file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
301 -output_html [name of the html file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
302 -output_json [name of the json file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
303 -output_tabular [name of the csv file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
304
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
305 ";
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
306 exit(1);
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
307 }
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
308
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
309 ## END of script
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
310
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
311 __END__
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
312
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
313 =head1 NAME
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
314
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
315 golm_ws_lib_search.pl -- script to send GC-MS spectra queries to Golm Metabolome Database (GMD)
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
316
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
317 =head1 USAGE
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
318
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
319 golm_ws_lib_search.pl -help OR
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
320
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
321 golm_ws_lib_search.pl
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
322 -spectraFile [.msp file]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
323 -spectraMasses [masses + intensities of an ion: 'mz1 int1 mz2 int2 mzx intx...']
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
324 -ri [Rentention Index: float or integer]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
325 -riWindow [Retention Index Window: 1500 or the value of your choice]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
326 -gcColumn [AlkaneRetentionIndexGcColumnComposition: 'VAR5' or 'MDN35' or 'None']
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
327 -maxHits [Maximum hits per queried spectra: integer >= 1 (100 for all of them)]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
328 -mzRes [Number of digits after the decimal point for m/z values: integer (0 if none)]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
329 -maxIons [Number of m/z per spectra you want to keep for the queries, default 0 for all detected ions]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
330 -noiseThreshold [Ions having intensity values less than this value are ignored]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
331 -JaccardDistanceThreshold...............[
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
332 -s12GowerLegendreDistanceThreshold......[ Threshold for each score. Hits with greater scores are ignored: 0 (perfect match) < threshlold <= 1 (mismatch) ]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
333 -DotproductDistanceThreshold............[
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
334 -EuclideanDistanceThreshold.............[
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
335 -HammingDistanceThreshold[Threshold for hamming score. Hits with greater scores are ignored: 0 - perfect match to higher values indicating a mismatch]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
336 -relative [Transforms absolute intensities in the msp file into relative intensities: (intensity * 100)/ max(intensitiess), otherwise, leave them absolute: true or false]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
337 -output_xls [name of the xls file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
338 -output_html [name of the html file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
339 -output_json [name of the json file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
340 -output_tabular [name of the csv file in output: string]
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
341
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
342 =head1 SYNOPSIS
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
343
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
344 This script sends GC-MS EI spectra from an msp file given in argument to Golm Database, and presents results on a web interface.
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
345
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
346 =head1 DESCRIPTION
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
347
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
348 This main program is a ...
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
349
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
350 =over 4
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
351
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
352 =item B<function01>
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
353
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
354 =item B<function02>
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
355
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
356 =back
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
357
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
358 =head1 AUTHOR
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
359
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
360 Gabriel Cretin E<lt>gabriel.cretin@clermont.inra.frE<gt>
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
361 Franck Giacomoni E<lt>franck.giacomoni@clermont.inra.frE<gt>
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
362
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
363 =head1 LICENSE
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
364
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
365 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
366
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
367 =head1 VERSION
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
368
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
369 version 1.0 : 03 / 06 / 2016
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
370
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
371 version 1.1 : 24 / 06 / 2016
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
372
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
373 version 1.2 : 28 / 11 / 2016
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
374
e3d43b8c987b Init repository with last tool-bank-golm-lib_search master version
fgiacomoni
parents:
diff changeset
375 =cut