0
|
1 package lib::bihTest ;
|
|
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 use Data::Dumper ;
|
|
9
|
|
10 our $VERSION = "1.0";
|
|
11 our @ISA = qw(Exporter);
|
|
12 our @EXPORT = qw( map_pfjson_bankobject_Test parse_bank_interest_Test db_pforest_get_clean_range_Test check_interval_Test format_manual_list_values_Testvalues format_manual_list_values_Testids manage_mode_TestvalH manage_mode_Testionization mz_delta_conversion_Testmin mz_delta_conversion_Testmax dichotomi_search_Test );
|
|
13 our %EXPORT_TAGS = ( ALL => [qw( map_pfjson_bankobject_Test parse_bank_interest_Test db_pforest_get_clean_range_Test check_interval_Test format_manual_list_values_Testvalues format_manual_list_values_Testids manage_mode_TestvalH manage_mode_Testionization mz_delta_conversion_Testmin mz_delta_conversion_Testmax dichotomi_search_Test )] );
|
|
14
|
|
15 use lib '/Users/fgiacomoni/Inra/labs/perl/galaxy_tools/tool-bank_inhouse' ;
|
|
16 use lib::bih qw( :ALL ) ;
|
|
17 use lib::json qw( :ALL ) ;
|
|
18 use lib::csv qw( :ALL ) ;
|
|
19
|
|
20 sub check_interval_Test {
|
|
21 my ( $value, $min, $max ) = @_ ;
|
|
22 my $oBih = lib::bih->new() ;
|
|
23 my ($message) = $oBih->check_interval($value, $min, $max) ;
|
|
24 return($message) ;
|
|
25 }
|
|
26
|
|
27 sub format_manual_list_values_Testvalues {
|
|
28 my ( $value, $sep ) = @_ ;
|
|
29 my $oBih = lib::bih->new() ;
|
|
30 my ($values, $ids) = $oBih->format_manual_list_values($value, $sep) ;
|
|
31 return ($values) ;
|
|
32 }
|
|
33
|
|
34 sub format_manual_list_values_Testids {
|
|
35 my ( $value, $sep ) = @_ ;
|
|
36 my $oBih = lib::bih->new() ;
|
|
37 my ($values, $ids) = $oBih->format_manual_list_values($value, $sep) ;
|
|
38 return ($ids) ;
|
|
39 }
|
|
40
|
|
41 sub mz_delta_conversion_Testmin {
|
|
42 my ( $mass, $delta_type, $mz_delta ) = @_ ;
|
|
43 my $oBih = lib::bih->new() ;
|
|
44 my ($min, $max) = $oBih->mz_delta_conversion(\$mass, \$delta_type, \$mz_delta) ;
|
|
45 return($$min) ;
|
|
46 }
|
|
47
|
|
48 sub mz_delta_conversion_Testmax {
|
|
49 my ( $mass, $delta_type, $mz_delta ) = @_ ;
|
|
50 my $oBih = lib::bih->new() ;
|
|
51 my ($min, $max) = $oBih->mz_delta_conversion(\$mass, \$delta_type, \$mz_delta) ;
|
|
52 return($$max) ;
|
|
53 }
|
|
54
|
|
55 sub dichotomi_search_Test {
|
|
56 my ( $tab, $search ) = @_ ;
|
|
57 my $oBih = lib::bih->new() ;
|
|
58 my ($position) = $oBih->dichotomi_search($tab, \$search) ;
|
|
59 return($$position) ;
|
|
60 }
|
|
61
|
|
62 ## SUB TEST for
|
|
63 sub db_pforest_get_clean_range_Test {
|
|
64 # get values
|
|
65 my ( $host, $query, $min, $max, $mode ) = @_;
|
|
66 my $json = undef ;
|
|
67
|
|
68 my $oBih = lib::bih->new() ;
|
|
69 $json = $oBih->db_pforest_get_clean_range($host, $query, $min, $max, $mode ) ;
|
|
70
|
|
71 return($json) ;
|
|
72 }
|
|
73 ## End SUB
|
|
74
|
|
75 ## SUB TEST for
|
|
76 sub parse_bank_interest_Test {
|
|
77 # get values
|
|
78 my ( $file, $col_interest ) = @_;
|
|
79
|
|
80 my $ocsv_input = lib::csv->new() ;
|
|
81 my $ocsv = $ocsv_input->get_csv_object( "\t" ) ;
|
|
82
|
|
83 my $oBih = lib::bih->new() ;
|
|
84 my ($bank, $bank_header) = $oBih->parse_bank_interest($ocsv, \$file, $col_interest) ;
|
|
85
|
|
86 # print Dumper $bank ;
|
|
87
|
|
88 return($bank) ;
|
|
89 }
|
|
90 ## End SUB
|
|
91
|
|
92
|
|
93 sub map_pfjson_bankobject_Test {
|
|
94 # get values
|
|
95 my ( $json ) = @_;
|
|
96
|
|
97 my ($bank, $headers) = (undef, undef) ;
|
|
98
|
|
99 my $oBih = lib::bih->new() ;
|
|
100 ($bank, $headers) = $oBih->map_pfjson_bankobject($json) ;
|
|
101 # print Dumper $headers ;
|
|
102 return($bank, $headers) ;
|
|
103 }
|
|
104
|
|
105
|
|
106 1 ; |