Mercurial > repos > fgiacomoni > hmdb_ms_search
annotate t/hmdb_managerTest.pl @ 1:6d0a0f8f672a draft
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
author | fgiacomoni |
---|---|
date | Wed, 23 Nov 2016 09:31:50 -0500 |
parents | |
children | 6091a80df951 |
rev | line source |
---|---|
1
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
1 #! perl |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
2 use diagnostics; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
3 use warnings; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
4 no warnings qw/void/; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
5 use strict; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
6 no strict "refs" ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
7 use Test::More qw( no_plan ); |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
8 use Test::Exception; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
9 use FindBin ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
10 use Carp ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
11 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
12 ## Specific Modules |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
13 use lib $FindBin::Bin ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
14 my $binPath = $FindBin::Bin ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
15 use lib::hmdbTest qw( :ALL ) ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
16 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
17 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
18 ## To launch the right sequence : API, MAPPER, THREADER, ... |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
19 #my $sequence = 'MAPPER' ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
20 my $sequence = 'MAIN' ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
21 my $current_test = 1 ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
22 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
23 if ($sequence eq "MAIN") { |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
24 print "\n\t\t\t\t * * * * * * \n" ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
25 print "\t * * * - - - Test HMDB Main script - - - * * * \n\n" ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
26 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
27 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
28 print "\n** Test $current_test extract_sub_mz_lists with an empty list of mzs **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
29 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
30 throws_ok{ extract_sub_mz_listsTest([], 3)} '/The provided mzs list is empty/', 'Method \'extract_sub_mz_lists\' detects empty argument and died correctly' ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
31 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
32 print "\n** Test $current_test extract_sub_mz_lists with a list of mzs and a limit of 3 **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
33 is_deeply( extract_sub_mz_listsTest( |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
34 ['175.01', '238.19', '420.16', '780.32', '956.25', '1100.45' ], 3), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
35 [ [ '175.01', '238.19', '420.16' ], [ '780.32', '956.25', '1100.45' ] ], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
36 'Method \'extract_sub_mz_lists\' works with a list and return a well formated list of sublist of mzs'); |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
37 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
38 print "\n** Test $current_test prepare_multi_masses_query with an empty list of mzs **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
39 throws_ok{ prepare_multi_masses_queryTest([])} '/The input method parameter mass list is empty/', 'Method \'prepare_multi_masses_query\' detects empty argument and died correctly' ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
40 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
41 print "\n** Test $current_test prepare_multi_masses_query with a list of mzs **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
42 is_deeply( prepare_multi_masses_queryTest( |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
43 ['175.01', '238.19', '420.16', '780.32', '956.25', '1100.45' ] ), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
44 '175.01%0D%0A238.19%0D%0A420.16%0D%0A780.32%0D%0A956.25%0D%0A1100.45%0D%0A', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
45 'Method \'prepare_multi_masses_query\' works with a list of and return a well formated string for hmdb querying'); |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
46 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
47 print "\n** Test $current_test get_matches_from_hmdb_ua with a well-formated string of mzs **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
48 is_deeply( get_matches_from_hmdb_uaTest( |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
49 '175.01%0D%0A420.16%0D%0A780.32%0D%0A956.25%0D%0A1100.45%0D%0A', 0.001, 'positive'), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
50 [ |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
51 'query_mass,compound_id,formula,compound_mass,adduct,adduct_type,adduct_mass,delta', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
52 '175.01,HMDB60293,H2O3S2,113.94453531,M+IsoProp+H,+,175.009875,0.000125', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
53 '175.01,HMDB03745,C2H6O3S2,141.975835438,M+CH3OH+H,+,175.009324,0.000676', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
54 '175.01,HMDB31436,H4O4Si,95.987885149,M+DMSO+H,+,175.009105,0.000895', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
55 '175.01,HMDB33657,C17H10O6,310.047738052,M+H+K,+,175.009086,0.000914', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
56 '175.01,HMDB35230,C17H10O6,310.047738052,M+H+K,+,175.009086,0.000914', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
57 '420.16,HMDB60838,C17H17N3O4S,359.093976737,M+IsoProp+H,+,420.159317,0.000683', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
58 '420.16,HMDB60836,C17H17N3O4S,359.093976737,M+IsoProp+H,+,420.159317,0.000683' |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
59 ], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
60 'Method \'get_matches_from_hmdb_ua\' works with a well-formated string of mzs and return a complete csv from hmdb'); |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
61 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
62 print "\n** Test $current_test test_matches_from_hmdb_ua to get hmdb status **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
63 is_deeply (test_matches_from_hmdb_uaTest (), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
64 \'200', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
65 'The HMDB server is available: returns successful HTTP requests' ) ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
66 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
67 print "\n** Test $current_test check_state_from_hmdb_ua to manage script execution with the hmdb server status **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
68 is_deeply (check_state_from_hmdb_uaTest (\'200'), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
69 1, |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
70 'The status 200 returns no error/warn' ) ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
71 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
72 print "\n** Test $current_test prepare_multi_masses_query with an empty list of mzs **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
73 throws_ok{ check_state_from_hmdb_uaTest(\'504')} |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
74 '/Gateway Timeout: The HMDB server was acting as a gateway or proxy and did not receive a timely response from the upstream server/', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
75 'Method \'check_state_from_hmdb_ua\' detects HTTP error code returned by HMDB and died correctly' ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
76 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
77 print "\n** Test $current_test parse_hmdb_csv_results with the correct inputs for hmdb outputs parsing (csv format) **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
78 is_deeply ( parse_hmdb_csv_resultsTest ( |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
79 [ |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
80 'query_mass,compound_id,formula,compound_mass,adduct,adduct_type,adduct_mass,delta', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
81 '175.01,HMDB60293,H2O3S2,113.94453531,M+IsoProp+H,+,175.009875,0.000125', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
82 '175.01,HMDB03745,C2H6O3S2,141.975835438,M+CH3OH+H,+,175.009324,0.000676', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
83 '175.01,HMDB31436,H4O4Si,95.987885149,M+DMSO+H,+,175.009105,0.000895', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
84 '175.01,HMDB33657,C17H10O6,310.047738052,M+H+K,+,175.009086,0.000914', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
85 '175.01,HMDB35230,C17H10O6,310.047738052,M+H+K,+,175.009086,0.000914', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
86 '420.16,HMDB60838,C17H17N3O4S,359.093976737,M+IsoProp+H,+,420.159317,0.000683', |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
87 '420.16,HMDB60836,C17H17N3O4S,359.093976737,M+IsoProp+H,+,420.159317,0.000683' |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
88 ], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
89 ['175.01', '238.19', '420.16'] |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
90 ), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
91 [ |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
92 [ |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
93 { 'ENTRY_ADDUCT' => 'M+IsoProp+H', 'ENTRY_DELTA' => '0.000125', 'ENTRY_ADDUCT_TYPE' => '+', 'ENTRY_FORMULA' => 'H2O3S2', 'ENTRY_ENTRY_ID' => 'HMDB60293', 'ENTRY_ADDUCT_MZ' => '175.009875', 'ENTRY_CPD_MZ' => '113.94453531' }, |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
94 { 'ENTRY_ADDUCT' => 'M+CH3OH+H', 'ENTRY_ADDUCT_TYPE' => '+', 'ENTRY_DELTA' => '0.000676', 'ENTRY_FORMULA' => 'C2H6O3S2', 'ENTRY_ENTRY_ID' => 'HMDB03745', 'ENTRY_ADDUCT_MZ' => '175.009324', 'ENTRY_CPD_MZ' => '141.975835438' }, |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
95 { 'ENTRY_CPD_MZ' => '95.987885149', 'ENTRY_FORMULA' => 'H4O4Si', 'ENTRY_ENTRY_ID' => 'HMDB31436', 'ENTRY_ADDUCT_MZ' => '175.009105', 'ENTRY_DELTA' => '0.000895', 'ENTRY_ADDUCT_TYPE' => '+', 'ENTRY_ADDUCT' => 'M+DMSO+H' }, |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
96 { 'ENTRY_ADDUCT_TYPE' => '+', 'ENTRY_DELTA' => '0.000914', 'ENTRY_ADDUCT' => 'M+H+K', 'ENTRY_CPD_MZ' => '310.047738052', 'ENTRY_ENTRY_ID' => 'HMDB33657', 'ENTRY_ADDUCT_MZ' => '175.009086', 'ENTRY_FORMULA' => 'C17H10O6' }, |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
97 { 'ENTRY_ADDUCT' => 'M+H+K', 'ENTRY_DELTA' => '0.000914', 'ENTRY_ADDUCT_TYPE' => '+', 'ENTRY_FORMULA' => 'C17H10O6', 'ENTRY_ADDUCT_MZ' => '175.009086', 'ENTRY_ENTRY_ID' => 'HMDB35230', 'ENTRY_CPD_MZ' => '310.047738052' } |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
98 ], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
99 [], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
100 [ |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
101 { 'ENTRY_ADDUCT' => 'M+IsoProp+H', 'ENTRY_ADDUCT_TYPE' => '+', 'ENTRY_DELTA' => '0.000683', 'ENTRY_ENTRY_ID' => 'HMDB60838', 'ENTRY_ADDUCT_MZ' => '420.159317', 'ENTRY_FORMULA' => 'C17H17N3O4S', 'ENTRY_CPD_MZ' => '359.093976737' }, |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
102 { 'ENTRY_CPD_MZ' => '359.093976737', 'ENTRY_FORMULA' => 'C17H17N3O4S', 'ENTRY_ENTRY_ID' => 'HMDB60836', 'ENTRY_ADDUCT_MZ' => '420.159317', 'ENTRY_ADDUCT_TYPE' => '+', 'ENTRY_DELTA' => '0.000683', 'ENTRY_ADDUCT' => 'M+IsoProp+H' } |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
103 ] |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
104 ], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
105 'Method \'parse_hmdb_csv_results\' works with a well-formated csv output and returns a a well formated array' ) ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
106 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
107 print "\n** Test $current_test parse_hmdb_csv_results with a void hmdb output and a list of mzs **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
108 is_deeply ( parse_hmdb_csv_resultsTest ( [], ['175.01', '238.19', '420.16'] ), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
109 [ [], [], [] ], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
110 'Method \'parse_hmdb_csv_results\' works with a empty csv output and returns an empty but well formatted array' ) ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
111 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
112 print "\n** Test $current_test parse_hmdb_csv_results with a void hmdb output and a void mz list **\n" ; $current_test++; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
113 is_deeply ( parse_hmdb_csv_resultsTest ( [], [] ), |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
114 [], |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
115 'Method \'parse_hmdb_csv_results\' works with a empty csv output/mz list and returns an empty but well formatted array' ) ; |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
116 } |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
117 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
118 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
119 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
120 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
121 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
122 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
123 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
124 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
125 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
126 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
127 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
128 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
129 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
130 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
131 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
132 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
133 |
6d0a0f8f672a
planemo upload commit f67323ae4fa7fdbd9f4518ede105a7d7cd44b471
fgiacomoni
parents:
diff
changeset
|
134 ## END of the script |