annotate t/lib/hmdb_apiTest.pm @ 0:7c9269bded0e draft

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