tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / Search / Hit / Fasta.pm
blob67829ca347c9dca8cc5c38500ff1b47e6ea8c5dd
1 # $Id$
3 # BioPerl module for Bio::Search::Hit::Fasta
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Aaron Mackey <amackey@virginia.edu>
9 # Copyright Aaron Mackey
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
15 =head1 NAME
17 Bio::Search::Hit::Fasta - Hit object specific for Fasta-generated hits
19 =head1 SYNOPSIS
21 # You wouldn't normally create these manually;
22 # instead they would be produced by Bio::SearchIO::fasta
24 use Bio::Search::Hit::Fasta;
25 my $hit = Bio::Search::Hit::Fasta->new(id=>'LBL_6321', desc=>'lipoprotein', e_val=>0.01);
27 =head1 DESCRIPTION
29 L<Bio::Search::Hit::HitI> objects are data structures that contain information
30 about specific hits obtained during a library search. Some information will
31 be algorithm-specific, but others will be generally defined, such as the
32 ability to obtain alignment objects corresponding to each hit.
34 =head1 SEE ALSO
36 L<Bio::Search::Hit::HitI>,
37 L<Bio::Search::Hit::GenericHit>,
38 L<Bio::SearchIO::fasta>.
40 =head1 FEEDBACK
42 =head2 Mailing Lists
44 User feedback is an integral part of the evolution of this
45 and other Bioperl modules. Send your comments and suggestions preferably
46 to one of the Bioperl mailing lists.
47 Your participation is much appreciated.
49 bioperl-l@bioperl.org - General discussion
50 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
52 =head2 Support
54 Please direct usage questions or support issues to the mailing list:
56 I<bioperl-l@bioperl.org>
58 rather than to the module maintainer directly. Many experienced and
59 reponsive experts will be able look at the problem and quickly
60 address it. Please include a thorough description of the problem
61 with code and data examples if at all possible.
63 =head2 Reporting Bugs
65 Report bugs to the Bioperl bug tracking system to help us keep track
66 the bugs and their resolution. Bug reports can be submitted via the
67 web:
69 http://bugzilla.open-bio.org/
71 =head1 AUTHOR - Aaron Mackey
73 Email amackey-at-virginia.edu
75 =head1 APPENDIX
77 The rest of the documentation details each of the object
78 methods. Internal methods are usually preceded with a _
80 =cut
83 # Let the code begin...
85 package Bio::Search::Hit::Fasta;
87 use vars qw($AUTOLOAD);
88 use strict;
90 use base qw(Bio::Search::Hit::HitI);
92 my @AUTOLOAD_OK = qw(_ID _DESC _SIZE _INITN _INIT1 _OPT _ZSC _E_VAL);
94 my %AUTOLOAD_OK = ();
95 @AUTOLOAD_OK{@AUTOLOAD_OK} = (1) x @AUTOLOAD_OK;
97 =head2 _initialize
99 Function: where the heavy stuff will happen when new is called
101 =cut
103 sub _initialize {
104 my($self, %args) = @_;
106 my $make = $self->SUPER::_initialize(%args);
108 while (my ($key, $val) = each %args) {
109 $key = '_' . uc($key);
110 $self->$key($val);
113 return $make; # success - we hope!
116 =head2 AUTOLOAD
118 Function: Provide getter/setters for ID,DESC,SIZE,INITN,INIT1,OPT,ZSC,E_VAL
120 =cut
122 sub AUTOLOAD {
123 my ($self, $val) = @_;
125 $AUTOLOAD =~ s/.*:://;
127 if ( $AUTOLOAD_OK{$AUTOLOAD} ) {
128 $self->{$AUTOLOAD} = $val if defined $val;
129 return $self->{$AUTOLOAD};
130 } else {
131 $self->throw("Unallowed accessor: $AUTOLOAD !");