Mercurial > repos > fgiacomoni > massbank_ws_searchspectrum
comparison t/lib/massbank_mapper_Test.pm @ 0:023c380900ef draft default tip
Init repository with last massbank_ws_searchspectrum master version
| author | fgiacomoni |
|---|---|
| date | Wed, 19 Apr 2017 11:31:58 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:023c380900ef |
|---|---|
| 1 package lib::massbank_mapper_Test ; | |
| 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( max_from_double_with_deltaTest min_from_double_with_deltaTest get_massbank_records_by_chunkTest compute_ids_from_pcgroups_resTest filter_pcgroup_resTest get_pcgroup_listTest get_pcgroupsTest set_massbank_matrix_objectTest add_massbank_matrix_to_input_matrixTest); | |
| 14 our %EXPORT_TAGS = ( ALL => [qw(max_from_double_with_deltaTest min_from_double_with_deltaTest get_massbank_records_by_chunkTest compute_ids_from_pcgroups_resTest filter_pcgroup_resTest get_pcgroup_listTest get_pcgroupsTest set_massbank_matrix_objectTest add_massbank_matrix_to_input_matrixTest)] ); | |
| 15 | |
| 16 use lib '/Users/fgiacomoni/Inra/labs/perl/galaxy_tools/massbank_ws_searchspectrum' ; | |
| 17 use lib::mapper qw( :ALL ) ; | |
| 18 | |
| 19 sub get_pcgroupsTest { | |
| 20 my ( $pcs, $mzs, $ints ) = @_; | |
| 21 my $omap = lib::mapper->new() ; | |
| 22 my $pcgroups = $omap->get_pcgroups($pcs, $mzs, $ints) ; | |
| 23 # print Dumper $pcgroups ; | |
| 24 return ($pcgroups) ; | |
| 25 } | |
| 26 | |
| 27 | |
| 28 sub get_pcgroup_listTest { | |
| 29 my ($pcs) = @_ ; | |
| 30 my $omap = lib::mapper->new() ; | |
| 31 my $pcgroup_list = $omap->get_pcgroup_list($pcs) ; | |
| 32 # print Dumper $pcgroup_list ; | |
| 33 return ($pcgroup_list) ; | |
| 34 } | |
| 35 | |
| 36 sub set_massbank_matrix_objectTest { | |
| 37 my ($header, $init_pcs, $pcgroups) = @_ ; | |
| 38 my $omap = lib::mapper->new() ; | |
| 39 my $matrix = $omap->set_massbank_matrix_object($header, $init_pcs, $pcgroups) ; | |
| 40 # print Dumper $matrix ; | |
| 41 return ($matrix) ; | |
| 42 } | |
| 43 | |
| 44 sub add_massbank_matrix_to_input_matrixTest { | |
| 45 my ($input_matrix_object, $massbank_matrix_object ) = @_ ; | |
| 46 my $omap = lib::mapper->new() ; | |
| 47 my $matrix = $omap->add_massbank_matrix_to_input_matrix($input_matrix_object, $massbank_matrix_object ) ; | |
| 48 # print Dumper $matrix ; | |
| 49 return ($matrix) ; | |
| 50 } | |
| 51 | |
| 52 ## SUB TEST for filter_pcgroup_res | |
| 53 sub filter_pcgroup_resTest { | |
| 54 # get values | |
| 55 my ( $pcgroups, $threshold ) = @_; | |
| 56 my $cleaned_pcgroups = () ; | |
| 57 | |
| 58 | |
| 59 my $omap = lib::mapper->new() ; | |
| 60 $cleaned_pcgroups = $omap->filter_pcgroup_res($pcgroups, $threshold) ; | |
| 61 | |
| 62 return($cleaned_pcgroups) ; | |
| 63 } | |
| 64 ## End SUB | |
| 65 | |
| 66 ## SUB TEST for | |
| 67 sub compute_ids_from_pcgroups_resTest { | |
| 68 # get values | |
| 69 my ( $pcgroups ) = @_; | |
| 70 my $ids = () ; | |
| 71 | |
| 72 my $var2 = lib::mapper->new() ; | |
| 73 $ids = $var2->compute_ids_from_pcgroups_res($pcgroups) ; | |
| 74 | |
| 75 return($ids) ; | |
| 76 } | |
| 77 ## End SUB | |
| 78 | |
| 79 ## ## SUB TEST for | |
| 80 sub min_from_double_with_deltaTest { | |
| 81 # get values | |
| 82 my ( $double, $type, $delta ) = @_; | |
| 83 | |
| 84 my $var2 = lib::mapper->new() ; | |
| 85 my ($min, $max) = $var2->min_and_max_from_double_with_delta($double, $type, $delta) ; | |
| 86 # print $min ; | |
| 87 return($min) ; | |
| 88 } | |
| 89 ## End SUB | |
| 90 | |
| 91 ## ## SUB TEST for | |
| 92 sub max_from_double_with_deltaTest { | |
| 93 # get values | |
| 94 my ( $double, $type, $delta ) = @_; | |
| 95 | |
| 96 my $var2 = lib::mapper->new() ; | |
| 97 my ($min, $max) = $var2->min_and_max_from_double_with_delta($double, $type, $delta) ; | |
| 98 # print $max ; | |
| 99 return($max) ; | |
| 100 } | |
| 101 ## End SUB | |
| 102 | |
| 103 ## SUB TEST for | |
| 104 sub get_massbank_records_by_chunkTest { | |
| 105 # get values | |
| 106 my ( $server, $ids, $chunk_size ) = @_; | |
| 107 | |
| 108 my $var2 = lib::mapper->new() ; | |
| 109 my $records = $var2->get_massbank_records_by_chunk ($server, $ids, $chunk_size) ; | |
| 110 | |
| 111 # print Dumper $records ; | |
| 112 | |
| 113 return($records) ; | |
| 114 } | |
| 115 ## End SUB | |
| 116 | |
| 117 | |
| 118 1 ; |
