Mercurial > repos > fgiacomoni > hmdb_ms_search
comparison hmdb/t/lib/hmdbTest.pm @ 0:9583f9772198 draft
Init and uploaded
author | fgiacomoni |
---|---|
date | Thu, 28 Jan 2016 10:52:26 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9583f9772198 |
---|---|
1 package lib::hmdbTest ; | |
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 our $VERSION = "1.0"; | |
10 our @ISA = qw(Exporter); | |
11 our @EXPORT = qw( parse_hmdb_csv_resultsTest check_state_from_hmdb_uaTest test_matches_from_hmdb_uaTest extract_sub_mz_listsTest prepare_multi_masses_queryTest get_matches_from_hmdb_uaTest); | |
12 our %EXPORT_TAGS = ( ALL => [qw( parse_hmdb_csv_resultsTest check_state_from_hmdb_uaTest test_matches_from_hmdb_uaTest extract_sub_mz_listsTest prepare_multi_masses_queryTest get_matches_from_hmdb_uaTest)] ); | |
13 | |
14 use lib '/Users/fgiacomoni/Inra/labs/perl/galaxy_tools/hmdb' ; | |
15 use lib::hmdb qw( :ALL ) ; | |
16 | |
17 use Data::Dumper ; | |
18 | |
19 ## sub | |
20 sub extract_sub_mz_listsTest { | |
21 | |
22 my ($masses, $hmdb_limits, ) = @_ ; | |
23 | |
24 my $oHmdb = lib::hmdb->new() ; | |
25 my $submasses = $oHmdb->extract_sub_mz_lists($masses, $hmdb_limits ) ; | |
26 | |
27 return ($submasses) ; | |
28 } | |
29 | |
30 ## sub | |
31 sub prepare_multi_masses_queryTest { | |
32 | |
33 my ($mzs ) = @_ ; | |
34 | |
35 my $oHmdb = lib::hmdb->new() ; | |
36 my ( $hmdb_masses, $nb_masses_to_submit ) = $oHmdb->prepare_multi_masses_query($mzs) ; | |
37 | |
38 return ($hmdb_masses) ; | |
39 } | |
40 | |
41 ## sub | |
42 sub get_matches_from_hmdb_uaTest { | |
43 | |
44 my ( $hmdb_masses, $delta, $molecular_species ) = @_ ; | |
45 | |
46 my $oHmdb = lib::hmdb->new() ; | |
47 my $hmdb_pages = $oHmdb->get_matches_from_hmdb_ua($hmdb_masses, $delta, $molecular_species) ; | |
48 return ($hmdb_pages) ; | |
49 } | |
50 | |
51 | |
52 ## sub | |
53 sub test_matches_from_hmdb_uaTest { | |
54 | |
55 my $oHmdb = lib::hmdb->new() ; | |
56 my $status = $oHmdb->test_matches_from_hmdb_ua() ; | |
57 return ($status) ; | |
58 } | |
59 | |
60 | |
61 ## sub | |
62 sub check_state_from_hmdb_uaTest { | |
63 my ($status ) = @_ ; | |
64 | |
65 my $oHmdb = lib::hmdb->new() ; | |
66 my $res = $oHmdb->check_state_from_hmdb_ua($status) ; | |
67 return($res) ; | |
68 } | |
69 | |
70 | |
71 | |
72 ## sub | |
73 sub parse_hmdb_csv_resultsTest { | |
74 my ($hmdb_pages, $mzs ) = @_ ; | |
75 | |
76 my $oHmdb = lib::hmdb->new() ; | |
77 my $result = $oHmdb->parse_hmdb_csv_results($hmdb_pages, $mzs) ; ## hash format result | |
78 | |
79 return($result) ; | |
80 } | |
81 | |
82 | |
83 1 ; |