# 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 resultsResults of HMDB queries - Search params : Molecular specie = positive / delta (mass-to-charge ratio) = 0.001
ID from input | Mass (m/z) | Metabolite_Name | Compound_ID | Formula | Compound MW (Da) | Adduct | Adduct_Type | Adduct MW (Da) | Delta | InChI Identifier | Predicted LogP (ALOGPS) | mz_00001 | 7.02080998 | |
| UNKNOWN | NONE | n/a | n/a | n/a | n/a | n/a | 0 | n/a | n/a |
mz_00002 | 75.05547146 | |
| N-Nitrosodimethylamine | HMDB0031419 | C2H6N2O | 74.048012824 | M+H | + | 75.055289 | 2 | InChI=1S/C2H6N2O/c1-4(2)3-5/h1-2H3 | -0.53 |
| Acetylhydrazine | HMDB0060428 | C2H6N2O | 74.048012824 | M+H | + | 75.055289 | 2 | InChI=1S/C2H6N2O/c1-2(5)4-3/h3H2,1H3,(H,4,5) | -0.78 |
| glycinamide | HMDB0062472 | C2H6N2O | 74.048012824 | M+H | + | 75.055289 | 2 | InChI=1S/C2H6N2O/c3-1-2(4)5/h1,3H2,(H2,4,5) | -2.49 |
| Creatine | HMDB0000064 | C4H9N3O2 | 131.069476547 | M+H+NH4 | + | 75.055288 | 2 | InChI=1S/C4H9N3O2/c1-7(4(5)6)2-3(8)9/h2H2,1H3,(H3,5,6)(H,8,9) | -1.59 |
| Beta-Guanidinopropionic acid | HMDB0013222 | C4H9N3O2 | 131.069476547 | M+H+NH4 | + | 75.055288 | 2 | InChI=1S/C4H9N3O2/c5-4(6)7-2-1-3(8)9/h1-2H2,(H,8,9)(H4,5,6,7) | -1.70 |
mz_00003 | 75.08059797 | |
| UNKNOWN | HMDB0155221 | H4O7P2 | 177.943225506 | M+H+2Na | + | 75.080599 | 0 | NA | NA |
| 1-Butanol | HMDB0004327 | C4H10O | 74.073164942 | M+H | + | 75.080441 | 2 | InChI=1S/C4H10O/c1-2-3-4-5/h5H,2-4H2,1H3 | 0.84 |
| UNKNOWN | HMDB0062103 | C4H10O | 74.073164942 | M+H | + | 75.080441 | 2 | NA | NA |
| 1-hydroperoxy-8-carboxyoctyl 3,4-epoxynon-(2E)-enyl ether | HMDB0062326 | C4H10O | 74.073164942 | M+H | + | 75.080441 | 2 | InChI=1S/C4H10O/c1-3-5-4-2/h3-4H2,1-2H3 | 1.12 |
| 2-Butanol | HMDB0011469 | C4H10O | 74.073164942 | M+H | + | 75.080441 | 2 | InChI=1S/C4H10O/c1-3-4(2)5/h4-5H,3H2,1-2H3 | 0.66 |
mz_00004 | 76.03942694 | |
| L-Aspartic acid | HMDB0000191 | C4H7NO4 | 133.037507717 | M+H+NH4 | + | 76.039304 | 2 | InChI=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 nitrite | HMDB0031239 | C2H5NO2 | 75.032028409 | M+H | + | 76.039304 | 2 | InChI=1S/C2H5NO2/c1-2-5-3-4/h2H2,1H3 | 0.42 |
| 1-deoxy-1-(N6-lysino)-D-fructose | HMDB0062186 | C4H7NO4 | 133.037507709 | M+H+NH4 | + | 76.039304 | 2 | InChI=1S/C4H7NO4/c5-2(4(8)9)1-3(6)7/h2H,1,5H2,(H,6,7)(H,8,9) | -3.52 |
| Glycine | HMDB0000123 | C2H5NO2 | 75.032028409 | M+H | + | 76.039304 | 2 | InChI=1S/C2H5NO2/c3-1-2(4)5/h1,3H2,(H,4,5) | -3.34 |
| Acetohydroxamic Acid | HMDB0014691 | C2H5NO2 | 75.032028409 | M+H | + | 76.039304 | 2 | InChI=1S/C2H5NO2/c1-2(4)3-5/h5H,1H3,(H,3,4) | -1.46 |
mz_00005 | 76.07584477 | |
| 3-aminopropan-1-ol | HMDB0140038 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2 | -1.01 |
| 1-Amino-propan-2-ol | HMDB0012136 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3 | -1.03 |
| 2-(methylamino)ethan-1-ol | HMDB0142449 | C3H9NO | 75.068413914 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3 | -1.05 |
| Trimethylamine N-oxide | HMDB0000925 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3 | -2.01 |
| Allyl alcohol | HMDB0031652 | C3H6O | 58.041864814 | M+NH4 | + | 76.075688 | 2 | InChI=1S/C3H6O/c1-2-3-4/h2,4H,1,3H2 | -0.03 |
mz_00006 | 76.07593168 | |
| 3-aminopropan-1-ol | HMDB0140038 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2 | -1.01 |
| 1-Amino-propan-2-ol | HMDB0012136 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3 | -1.03 |
| 2-(methylamino)ethan-1-ol | HMDB0142449 | C3H9NO | 75.068413914 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3 | -1.05 |
| Trimethylamine N-oxide | HMDB0000925 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3 | -2.01 |
| Allyl alcohol | HMDB0031652 | C3H6O | 58.041864814 | M+NH4 | + | 76.075688 | 3 | InChI=1S/C3H6O/c1-2-3-4/h2,4H,1,3H2 | -0.03 |
\ No newline at end of file
+Galaxy HMDB queries - All resultsResults of HMDB queries - Search params : Molecular specie = positive / delta (mass-to-charge ratio) = 0.001
ID from input | Mass (m/z) | Metabolite_Name | Compound_ID | Formula | Compound MW (Da) | Adduct | Adduct_Type | Adduct MW (Da) | Delta | InChI Identifier | Predicted LogP (ALOGPS) | mz_00001 | 7.02080998 | |
| Beryllium | HMDB0002387 | Be | 9.012182135 | M+NH4-H2O | + | 7.02033 | 68 | InChI=1S/Be/q+2 | NA |
mz_00002 | 75.05547146 | |
| N-Nitrosodimethylamine | HMDB0031419 | C2H6N2O | 74.048012824 | M+H | + | 75.055289 | 2 | InChI=1S/C2H6N2O/c1-4(2)3-5/h1-2H3 | -0.53 |
| Acetylhydrazine | HMDB0060428 | C2H6N2O | 74.048012824 | M+H | + | 75.055289 | 2 | InChI=1S/C2H6N2O/c1-2(5)4-3/h3H2,1H3,(H,4,5) | -0.78 |
| glycinamide | HMDB0062472 | C2H6N2O | 74.048012824 | M+H | + | 75.055289 | 2 | InChI=1S/C2H6N2O/c3-1-2(4)5/h1,3H2,(H2,4,5) | -2.49 |
| Creatine | HMDB0000064 | C4H9N3O2 | 131.069476547 | M+H+NH4 | + | 75.055288 | 2 | InChI=1S/C4H9N3O2/c1-7(4(5)6)2-3(8)9/h2H2,1H3,(H3,5,6)(H,8,9) | -1.59 |
| Beta-Guanidinopropionic acid | HMDB0013222 | C4H9N3O2 | 131.069476547 | M+H+NH4 | + | 75.055288 | 2 | InChI=1S/C4H9N3O2/c5-4(6)7-2-1-3(8)9/h1-2H2,(H,8,9)(H4,5,6,7) | -1.70 |
mz_00003 | 75.08059797 | |
| Pyrophosphate | HMDB0000250 | H4O7P2 | 177.943225506 | M+H+2Na | + | 75.080599 | 0 | InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6) | NA |
| UNKNOWN | HMDB0155221 | H4O7P2 | 177.943225506 | M+H+2Na | + | 75.080599 | 0 | NA | NA |
| 1-Butanol | HMDB0004327 | C4H10O | 74.073164942 | M+H | + | 75.080441 | 2 | InChI=1S/C4H10O/c1-2-3-4-5/h5H,2-4H2,1H3 | 0.84 |
| 2-Methylpropan-2-ol | HMDB0031456 | C4H10O | 74.073164942 | M+H | + | 75.080441 | 2 | InChI=1S/C4H10O/c1-4(2,3)5/h5H,1-3H3 | 0.70 |
| Isobutanol | HMDB0006006 | C4H10O | 74.073164942 | M+H | + | 75.080441 | 2 | InChI=1S/C4H10O/c1-4(2)3-5/h4-5H,3H2,1-2H3 | 0.60 |
mz_00004 | 76.03942694 | |
| L-Aspartic acid | HMDB0000191 | C4H7NO4 | 133.037507717 | M+H+NH4 | + | 76.039304 | 2 | InChI=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 |
| UNKNOWN | HMDB0161401 | C2H4NO2 | 74.024751953 | M+H | + | 76.039304 | 2 | NA | NA |
| Ethyl nitrite | HMDB0031239 | C2H5NO2 | 75.032028409 | M+H | + | 76.039304 | 2 | InChI=1S/C2H5NO2/c1-2-5-3-4/h2H2,1H3 | 0.42 |
| 1-deoxy-1-(N6-lysino)-D-fructose | HMDB0062186 | C4H7NO4 | 133.037507709 | M+H+NH4 | + | 76.039304 | 2 | InChI=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-aspartate | HMDB0062501 | C4H7NO4 | 133.037507709 | M+H+NH4 | + | 76.039304 | 2 | InChI=1S/C4H7NO4/c5-2(4(8)9)1-3(6)7/h2H,1,5H2,(H,6,7)(H,8,9) | -3.52 |
mz_00005 | 76.07584477 | |
| 3-aminopropan-1-ol | HMDB0140038 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2 | -1.01 |
| 2-(methylamino)ethan-1-ol | HMDB0142449 | C3H9NO | 75.068413914 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3 | -1.05 |
| Trimethylamine N-oxide | HMDB0000925 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3 | -2.01 |
| 1-Amino-propan-2-ol | HMDB0012136 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 2 | InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3 | -1.03 |
| UNKNOWN | HMDB0168716 | C6H15NO2 | 133.110278727 | M+H+NH4 | + | 76.075689 | 2 | NA | NA |
mz_00006 | 76.07593168 | |
| 3-aminopropan-1-ol | HMDB0140038 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c4-2-1-3-5/h5H,1-4H2 | -1.01 |
| 2-(methylamino)ethan-1-ol | HMDB0142449 | C3H9NO | 75.068413914 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c1-4-2-3-5/h4-5H,2-3H2,1H3 | -1.05 |
| Trimethylamine N-oxide | HMDB0000925 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c1-4(2,3)5/h1-3H3 | -2.01 |
| 1-Amino-propan-2-ol | HMDB0012136 | C3H9NO | 75.068413915 | M+H | + | 76.07569 | 3 | InChI=1S/C3H9NO/c1-3(5)2-4/h3,5H,2,4H2,1H3 | -1.03 |
| UNKNOWN | HMDB0168716 | C6H15NO2 | 133.110278727 | M+H+NH4 | + | 76.075689 | 3 | NA | NA |
\ 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