Sync'ed RichSeqI with the implementation. RichSeq provides backward
[bioperl-live.git] / Bio / Search / Processor.pm
blobb1d7d14b86a68ad831bac99b74fa95a9c90aebf4
3 # BioPerl module for Bio::Search::Processor
5 # Cared for by Aaron Mackey <amackey@virginia.edu>
7 # Copyright Aaron Mackey
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::Search::Processor - DESCRIPTION of Object
17 =head1 SYNOPSIS
19 Give standard usage here
21 =head1 DESCRIPTION
23 Describe the object here
25 =head1 FEEDBACK
27 =head2 Mailing Lists
29 User feedback is an integral part of the evolution of this and other
30 Bioperl modules. Send your comments and suggestions preferably to one
31 of the Bioperl mailing lists. Your participation is much appreciated.
33 bioperl-l@bioperl.org - General discussion
34 http://bio.perl.org/MailList.html - About the mailing lists
36 =head2 Reporting Bugs
38 Report bugs to the Bioperl bug tracking system to help us keep track
39 the bugs and their resolution. Bug reports can be submitted via email
40 or the web:
42 bioperl-bugs@bio.perl.org
43 http://bugzilla.bioperl.org/
45 =head1 AUTHOR - Aaron Mackey
47 Email amackey@virginia.edu
49 Describe contact details here
51 =head1 APPENDIX
53 The rest of the documentation details each of the object
54 methods. Internal methods are usually preceded with a _
56 =cut
58 # Let the code begin...
60 package Bio::Search::Processor;
62 use strict;
63 use vars qw(@ISA);
65 =head2 new
67 Title : new
68 Usage : $proc = new Bio::Search::Processor -file => $filename,
69 -algorithm => 'Algorithm' ;
70 Function: Used to specify and initialize a data processor of search
71 algorithm results.
72 Returns : A processor specific to the algorithm type, if it exists.
73 Args : -file => filename
74 -algorithm => algorithm specifier
75 -fh => filehandle to attach to (file or fh required)
77 =cut
79 sub new {
81 my $type = shift;
82 my $proc;
83 my ($module, $load, $algorithm);
85 my %args = @_;
87 exists $args{'-algorithm'} or do {
88 print STDERR "Must supply an algorithm!";
89 return undef;
92 $algorithm = $args{'-algorithm'} || $args{'-ALGORITHM'};
94 $module = "_<Bio/Search/Processor/$algorithm.pm";
95 $load = "Bio/Search/Processor/$algorithm.pm";
97 unless ( $main::{$module} ) {
98 eval { require $load; };
99 if ( $@ ) {
100 print STDERR <<"EOF";
101 $load: $algorithm cannot be found
102 Exception $@
103 For more information about the Search/Processor system please see the
104 Processor docs. This includes ways of checking for processors at
105 compile time, not run time
107 return undef;
111 $proc = "Bio::Search::Processor::$algorithm"->new(@_);
112 return $proc;