| 1 | |||||||||||||||||||||
| 2 | # | ||||||||||||||||||||
| 3 | # BioPerl module for Bio::Search::Processor | ||||||||||||||||||||
| 4 | # | ||||||||||||||||||||
| 5 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||||||||||||
| 6 | # | ||||||||||||||||||||
| 7 | # Cared for by Aaron Mackey <amackey@virginia.edu> | ||||||||||||||||||||
| 8 | # | ||||||||||||||||||||
| 9 | # Copyright Aaron Mackey | ||||||||||||||||||||
| 10 | # | ||||||||||||||||||||
| 11 | # You may distribute this module under the same terms as perl itself | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | # POD documentation - main docs before the code | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | =head1 NAME | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | Bio::Search::Processor - DESCRIPTION of Object | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | =head1 SYNOPSIS | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | Give standard usage here | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | =head1 DESCRIPTION | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | Describe the object here | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | =head1 FEEDBACK | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =head2 Mailing Lists | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | User feedback is an integral part of the evolution of this and other | ||||||||||||||||||||
| 32 | Bioperl modules. Send your comments and suggestions preferably to one | ||||||||||||||||||||
| 33 | of the Bioperl mailing lists. Your participation is much appreciated. | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | bioperl-l@bioperl.org - General discussion | ||||||||||||||||||||
| 36 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | =head2 Support | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | Please direct usage questions or support issues to the mailing list: | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | I<bioperl-l@bioperl.org> | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | rather than to the module maintainer directly. Many experienced and | ||||||||||||||||||||
| 45 | reponsive experts will be able look at the problem and quickly | ||||||||||||||||||||
| 46 | address it. Please include a thorough description of the problem | ||||||||||||||||||||
| 47 | with code and data examples if at all possible. | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | =head2 Reporting Bugs | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | Report bugs to the Bioperl bug tracking system to help us keep track | ||||||||||||||||||||
| 52 | the bugs and their resolution. Bug reports can be submitted via the | ||||||||||||||||||||
| 53 | web: | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | https://github.com/bioperl/bioperl-live/issues | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | =head1 AUTHOR - Aaron Mackey | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | Email amackey@virginia.edu | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | Describe contact details here | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | =head1 APPENDIX | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | The rest of the documentation details each of the object | ||||||||||||||||||||
| 66 | methods. Internal methods are usually preceded with a _ | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | =cut | ||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | # Let the code begin... | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | package Bio::Search::Processor; | ||||||||||||||||||||
| 73 | 1 | $Bio::Search::Processor::VERSION = '1.7.8'; | |||||||||||||||||||
| 74 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | =head2 new | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | Title : new | ||||||||||||||||||||
| 79 | Usage : $proc = Bio::Search::Processor->new -file => $filename, | ||||||||||||||||||||
| 80 | -algorithm => 'Algorithm' ; | ||||||||||||||||||||
| 81 | Function: Used to specify and initialize a data processor of search | ||||||||||||||||||||
| 82 | algorithm results. | ||||||||||||||||||||
| 83 | Returns : A processor specific to the algorithm type, if it exists. | ||||||||||||||||||||
| 84 | Args : -file => filename | ||||||||||||||||||||
| 85 | -algorithm => algorithm specifier | ||||||||||||||||||||
| 86 | -fh => filehandle to attach to (file or fh required) | ||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | =cut | ||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | 0 | my $type = shift; | |||||||||||||||||||
| 93 | 0 | my $proc; | |||||||||||||||||||
| 94 | 0 | my ($module, $load, $algorithm); | |||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | 0 | my %args = @_; | |||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | 0 | ▶ | exists $args{'-algorithm'} or do { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 99 | 0 | print STDERR "Must supply an algorithm!"; | |||||||||||||||||||
| 100 | 0 | return; | |||||||||||||||||||
| 101 | }; | ||||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | 0 | ▶ | $algorithm = $args{'-algorithm'} || $args{'-ALGORITHM'}; | ||||||||||||||||||
|
Condition0%0/3
$args{'-algorithm'} || $args{'-ALGORITHM'}
MC/DC0%0/2
$args{'-algorithm'} || $args{'-ALGORITHM'}
$args{'-algorithm'}
$args{'-ALGORITHM'}
Truth table0%0/3
A || B
A= $args{'-algorithm'}B= $args{'-ALGORITHM'}
| |||||||||||||||||||||
| 104 | |||||||||||||||||||||
| 105 | 0 | $module = "_<Bio/Search/Processor/$algorithm.pm"; | |||||||||||||||||||
| 106 | 0 | $load = "Bio/Search/Processor/$algorithm.pm"; | |||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | 0 | ▶ | unless ( $main::{$module} ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 109 | 0 | eval { require $load; }; | |||||||||||||||||||
| 110 | 0 | ▶ | if ( $@ ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 111 | 0 | print STDERR <<"EOF"; | |||||||||||||||||||
| 112 | $load: $algorithm cannot be found | ||||||||||||||||||||
| 113 | Exception $@ | ||||||||||||||||||||
| 114 | For more information about the Search/Processor system please see the | ||||||||||||||||||||
| 115 | Processor docs. This includes ways of checking for processors at | ||||||||||||||||||||
| 116 | compile time, not run time | ||||||||||||||||||||
| 117 | EOF | ||||||||||||||||||||
| 118 | 0 | return; | |||||||||||||||||||
| 119 | } | ||||||||||||||||||||
| 120 | } | ||||||||||||||||||||
| 121 | |||||||||||||||||||||
| 122 | 0 | $proc = "Bio::Search::Processor::$algorithm"->new(@_); | |||||||||||||||||||
| 123 | 0 | return $proc; | |||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | 1 | 1; | |||||||||||||||||||