0
|
1 package hmdb_apiTest ;
|
|
2
|
|
3 use diagnostics; # this gives you more debugging information
|
|
4 use warnings; # this warns you of bad practices
|
|
5 use strict; # this prevents silly errors
|
|
6 use Exporter ;
|
|
7 use Carp ;
|
|
8
|
|
9 use Data::Dumper ;
|
|
10
|
|
11 our $VERSION = "1.0";
|
|
12 our @ISA = qw(Exporter);
|
|
13 our @EXPORT = qw( getMetaboliteFeaturesTest buildMetabolitesArrayTest setMetaboliteAcurrateMzToModesMzTest);
|
|
14 our %EXPORT_TAGS = ( ALL => [qw( getMetaboliteFeaturesTest buildMetabolitesArrayTest setMetaboliteAcurrateMzToModesMzTest)] );
|
|
15
|
|
16 use lib '/Users/fgiacomoni/Inra/labs/perl/downloader-bank-hmdb/lib' ;
|
|
17 use hmdb_api qw( :ALL ) ;
|
|
18
|
|
19
|
|
20 sub getMetaboliteFeaturesTest {
|
|
21 my ($xml) = @_ ;
|
|
22 my $oObject = hmdb_api->new() ;
|
|
23 my ($res, $nb) = $oObject->getMetaboliteFeatures($xml) ;
|
|
24
|
|
25 # print $res ;
|
|
26 return ($nb) ;
|
|
27 }
|
|
28
|
|
29
|
|
30 sub buildMetabolitesArrayTest {
|
|
31 my ($met, $header) = @_ ;
|
|
32 my $oObject = hmdb_api->new() ;
|
|
33 my ($res) = $oObject->buildMetabolitesArray($met, $header) ;
|
|
34 # print Dumper $res ;
|
|
35 return ($res) ;
|
|
36 }
|
|
37
|
|
38 ## SUB TEST for
|
|
39 sub setMetaboliteAcurrateMzToModesMzTest {
|
|
40 # get values
|
|
41 my ( $format, $met ) = @_;
|
|
42
|
|
43 my $var2 = hmdb_api->new() ;
|
|
44 my $var3 = $var2->setMetaboliteAcurrateMzToModesMz($format, $met, 1.007825, 0.0005486, 1) ;
|
|
45
|
|
46 return($var3) ;
|
|
47 }
|
|
48 ## End SUB
|
|
49
|
|
50
|
|
51 1 ; |