# HG changeset patch # User fgiacomoni # Date 1547129414 18000 # Node ID 625fa968d99a99ccea3756f3a0f147d261e95efb # Parent 3587cb923890bb6abed5c9fbd6671ff18bb2932f Master branch Updating - - Fxx diff -r 3587cb923890 -r 625fa968d99a lib/csv.pm --- a/lib/csv.pm Tue Oct 02 04:59:13 2018 -0400 +++ b/lib/csv.pm Thu Jan 10 09:10:14 2019 -0500 @@ -194,10 +194,44 @@ my $fh = undef ; $csv->eol ("\n"); ## end-of-line string to add to rows +# $csv->quote_char(undef) ; + open $fh, ">:encoding(utf8)", "$file_name" or die "$file_name: $!"; + + my $status = $csv->print ($fh, $_) for @{$rows}; + close $fh or die "$file_name: $!"; + + return(\$file_name) ; +} +## END of SUB + + +=head2 METHOD write_csv_from_hash + + ## Description : write a csv file from simple hash with headers + ## Input : $csv, $file_name, $headers, $arrayofhash + ## Output : $csv_file + ## Usage : my ( $csv_file ) = write_csv_from_arrays( $csv, $file_name, $headers, $arrayofhash ) ; + +=cut +## START of SUB +sub write_csv_from_array_of_hash { + ## Retrieve Values + my $self = shift ; + my ( $csv, $file_name, $headers, $hash ) = @_ ; + + my $fh = undef ; + $csv->eol ("\n"); ## end-of-line string to add to rows $csv->quote_char(undef) ; open $fh, ">:encoding(utf8)", "$file_name" or die "$file_name: $!"; - my $status = $csv->print ($fh, $_) for @{$rows}; + if (defined $headers) { + for my $field (@$headers) { print $fh join('\t', $field), "\n"; } ; + } + + for my $row (keys %{$hash}) { + print $fh join('\t', map { $_, $row->{$_} } sort keys %$row), "\n"; + } + close $fh or die "$file_name: $!"; return(\$file_name) ; diff -r 3587cb923890 -r 625fa968d99a lib/hmdb.pm --- a/lib/hmdb.pm Tue Oct 02 04:59:13 2018 -0400 +++ b/lib/hmdb.pm Thu Jan 10 09:10:14 2019 -0500 @@ -195,12 +195,15 @@ croak "No http status is defined for the distant server" ; } else { - unless ( $$status == 200 ) { + unless ( $$status == 200 ) { if ( $$status == 504 ) { croak "Gateway Timeout: The HMDB server was acting as a gateway or proxy and did not receive a timely response from the upstream server" ; } + if ( $$status == 500 ) { croak "Internal Server Error: The HMDB server returns an unexpected internal server error" ; } else { ## None supported http code error ## + croak "Internal Server Error $$status..." ; } } + if ( $$status == 200 ) { print "The HMDB server returns that your request was fulfilled" ; } } return (1) ; @@ -232,7 +235,7 @@ $req->content_type('application/x-www-form-urlencoded'); $req->content('utf8=TRUE&mode='.$mode.'&query_masses='.$masses.'&tolerance='.$delta.'&database=HMDB&commit=Download Results As CSV'); - +# print Dumper $req ; my $res = $ua->request($req); # print $res->as_string; if ($res->is_success) { @@ -269,26 +272,10 @@ my %features = () ; # print Dumper $csv ; +# print Dumper $masses ; +# print Dumper $max_query ; foreach my $line (@{$csv}) { - ## HMDB csv output - [DEPRECATED]... -# if ($line !~ /query_mass,compound_id,formula,compound_mass,adduct,adduct_type,adduct_mass,delta/) { -# my @entry = split(/,/, $line) ; -# -# if ( !exists $result_by_entry{$entry[0]} ) { $result_by_entry{$entry[0]} = [] ; } -# -# $features{ENTRY_ENTRY_ID} = $entry[1] ; -# $features{ENTRY_FORMULA} = $entry[2] ; -# $features{ENTRY_CPD_MZ} = $entry[3] ; -# $features{ENTRY_ADDUCT} = $entry[4] ; -# $features{ENTRY_ADDUCT_TYPE} = $entry[5] ; -# $features{ENTRY_ADDUCT_MZ} = $entry[6] ; -# $features{ENTRY_DELTA} = $entry[7] ; -# -# my %temp = %features ; -# -# push (@{$result_by_entry{$entry[0]} }, \%temp) ; -# } ## NEW HMDB format V4.0 - dec2017 if ($line !~ /query_mass,compound_id,compound_name,kegg_id,formula,monoisotopic_mass,adduct,adduct_type,adduct_m\/z,delta\(ppm\)/) { @@ -341,6 +328,7 @@ else {push (@results, [] ) ;} ; } + return(\@results) ; } ## END of SUB @@ -1030,7 +1018,8 @@ my $self = shift ; my ( $csv_file, $rows ) = @_ ; - my $ocsv = lib::csv::new( {is_binary => 1 , quote_binary => 0, quote_char => undef }) ; +# my $ocsv = lib::csv::new( {is_binary => 1 , quote_binary => 0, quote_char => undef }) ; + my $ocsv = lib::csv::new() ; my $csv = $ocsv->get_csv_object("\t") ; $ocsv->write_csv_from_arrays($csv, $$csv_file, $rows) ; @@ -1053,7 +1042,7 @@ my ( $masses, $ids, $results, $file, ) = @_ ; open(CSV, '>:utf8', "$file") or die "Cant' create the file $file\n" ; - print CSV "ID\tQuery(Da)\tDelta\tMetabolite_Name\tCpd_MW(Da)\tFormula\tAdduct\tAdduct_MW(Da)\tHMDB_ID\n" ; + print CSV "ID\tQuery(Da)\tDelta(ppm)\tMetabolite_Name\tCpd_MW(Da)\tFormula\tAdduct\tAdduct_MW(Da)\tHMDB_ID\n" ; my $i = 0 ; diff -r 3587cb923890 -r 625fa968d99a test-data/out_test01.txt --- a/test-data/out_test01.txt Tue Oct 02 04:59:13 2018 -0400 +++ b/test-data/out_test01.txt Thu Jan 10 09:10:14 2019 -0500 @@ -1,4 +1,4 @@ -ID Query(Da) Delta Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID +ID Query(Da) Delta(ppm) Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID mz_00001 7.02080998 0 UNKNOWN N/A N/A N/A N/A N/A mz_00002 75.05547146 0 UNKNOWN N/A N/A N/A N/A N/A mz_00003 75.08059797 0 UNKNOWN N/A N/A N/A N/A N/A diff -r 3587cb923890 -r 625fa968d99a test-data/out_test02.html --- a/test-data/out_test02.html Tue Oct 02 04:59:13 2018 -0400 +++ b/test-data/out_test02.html Thu Jan 10 09:10:14 2019 -0500 @@ -1,1 +1,1 @@ -Galaxy HMDB queries - All results
Results of HMDB queries - Search params : Molecular specie = positive / delta (mass-to-charge ratio) = 0.001

ID from inputMass (m/z)Metabolite_NameCompound_IDFormulaCompound MW (Da)AdductAdduct_TypeAdduct MW (Da)DeltaInChI IdentifierPredicted LogP (ALOGPS)
mz_000017.02080998
UNKNOWNNONEn/an/an/an/an/a0n/an/a
mz_0000275.05547146
N-NitrosodimethylamineHMDB0031419C2H6N2O74.048012824M+H+75.0552892InChI=1S/C2H6N2O/c1-4(2)3-5/h1-2H3-0.53
AcetylhydrazineHMDB0060428C2H6N2O74.048012824M+H+75.0552892InChI=1S/C2H6N2O/c1-2(5)4-3/h3H2,1H3,(H,4,5)-0.78
glycinamideHMDB0062472C2H6N2O74.048012824M+H+75.0552892InChI=1S/C2H6N2O/c3-1-2(4)5/h1,3H2,(H2,4,5)-2.49
CreatineHMDB0000064C4H9N3O2131.069476547M+H+NH4+75.0552882InChI=1S/C4H9N3O2/c1-7(4(5)6)2-3(8)9/h2H2,1H3,(H3,5,6)(H,8,9)-1.59
Beta-Guanidinopropionic acidHMDB0013222C4H9N3O2131.069476547M+H+NH4+75.0552882InChI=1S/C4H9N3O2/c5-4(6)7-2-1-3(8)9/h1-2H2,(H,8,9)(H4,5,6,7)-1.70
mz_0000375.08059797
UNKNOWNHMDB0155221H4O7P2177.943225506M+H+2Na+75.0805990NANA
1-ButanolHMDB0004327C4H10O74.073164942M+H+75.0804412InChI=1S/C4H10O/c1-2-3-4-5/h5H,2-4H2,1H30.84
UNKNOWNHMDB0062103C4H10O74.073164942M+H+75.0804412NANA
1-hydroperoxy-8-carboxyoctyl 3,4-epoxynon-(2E)-enyl etherHMDB0062326C4H10O74.073164942M+H+75.0804412InChI=1S/C4H10O/c1-3-5-4-2/h3-4H2,1-2H31.12
2-ButanolHMDB0011469C4H10O74.073164942M+H+75.0804412InChI=1S/C4H10O/c1-3-4(2)5/h4-5H,3H2,1-2H30.66
mz_0000476.03942694
L-Aspartic acidHMDB0000191C4H7NO4133.037507717M+H+NH4+76.0393042InChI=1S/C4H7NO4/c5-2(4(8)9)1-3(6)7/h2H,1,5H2,(H,6,7)(H,8,9)/t2-/m0/s1-3.52
Ethyl nitriteHMDB0031239C2H5NO275.032028409M+H+76.0393042InChI=1S/C2H5NO2/c1-2-5-3-4/h2H2,1H30.42
1-deoxy-1-(N6-lysino)-D-fructoseHMDB0062186C4H7NO4133.037507709M+H+NH4+76.0393042InChI=1S/C4H7NO4/c5-2(4(8)9)1-3(6)7/h2H,1,5H2,(H,6,7)(H,8,9)-3.52
GlycineHMDB0000123C2H5NO275.032028409M+H+76.0393042InChI=1S/C2H5NO2/c3-1-2(4)5/h1,3H2,(H,4,5)-3.34
Acetohydroxamic AcidHMDB0014691C2H5NO275.032028409M+H+76.0393042InChI=1S/C2H5NO2/c1-2(4)3-5/h5H,1H3,(H,3,4)-1.46
mz_0000576.07584477
3-aminopropan-1-olHMDB0140038C3H9NO75.068413915M+H+76.075692InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2-1.01
1-Amino-propan-2-olHMDB0012136C3H9NO75.068413915M+H+76.075692InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3-1.03
2-(methylamino)ethan-1-olHMDB0142449C3H9NO75.068413914M+H+76.075692InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3-1.05
Trimethylamine N-oxideHMDB0000925C3H9NO75.068413915M+H+76.075692InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3-2.01
Allyl alcoholHMDB0031652C3H6O58.041864814M+NH4+76.0756882InChI=1S/C3H6O/c1-2-3-4/h2,4H,1,3H2-0.03
mz_0000676.07593168
3-aminopropan-1-olHMDB0140038C3H9NO75.068413915M+H+76.075693InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2-1.01
1-Amino-propan-2-olHMDB0012136C3H9NO75.068413915M+H+76.075693InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3-1.03
2-(methylamino)ethan-1-olHMDB0142449C3H9NO75.068413914M+H+76.075693InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3-1.05
Trimethylamine N-oxideHMDB0000925C3H9NO75.068413915M+H+76.075693InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3-2.01
Allyl alcoholHMDB0031652C3H6O58.041864814M+NH4+76.0756883InChI=1S/C3H6O/c1-2-3-4/h2,4H,1,3H2-0.03

\ No newline at end of file +Galaxy HMDB queries - All results
Results of HMDB queries - Search params : Molecular specie = positive / delta (mass-to-charge ratio) = 0.001

ID from inputMass (m/z)Metabolite_NameCompound_IDFormulaCompound MW (Da)AdductAdduct_TypeAdduct MW (Da)DeltaInChI IdentifierPredicted LogP (ALOGPS)
mz_000017.02080998
BerylliumHMDB0002387Be9.012182135M+NH4-H2O+7.0203368InChI=1S/Be/q+2NA
mz_0000275.05547146
N-NitrosodimethylamineHMDB0031419C2H6N2O74.048012824M+H+75.0552892InChI=1S/C2H6N2O/c1-4(2)3-5/h1-2H3-0.53
AcetylhydrazineHMDB0060428C2H6N2O74.048012824M+H+75.0552892InChI=1S/C2H6N2O/c1-2(5)4-3/h3H2,1H3,(H,4,5)-0.78
glycinamideHMDB0062472C2H6N2O74.048012824M+H+75.0552892InChI=1S/C2H6N2O/c3-1-2(4)5/h1,3H2,(H2,4,5)-2.49
CreatineHMDB0000064C4H9N3O2131.069476547M+H+NH4+75.0552882InChI=1S/C4H9N3O2/c1-7(4(5)6)2-3(8)9/h2H2,1H3,(H3,5,6)(H,8,9)-1.59
Beta-Guanidinopropionic acidHMDB0013222C4H9N3O2131.069476547M+H+NH4+75.0552882InChI=1S/C4H9N3O2/c5-4(6)7-2-1-3(8)9/h1-2H2,(H,8,9)(H4,5,6,7)-1.70
mz_0000375.08059797
PyrophosphateHMDB0000250H4O7P2177.943225506M+H+2Na+75.0805990InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)NA
UNKNOWNHMDB0155221H4O7P2177.943225506M+H+2Na+75.0805990NANA
1-ButanolHMDB0004327C4H10O74.073164942M+H+75.0804412InChI=1S/C4H10O/c1-2-3-4-5/h5H,2-4H2,1H30.84
2-Methylpropan-2-olHMDB0031456C4H10O74.073164942M+H+75.0804412InChI=1S/C4H10O/c1-4(2,3)5/h5H,1-3H30.70
IsobutanolHMDB0006006C4H10O74.073164942M+H+75.0804412InChI=1S/C4H10O/c1-4(2)3-5/h4-5H,3H2,1-2H30.60
mz_0000476.03942694
L-Aspartic acidHMDB0000191C4H7NO4133.037507717M+H+NH4+76.0393042InChI=1S/C4H7NO4/c5-2(4(8)9)1-3(6)7/h2H,1,5H2,(H,6,7)(H,8,9)/t2-/m0/s1-3.52
UNKNOWNHMDB0161401C2H4NO274.024751953M+H+76.0393042NANA
Ethyl nitriteHMDB0031239C2H5NO275.032028409M+H+76.0393042InChI=1S/C2H5NO2/c1-2-5-3-4/h2H2,1H30.42
1-deoxy-1-(N6-lysino)-D-fructoseHMDB0062186C4H7NO4133.037507709M+H+NH4+76.0393042InChI=1S/C4H7NO4/c5-2(4(8)9)1-3(6)7/h2H,1,5H2,(H,6,7)(H,8,9)-3.52
N-acetyl-seryl-aspartateHMDB0062501C4H7NO4133.037507709M+H+NH4+76.0393042InChI=1S/C4H7NO4/c5-2(4(8)9)1-3(6)7/h2H,1,5H2,(H,6,7)(H,8,9)-3.52
mz_0000576.07584477
3-aminopropan-1-olHMDB0140038C3H9NO75.068413915M+H+76.075692InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2-1.01
2-(methylamino)ethan-1-olHMDB0142449C3H9NO75.068413914M+H+76.075692InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3-1.05
Trimethylamine N-oxideHMDB0000925C3H9NO75.068413915M+H+76.075692InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3-2.01
1-Amino-propan-2-olHMDB0012136C3H9NO75.068413915M+H+76.075692InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3-1.03
UNKNOWNHMDB0168716C6H15NO2133.110278727M+H+NH4+76.0756892NANA
mz_0000676.07593168
3-aminopropan-1-olHMDB0140038C3H9NO75.068413915M+H+76.075693InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2-1.01
2-(methylamino)ethan-1-olHMDB0142449C3H9NO75.068413914M+H+76.075693InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3-1.05
Trimethylamine N-oxideHMDB0000925C3H9NO75.068413915M+H+76.075693InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3-2.01
1-Amino-propan-2-olHMDB0012136C3H9NO75.068413915M+H+76.075693InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3-1.03
UNKNOWNHMDB0168716C6H15NO2133.110278727M+H+NH4+76.0756893NANA

\ No newline at end of file diff -r 3587cb923890 -r 625fa968d99a test-data/out_test02.tabular --- a/test-data/out_test02.tabular Tue Oct 02 04:59:13 2018 -0400 +++ b/test-data/out_test02.tabular Thu Jan 10 09:10:14 2019 -0500 @@ -1,7 +1,7 @@ id mz rt hmdb(delta::name::mz::formula::adduct::id) -1 7.02080998 49.38210915 NONE -2 75.05547146 0.658528069 2::[N-Nitrosodimethylamine]::74.048012824::C2H6N2O::[M+H]::HMDB0031419 | 2::[Acetylhydrazine]::74.048012824::C2H6N2O::[M+H]::HMDB0060428 | 2::[glycinamide]::74.048012824::C2H6N2O::[M+H]::HMDB0062472 | 2::[Creatine]::131.069476547::C4H9N3O2::[M+H+NH4]::HMDB0000064 | 2::[Beta-Guanidinopropionic acid]::131.069476547::C4H9N3O2::[M+H+NH4]::HMDB0013222 -3 75.08059797 1743.94267 0::[UNKNOWN]::177.943225506::H4O7P2::[M+H+2Na]::HMDB0155221 | 2::[1-Butanol]::74.073164942::C4H10O::[M+H]::HMDB0004327 | 2::[UNKNOWN]::74.073164942::C4H10O::[M+H]::HMDB0062103 | 2::[1-hydroperoxy-8-carboxyoctyl 3,4-epoxynon-(2E)-enyl ether]::74.073164942::C4H10O::[M+H]::HMDB0062326 | 2::[2-Butanol]::74.073164942::C4H10O::[M+H]::HMDB0011469 -4 76.03942694 51.23158899 2::[L-Aspartic acid]::133.037507717::C4H7NO4::[M+H+NH4]::HMDB0000191 | 2::[Ethyl nitrite]::75.032028409::C2H5NO2::[M+H]::HMDB0031239 | 2::[1-deoxy-1-(N6-lysino)-D-fructose]::133.037507709::C4H7NO4::[M+H+NH4]::HMDB0062186 | 2::[Glycine]::75.032028409::C2H5NO2::[M+H]::HMDB0000123 | 2::[Acetohydroxamic Acid]::75.032028409::C2H5NO2::[M+H]::HMDB0014691 -5 76.07584477 50.51249853 2::[3-aminopropan-1-ol]::75.068413915::C3H9NO::[M+H]::HMDB0140038 | 2::[1-Amino-propan-2-ol]::75.068413915::C3H9NO::[M+H]::HMDB0012136 | 2::[2-(methylamino)ethan-1-ol]::75.068413914::C3H9NO::[M+H]::HMDB0142449 | 2::[Trimethylamine N-oxide]::75.068413915::C3H9NO::[M+H]::HMDB0000925 | 2::[Allyl alcohol]::58.041864814::C3H6O::[M+NH4]::HMDB0031652 -6 76.07593168 0.149308136 3::[3-aminopropan-1-ol]::75.068413915::C3H9NO::[M+H]::HMDB0140038 | 3::[1-Amino-propan-2-ol]::75.068413915::C3H9NO::[M+H]::HMDB0012136 | 3::[2-(methylamino)ethan-1-ol]::75.068413914::C3H9NO::[M+H]::HMDB0142449 | 3::[Trimethylamine N-oxide]::75.068413915::C3H9NO::[M+H]::HMDB0000925 | 3::[Allyl alcohol]::58.041864814::C3H6O::[M+NH4]::HMDB0031652 +1 7.02080998 49.38210915 68::[Beryllium]::9.012182135::Be::[M+NH4-H2O]::HMDB0002387 +2 75.05547146 0.658528069 "2::[N-Nitrosodimethylamine]::74.048012824::C2H6N2O::[M+H]::HMDB0031419 | 2::[Acetylhydrazine]::74.048012824::C2H6N2O::[M+H]::HMDB0060428 | 2::[glycinamide]::74.048012824::C2H6N2O::[M+H]::HMDB0062472 | 2::[Creatine]::131.069476547::C4H9N3O2::[M+H+NH4]::HMDB0000064 | 2::[Beta-Guanidinopropionic acid]::131.069476547::C4H9N3O2::[M+H+NH4]::HMDB0013222" +3 75.08059797 1743.94267 "0::[Pyrophosphate]::177.943225506::H4O7P2::[M+H+2Na]::HMDB0000250 | 0::[UNKNOWN]::177.943225506::H4O7P2::[M+H+2Na]::HMDB0155221 | 2::[1-Butanol]::74.073164942::C4H10O::[M+H]::HMDB0004327 | 2::[2-Methylpropan-2-ol]::74.073164942::C4H10O::[M+H]::HMDB0031456 | 2::[Isobutanol]::74.073164942::C4H10O::[M+H]::HMDB0006006" +4 76.03942694 51.23158899 "2::[L-Aspartic acid]::133.037507717::C4H7NO4::[M+H+NH4]::HMDB0000191 | 2::[UNKNOWN]::74.024751953::C2H4NO2::[M+H]::HMDB0161401 | 2::[Ethyl nitrite]::75.032028409::C2H5NO2::[M+H]::HMDB0031239 | 2::[1-deoxy-1-(N6-lysino)-D-fructose]::133.037507709::C4H7NO4::[M+H+NH4]::HMDB0062186 | 2::[N-acetyl-seryl-aspartate]::133.037507709::C4H7NO4::[M+H+NH4]::HMDB0062501" +5 76.07584477 50.51249853 "2::[3-aminopropan-1-ol]::75.068413915::C3H9NO::[M+H]::HMDB0140038 | 2::[2-(methylamino)ethan-1-ol]::75.068413914::C3H9NO::[M+H]::HMDB0142449 | 2::[Trimethylamine N-oxide]::75.068413915::C3H9NO::[M+H]::HMDB0000925 | 2::[1-Amino-propan-2-ol]::75.068413915::C3H9NO::[M+H]::HMDB0012136 | 2::[UNKNOWN]::133.110278727::C6H15NO2::[M+H+NH4]::HMDB0168716" +6 76.07593168 0.149308136 "3::[3-aminopropan-1-ol]::75.068413915::C3H9NO::[M+H]::HMDB0140038 | 3::[2-(methylamino)ethan-1-ol]::75.068413914::C3H9NO::[M+H]::HMDB0142449 | 3::[Trimethylamine N-oxide]::75.068413915::C3H9NO::[M+H]::HMDB0000925 | 3::[1-Amino-propan-2-ol]::75.068413915::C3H9NO::[M+H]::HMDB0012136 | 3::[UNKNOWN]::133.110278727::C6H15NO2::[M+H+NH4]::HMDB0168716" diff -r 3587cb923890 -r 625fa968d99a test-data/out_test02.txt --- a/test-data/out_test02.txt Tue Oct 02 04:59:13 2018 -0400 +++ b/test-data/out_test02.txt Thu Jan 10 09:10:14 2019 -0500 @@ -1,27 +1,27 @@ -ID Query(Da) Delta Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID -mz_00001 7.02080998 0 UNKNOWN N/A N/A N/A N/A N/A +ID Query(Da) Delta(ppm) Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID +mz_00001 7.02080998 68 [Beryllium] 9.012182135 Be [M+NH4-H2O] 7.02033 HMDB0002387 mz_00002 75.05547146 2 [N-Nitrosodimethylamine] 74.048012824 C2H6N2O [M+H] 75.055289 HMDB0031419 mz_00002 75.05547146 2 [Acetylhydrazine] 74.048012824 C2H6N2O [M+H] 75.055289 HMDB0060428 mz_00002 75.05547146 2 [glycinamide] 74.048012824 C2H6N2O [M+H] 75.055289 HMDB0062472 mz_00002 75.05547146 2 [Creatine] 131.069476547 C4H9N3O2 [M+H+NH4] 75.055288 HMDB0000064 mz_00002 75.05547146 2 [Beta-Guanidinopropionic acid] 131.069476547 C4H9N3O2 [M+H+NH4] 75.055288 HMDB0013222 +mz_00003 75.08059797 0 [Pyrophosphate] 177.943225506 H4O7P2 [M+H+2Na] 75.080599 HMDB0000250 mz_00003 75.08059797 0 [UNKNOWN] 177.943225506 H4O7P2 [M+H+2Na] 75.080599 HMDB0155221 mz_00003 75.08059797 2 [1-Butanol] 74.073164942 C4H10O [M+H] 75.080441 HMDB0004327 -mz_00003 75.08059797 2 [UNKNOWN] 74.073164942 C4H10O [M+H] 75.080441 HMDB0062103 -mz_00003 75.08059797 2 [1-hydroperoxy-8-carboxyoctyl 3,4-epoxynon-(2E)-enyl ether] 74.073164942 C4H10O [M+H] 75.080441 HMDB0062326 -mz_00003 75.08059797 2 [2-Butanol] 74.073164942 C4H10O [M+H] 75.080441 HMDB0011469 +mz_00003 75.08059797 2 [2-Methylpropan-2-ol] 74.073164942 C4H10O [M+H] 75.080441 HMDB0031456 +mz_00003 75.08059797 2 [Isobutanol] 74.073164942 C4H10O [M+H] 75.080441 HMDB0006006 mz_00004 76.03942694 2 [L-Aspartic acid] 133.037507717 C4H7NO4 [M+H+NH4] 76.039304 HMDB0000191 +mz_00004 76.03942694 2 [UNKNOWN] 74.024751953 C2H4NO2 [M+H] 76.039304 HMDB0161401 mz_00004 76.03942694 2 [Ethyl nitrite] 75.032028409 C2H5NO2 [M+H] 76.039304 HMDB0031239 mz_00004 76.03942694 2 [1-deoxy-1-(N6-lysino)-D-fructose] 133.037507709 C4H7NO4 [M+H+NH4] 76.039304 HMDB0062186 -mz_00004 76.03942694 2 [Glycine] 75.032028409 C2H5NO2 [M+H] 76.039304 HMDB0000123 -mz_00004 76.03942694 2 [Acetohydroxamic Acid] 75.032028409 C2H5NO2 [M+H] 76.039304 HMDB0014691 +mz_00004 76.03942694 2 [N-acetyl-seryl-aspartate] 133.037507709 C4H7NO4 [M+H+NH4] 76.039304 HMDB0062501 mz_00005 76.07584477 2 [3-aminopropan-1-ol] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0140038 -mz_00005 76.07584477 2 [1-Amino-propan-2-ol] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0012136 mz_00005 76.07584477 2 [2-(methylamino)ethan-1-ol] 75.068413914 C3H9NO [M+H] 76.07569 HMDB0142449 mz_00005 76.07584477 2 [Trimethylamine N-oxide] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0000925 -mz_00005 76.07584477 2 [Allyl alcohol] 58.041864814 C3H6O [M+NH4] 76.075688 HMDB0031652 +mz_00005 76.07584477 2 [1-Amino-propan-2-ol] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0012136 +mz_00005 76.07584477 2 [UNKNOWN] 133.110278727 C6H15NO2 [M+H+NH4] 76.075689 HMDB0168716 mz_00006 76.07593168 3 [3-aminopropan-1-ol] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0140038 -mz_00006 76.07593168 3 [1-Amino-propan-2-ol] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0012136 mz_00006 76.07593168 3 [2-(methylamino)ethan-1-ol] 75.068413914 C3H9NO [M+H] 76.07569 HMDB0142449 mz_00006 76.07593168 3 [Trimethylamine N-oxide] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0000925 -mz_00006 76.07593168 3 [Allyl alcohol] 58.041864814 C3H6O [M+NH4] 76.075688 HMDB0031652 +mz_00006 76.07593168 3 [1-Amino-propan-2-ol] 75.068413915 C3H9NO [M+H] 76.07569 HMDB0012136 +mz_00006 76.07593168 3 [UNKNOWN] 133.110278727 C6H15NO2 [M+H+NH4] 76.075689 HMDB0168716 diff -r 3587cb923890 -r 625fa968d99a test-data/out_test03.tabular --- a/test-data/out_test03.tabular Tue Oct 02 04:59:13 2018 -0400 +++ b/test-data/out_test03.tabular Thu Jan 10 09:10:14 2019 -0500 @@ -1,4 +1,4 @@ -ID Query(Da) Delta Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID +ID Query(Da) Delta(ppm) Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID mz_00001 175.01 0 [UNKNOWN] 500.026076369 C19H16O14S [M+2H+Na] 175.009949 HMDB0149376 mz_00001 175.01 0 [UNKNOWN] 500.026076369 C19H16O14S [M+2H+Na] 175.009949 HMDB0149375 mz_00001 175.01 0 [UNKNOWN] 500.026076369 C19H16O14S [M+2H+Na] 175.009949 HMDB0149391 diff -r 3587cb923890 -r 625fa968d99a test-data/out_test03.txt --- a/test-data/out_test03.txt Tue Oct 02 04:59:13 2018 -0400 +++ b/test-data/out_test03.txt Thu Jan 10 09:10:14 2019 -0500 @@ -1,4 +1,4 @@ -ID Query(Da) Delta Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID +ID Query(Da) Delta(ppm) Metabolite_Name Cpd_MW(Da) Formula Adduct Adduct_MW(Da) HMDB_ID mz_00001 175.01 0 [UNKNOWN] 500.026076369 C19H16O14S [M+2H+Na] 175.009949 HMDB0149376 mz_00001 175.01 0 [UNKNOWN] 500.026076369 C19H16O14S [M+2H+Na] 175.009949 HMDB0149375 mz_00001 175.01 0 [UNKNOWN] 500.026076369 C19H16O14S [M+2H+Na] 175.009949 HMDB0149391 diff -r 3587cb923890 -r 625fa968d99a wsdl_hmdb.pl --- a/wsdl_hmdb.pl Tue Oct 02 04:59:13 2018 -0400 +++ b/wsdl_hmdb.pl Thu Jan 10 09:10:14 2019 -0500 @@ -127,9 +127,16 @@ my $result = undef ; my ( $hmdb_masses, $nb_masses_to_submit ) = $oHmdb->prepare_multi_masses_query($mzs) ; $hmdb_pages = $oHmdb->get_matches_from_hmdb_ua($hmdb_masses, $delta, $molecular_species) ; + +# print Dumper $hmdb_pages ; + + sleep(2) ; + ($result) = $oHmdb->parse_hmdb_csv_results($hmdb_pages, $mzs, $max_query) ; ## hash format result ## This previous step return results with cutoff on the number of entries returned ! $results = [ @$results, @$result ] ; + + sleep(2) ; } ## foreach metabolite get its own metabocard diff -r 3587cb923890 -r 625fa968d99a wsdl_hmdb.xml --- a/wsdl_hmdb.xml Tue Oct 02 04:59:13 2018 -0400 +++ b/wsdl_hmdb.xml Thu Jan 10 09:10:14 2019 -0500 @@ -1,6 +1,6 @@ - search by masses on HMDB online bank + search by masses on HMDB online LCMS bank @@ -92,9 +92,9 @@ - + + + + --> + - @@ -147,6 +149,7 @@ **Please cite** If you use this tool, please add the following reference | Wishart DS, Jewison T, Guo AC, Wilson M, Knox C, et al., HMDB 3.0 — The Human Metabolome Database in 2013. Nucleic Acids Res. 2013. + | Wishart DS, Feunang YD, Marcu A, Guo AC, Liang K, et al., HMDB 4.0 — The Human Metabolome Database for 2018. Nucleic Acids Res. 2018. --------------------------------------------------- @@ -271,7 +274,7 @@ .. class:: warningmark -And their "W4M courses 2015": +And their "W4M courses 2018": | Using Galaxy4Metabolomics - W4M table format for Galaxy | Annotation Banks - Annotation @@ -280,5 +283,6 @@ 10.1093/nar/gks1065 + 10.1093/nar/gkx1089 \ No newline at end of file