# HG changeset patch # User fgiacomoni # Date 1695817260 0 # Node ID 76872ac24fb24e48cd963b8a1f06a47e12c8bb71 # Parent 8f7546d0b925f19e650b6e7fd8493f538013d428 master branch Updating with tag :CI_COMMIT_TAG - - Fxx diff -r 8f7546d0b925 -r 76872ac24fb2 Dockerfile --- a/Dockerfile Tue Jul 05 12:39:15 2022 +0000 +++ b/Dockerfile Wed Sep 27 12:21:00 2023 +0000 @@ -1,4 +1,4 @@ -#FROM pfem/perlfull +#FROM pfem/< FROM python:3.8-buster # set author @@ -28,7 +28,6 @@ pip install --upgrade pip setuptools && \ pip install planemo numpy && \ pip install -U planemo && \ - #planemo conda_init --conda_prefix "$CONDA" && \ apt-get autoremove -y && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ diff -r 8f7546d0b925 -r 76872ac24fb2 lib/hmdb.pm --- a/lib/hmdb.pm Tue Jul 05 12:39:15 2022 +0000 +++ b/lib/hmdb.pm Wed Sep 27 12:21:00 2023 +0000 @@ -14,6 +14,8 @@ use HTML::Template ; use XML::Twig ; use Text::CSV ; +use URI::Encode ; +use open qw( :std :encoding(UTF-8) ); use Data::Dumper ; @@ -169,9 +171,16 @@ $nbAdducts = scalar( my @adducts = ( split (/,/, $adductString) ) ) ; ## Converting string into http post format - $adductString =~ s/\+/%2B/g ; - $adductString =~ s/,/%20/g ; - $formattedAdductString = $adductString ; +# $adductString =~ s/\+/%2B/g ; +# $adductString =~ s/,/%20/g ; +# $formattedAdductString = $adductString ; + + my $uri = URI::Encode->new( { encode_reserved => 1 } ); + foreach my $adduct (@adducts) { + # &results%5Badduct_type%5D%5B%5D=M%2BH&results%5Badduct_type%5D%5B%5D=M%2BNH4-H2O&results%5Badduct_type%5D%5B%5D=M%2BNa + my $EncodedAdduct = $uri->encode($adduct); + $formattedAdductString .= '&results%5Badduct_type%5D%5B%5D='.$EncodedAdduct ; + } } else { warn "\t[WARN]the adduct type is not defined...It will set to 'Unknown'\n" ; @@ -640,16 +649,19 @@ $mech->add_header('Referer', 'https://www.hmdb.ca/spectra/ms/search'); $mech->add_header('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'); } - ## adduct format is adduct_type=M%2BH%202M%2BH - if ( (!defined $adducts) or ( $adducts eq '') ) { $adducts = 'Unknown' ; } + #&results%5Badduct_type%5D%5B%5D=M%2BH&results%5Badduct_type%5D%5B%5D=M%2BNH4-H2O&results%5Badduct_type%5D%5B%5D=M%2BNa + # Query + #https://hmdb.ca/spectra/ms/generate_csv.csv?results%5Baction%5D=search&results%5Badduct_type%5D%5B%5D=M%2BH&results%5Badduct_type%5D%5B%5D=M%2BNH4-H2O&results%5Badduct_type%5D%5B%5D=M%2BNa&results%5Bauthenticity_token%5D=uN4r4Xme0bl5Lj%2Buv%2BrjebgrdF0oFO7mfxg0T7mHFlHcUSDkVAd%2BRB3qQDzm5fdz3BV4kKX%2F1i2uLOOdvBgK%2FA%3D%3D&results%5Bccs_predictors%5D=&results%5Bccs_tolerance%5D=&results%5Bcommit%5D=Search&results%5Bcontroller%5D=specdb%2Fms&results%5Bms_search_ion_mode%5D=positive&results%5Bquery_masses%5D=175.01&results%5Btolerance%5D=0.05&results%5Btolerance_units%5D=Da&results%5Butf8%5D=%E2%9C%93 + #&results%5Badduct_type%5D%5B%5D=M%2BH&results%5Badduct_type%5D%5B%5D=M%2BNH4-H2O&results%5Badduct_type%5D%5B%5D=M%2BNa my $res = $mech->get( 'https://hmdb.ca/spectra/ms/generate_csv.csv?' .'results%5Baction%5D=search' - .'&results%5Badduct_type%5D%5B%5D='.$adducts + #.'&results%5Badduct_type%5D%5B%5D='.$adducts + .$adducts #.'&results%5Bauthenticity_token%5D=' .'&results%5Bccs_predictors%5D=' .'&results%5Bccs_tolerance%5D=' diff -r 8f7546d0b925 -r 76872ac24fb2 test-data/out_test04.html --- a/test-data/out_test04.html Tue Jul 05 12:39:15 2022 +0000 +++ b/test-data/out_test04.html Wed Sep 27 12:21:00 2023 +0000 @@ -1,1 +1,1 @@ -
ID from input | Mass (m/z) | Metabolite_Name | Compound_ID | Formula | Compound MW (Da) | Adduct | Adduct type | Adduct MW (Da) | Delta (ppm) | InChI Identifier | Predicted LogP (ALOGPS) |
---|---|---|---|---|---|---|---|---|---|---|---|
mz_00001 | 175.01 | ||||||||||
4-Hydrazinylpyridine-3-carboxamide | HMDB0258083 | C6H8N4O | 152.069810894 | M+Na | + | 175.059029 | 280 | NONEDATA | NONEDATA | ||
9-Sulfanylpurine | HMDB0257842 | C5H4N4S | 152.015667319 | M+Na | + | 175.004885 | 29 | NONEDATA | NONEDATA | ||
S-Phenyl thioacetate | HMDB0257424 | C8H8OS | 152.029586052 | M+Na | + | 175.018804 | 50 | NONEDATA | NONEDATA | ||
"n-methyl-6-oxo-1,6-dihydropyridine-3-carboxamide" | HMDB0255171 | C7H8N2O2 | 152.058577506 | M+Na | + | 175.047796 | 216 | NONEDATA | NONEDATA | ||
Methyl pyridone carboxamide | HMDB0254609 | C7H8N2O2 | 152.058577506 | M+Na | + | 175.047796 | 216 | NONEDATA | NONEDATA | ||
mz_00002 | 238.19 | ||||||||||
Ethyl butylacetylaminopropionate | HMDB0246904 | C11H21NO3 | 215.15214354 | M+Na | + | 238.141362 | 204 | NONEDATA | NONEDATA | ||
Hexaminolevulinate | HMDB0253144 | C11H21NO3 | 215.15214354 | M+Na | + | 238.141362 | 204 | NONEDATA | NONEDATA | ||
ω-hydroxylaurate | HMDB0304547 | C12H23O3 | 215.165268181 | M+Na | + | 238.154486 | 149 | NONEDATA | NONEDATA | ||
Diethylcarbamazine N-oxide | HMDB0060817 | C10H21N3O2 | 215.163376931 | M+Na | + | 238.152595 | 157 | NONEDATA | NONEDATA | ||
N-Nonanoylglycine | HMDB0013279 | C11H21NO3 | 215.152143543 | M+Na | + | 238.141362 | 204 | NONEDATA | NONEDATA | ||
mz_00003 | 420.16 | ||||||||||
"N-Acetyl-9-aminominocycline, (4R)-" | HMDB0259457 | C20H31NO7 | 397.210052342 | M+Na | + | 420.19927 | 93 | NONEDATA | NONEDATA | ||
Reduced ketanserin | HMDB0257133 | C22H24FN3O3 | 397.180169808 | M+Na | + | 420.169388 | 22 | NONEDATA | NONEDATA | ||
"1,2,4-Triazolo(4,3-b)pyridazine, 7-cyclobutyl-3-(2,6-difluorophenyl)-6-((1-methyl-1H-1,2,4-triazol-5-yl)methoxy)-" | HMDB0254773 | C19H17F2N7O | 397.146264521 | M+Na | + | 420.135483 | 58 | NONEDATA | NONEDATA | ||
6-[[3-Fluoro-5-(4-methoxyoxan-4-yl)phenoxy]methyl]-1-methylquinolin-2-one | HMDB0253359 | C23H24FNO4 | 397.16893642 | M+Na | + | 420.158154 | 4 | NONEDATA | NONEDATA | ||
CI-1044 | HMDB0250223 | C23H19N5O2 | 397.153874872 | M+Na | + | 420.143093 | 40 | NONEDATA | NONEDATA | ||
mz_00004 | 780.32 | ||||||||||
Vaniprevir | HMDB0259762 | C38H55N5O9S | 757.372049545 | M+Na | + | 780.361268 | 53 | NONEDATA | NONEDATA | ||
mz_00005 | 956.25 | ||||||||||
undec-10-enoyl-CoA | HMDB0300959 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
Undec-8-enoyl-CoA | HMDB0300958 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
Undec-9-enoyl-CoA | HMDB0300957 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
Undec-3-enoyl-CoA | HMDB0300956 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
(7E)-Undec-7-enoyl-CoA | HMDB0300955 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
mz_00006 | 1100.45 | ||||||||||
UNKNOWN | NONE | n/a | n/a | n/a | n/a | n/a | 0 | n/a | n/a |
ID from input | Mass (m/z) | Metabolite_Name | Compound_ID | Formula | Compound MW (Da) | Adduct | Adduct type | Adduct MW (Da) | Delta (ppm) | InChI Identifier | Predicted LogP (ALOGPS) |
---|---|---|---|---|---|---|---|---|---|---|---|
mz_00001 | 175.01 | ||||||||||
DL-Isocitric acid lactone | HMDB0341313 | C6H6O6 | 174.016437913 | M+H | + | 175.023714 | 78 | NONEDATA | NONEDATA | ||
Pyridin-3-yl sulfate | HMDB0304907 | C5H4NO4S | 173.986652367 | M+NH4-H2O | + | 175.016628 | 38 | NONEDATA | NONEDATA | ||
Trinitrosotrimethylenetriamine | HMDB0259249 | C3H6N6O3 | 174.050138077 | M+H | + | 175.057414 | 271 | NONEDATA | NONEDATA | ||
Semidehydroascorbic acid | HMDB0258226 | C6H7O6 | 175.024262945 | M+NH4-H2O | + | 175.046963 | 211 | NONEDATA | NONEDATA | ||
"Naphthalene-1,2,4-trione" | HMDB0257698 | C10H6O3 | 174.031694053 | M+H | + | 175.03897 | 166 | NONEDATA | NONEDATA | ||
mz_00002 | 238.19 | ||||||||||
"N,N-di-n-propyldopamine" | HMDB0255249 | C14H23NO2 | 237.172878985 | M+H | + | 238.180155 | 41 | NONEDATA | NONEDATA | ||
Deacetylmoxisylyte | HMDB0250903 | C14H23NO2 | 237.172878985 | M+H | + | 238.180155 | 41 | NONEDATA | NONEDATA | ||
"(2E,4E)-pentadeca-2,4-dienoic acid" | HMDB0340866 | C15H26O2 | 238.193280077 | M+NH4-H2O | + | 238.21598 | 109 | NONEDATA | NONEDATA | ||
"(6Z,9Z)-pentadeca-6,9-dienoic acid" | HMDB0340865 | C15H26O2 | 238.193280077 | M+NH4-H2O | + | 238.21598 | 109 | NONEDATA | NONEDATA | ||
"(3Z,5Z)-pentadeca-3,5-dienoic acid" | HMDB0340864 | C15H26O2 | 238.193280077 | M+NH4-H2O | + | 238.21598 | 109 | NONEDATA | NONEDATA | ||
mz_00003 | 420.16 | ||||||||||
Tapentadol-beta-D-glucuronide | HMDB0341397 | C20H31NO7 | 397.210052342 | M+Na | + | 420.19927 | 93 | NONEDATA | NONEDATA | ||
"10-Chloro-1-[(3S)-3-hydroxypyrrolidine-1-carbonyl]-3-phenyl-6,7-dihydrobenzo[a]quinolizin-4-one" | HMDB0259567 | C24H21ClN2O3 | 420.1240702 | M+NH4-H2O | + | 420.14677 | 31 | NONEDATA | NONEDATA | ||
"N-Acetyl-9-aminominocycline, (4R)-" | HMDB0259457 | C20H31NO7 | 397.210052342 | M+Na | + | 420.19927 | 93 | NONEDATA | NONEDATA | ||
Pglu-his-pro-gly; Gly-thyrotropin-releasing hormone | HMDB0259129 | C18H24N6O6 | 420.175732517 | M+NH4-H2O | + | 420.198433 | 91 | NONEDATA | NONEDATA | ||
Reduced ketanserin | HMDB0257133 | C22H24FN3O3 | 397.180169808 | M+Na | + | 420.169388 | 22 | NONEDATA | NONEDATA | ||
mz_00004 | 780.32 | ||||||||||
Vaniprevir | HMDB0259762 | C38H55N5O9S | 757.372049545 | M+Na | + | 780.361268 | 53 | NONEDATA | NONEDATA | ||
Ravtansine | HMDB0247402 | C38H54ClN3O10S | 779.3218438 | M+H | + | 780.32912 | 12 | NONEDATA | NONEDATA | ||
2-Hydroxypropyl starch | HMDB0303342 | C31H56O22 | 780.326323443 | M+NH4-H2O | + | 780.349023 | 37 | NONEDATA | NONEDATA | ||
"N,N'-Diacetylchitobiosyldiphosphodolichol" | HMDB0001196 | C28H50N2O19P2 | 780.248300452 | M+NH4-H2O | + | 780.271 | 63 | NONEDATA | NONEDATA | ||
3'-Sialyl-3-fucosyllactose | HMDB0006606 | C29H49NO23 | 779.269536879 | M+H | + | 780.276813 | 55 | NONEDATA | NONEDATA | ||
mz_00005 | 956.25 | ||||||||||
undec-10-enoyl-CoA | HMDB0300959 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
Undec-8-enoyl-CoA | HMDB0300958 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
Undec-9-enoyl-CoA | HMDB0300957 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
Undec-3-enoyl-CoA | HMDB0300956 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
(7E)-Undec-7-enoyl-CoA | HMDB0300955 | C32H54N7O17P3S | 933.250975475 | M+Na | + | 956.240193 | 10 | NONEDATA | NONEDATA | ||
mz_00006 | 1100.45 | ||||||||||
UNKNOWN | NONE | n/a | n/a | n/a | n/a | n/a | 0 | n/a | n/a |