File Coverage

Bio/Search/Hit/HMMERHit.pm
Criterion Covered Total %
statement 8 10 80.0
branch n/a
condition n/a
subroutine 4 6 66.6
pod 4 4 100.0
total 16 20 80.0


line stmt bran cond sub pod time code
1             #
2             # BioPerl module for Bio::Search::Hit::HMMERHit
3             #
4             # Please direct questions and support issues to
5             #
6             # Cared for by Jason Stajich
7             #
8             # Copyright Jason Stajich
9             #
10             # You may distribute this module under the same terms as perl itself
11              
12             # POD documentation - main docs before the code
13              
14             =head1 NAME
15              
16             Bio::Search::Hit::HMMERHit - A Hit module for HMMER hits
17              
18             =head1 SYNOPSIS
19              
20             use Bio::Search::Hit::HMMERHit;
21             my $hit = Bio::Search::Hit::HMMERHit->new();
22             # use it in the same way as Bio::Search::Hit::GenericHit
23              
24             =head1 DESCRIPTION
25              
26             This is a specialization of L. There
27             are a few news methods L and L. Note that
28             L and L make no sense for this object and will
29             return 0.
30              
31             =head1 FEEDBACK
32              
33             =head2 Mailing Lists
34              
35             User feedback is an integral part of the evolution of this and other
36             Bioperl modules. Send your comments and suggestions preferably to
37             the Bioperl mailing list. Your participation is much appreciated.
38              
39             bioperl-l@bioperl.org - General discussion
40             http://bioperl.org/wiki/Mailing_lists - About the mailing lists
41              
42             =head2 Support
43              
44             Please direct usage questions or support issues to the mailing list:
45              
46             I
47              
48             rather than to the module maintainer directly. Many experienced and
49             reponsive experts will be able look at the problem and quickly
50             address it. Please include a thorough description of the problem
51             with code and data examples if at all possible.
52              
53             =head2 Reporting Bugs
54              
55             Report bugs to the Bioperl bug tracking system to help us keep track
56             of the bugs and their resolution. Bug reports can be submitted via the
57             web:
58              
59             https://github.com/bioperl/bioperl-live/issues
60              
61             =head1 AUTHOR - Jason Stajich
62              
63             Email jason@bioperl.org
64              
65             =head1 APPENDIX
66              
67             The rest of the documentation details each of the object methods.
68             Internal methods are usually preceded with a _
69              
70             =cut
71              
72              
73             # Let the code begin...
74              
75              
76             package Bio::Search::Hit::HMMERHit;
77 1     1   5 use strict;
  1         2  
  1         27  
78              
79              
80 1     1   4 use base qw(Bio::Search::Hit::GenericHit);
  1         1  
  1         128  
81              
82             =head2 new
83              
84             Title : new
85             Usage : my $obj = Bio::Search::Hit::HMMERHit->new();
86             Function: Builds a new Bio::Search::Hit::HMMERHit object
87             Returns : Bio::Search::Hit::HMMERHit
88             Args :
89              
90             Plus the Bio::Search::Hit::GenericHit inherited params
91             -name => Name of Hit (required)
92             -description => Description (optional)
93             -accession => Accession number (optional)
94             -length => Length of the Hit (optional)
95             -score => Raw Score for the Hit (optional)
96             -significance => Significance value for the Hit (optional)
97             -algorithm => Algorithm used (BLASTP, FASTX, etc...)
98             -hsps => Array ref of HSPs for this Hit.
99              
100              
101             =cut
102              
103              
104             =head2 next_domain
105              
106             Title : next_domain
107             Usage : my $domain = $hit->next_domain();
108             Function: An alias for L, this will return the next HSP
109             Returns : L object
110             Args : none
111              
112              
113             =cut
114              
115 32     32 1 5588 sub next_domain{ shift->next_hsp }
116              
117             =head2 domains
118              
119             Title : domains
120             Usage : my @domains = $hit->domains();
121             Function: An alias for L, this will return the full list of hsps
122             Returns : array of L objects
123             Args : none
124              
125              
126             =cut
127              
128 0     0 1 0 sub domains{ shift->hsps() }
129              
130              
131             =head2 inherited Bio::Search::Hit::GenericHit methods
132              
133             =cut
134              
135             =head2 add_hsp
136              
137             Title : add_hsp
138             Usage : $hit->add_hsp($hsp)
139             Function: Add a HSP to the collection of HSPs for a Hit
140             Returns : number of HSPs in the Hit
141             Args : Bio::Search::HSP::HSPI object
142              
143              
144             =cut
145              
146             =head2 Bio::Search::Hit::HitI methods
147              
148             =cut
149              
150             =head2 name
151              
152             Title : name
153             Usage : $hit_name = $hit->name();
154             Function: returns the name of the Hit sequence
155             Returns : a scalar string
156             Args : [optional] scalar string to set the name
157              
158             =cut
159              
160             =head2 accession
161              
162             Title : accession
163             Usage : $acc = $hit->accession();
164             Function: Retrieve the accession (if available) for the hit
165             Returns : a scalar string (empty string if not set)
166             Args : none
167              
168             =cut
169              
170             =head2 description
171              
172             Title : description
173             Usage : $desc = $hit->description();
174             Function: Retrieve the description for the hit
175             Returns : a scalar string
176             Args : [optional] scalar string to set the description
177              
178             =cut
179              
180             =head2 length
181              
182             Title : length
183             Usage : my $len = $hit->length
184             Function: Returns the length of the hit
185             Returns : integer
186             Args : [optional] integer to set the length
187              
188             =cut
189              
190             =head2 algorithm
191              
192             Title : algorithm
193             Usage : $alg = $hit->algorithm();
194             Function: Gets the algorithm specification that was used to obtain the hit
195             For BLAST, the algorithm denotes what type of sequence was aligned
196             against what (BLASTN: dna-dna, BLASTP prt-prt, BLASTX translated
197             dna-prt, TBLASTN prt-translated dna, TBLASTX translated
198             dna-translated dna).
199             Returns : a scalar string
200             Args : [optional] scalar string to set the algorithm
201              
202             =cut
203              
204             =head2 raw_score
205              
206             Title : raw_score
207             Usage : $score = $hit->raw_score();
208             Function: Gets the "raw score" generated by the algorithm. What
209             this score is exactly will vary from algorithm to algorithm,
210             returning undef if unavailable.
211             Returns : a scalar value
212             Args : [optional] scalar value to set the raw score
213              
214             =cut
215              
216             =head2 significance
217              
218             Title : significance
219             Usage : $significance = $hit->significance();
220             Function: Used to obtain the E or P value of a hit, i.e. the probability that
221             this particular hit was obtained purely by random chance. If
222             information is not available (nor calculatable from other
223             information sources), return undef.
224             Returns : a scalar value or undef if unavailable
225             Args : [optional] scalar value to set the significance
226              
227             =cut
228              
229             =head2 bits
230              
231             Usage : $hit_object->bits();
232             Purpose : Gets the bit score of the best HSP for the current hit.
233             Example : $bits = $hit_object->bits();
234             Returns : Integer or undef if bit score is not set
235             Argument : n/a
236              
237             See Also : L
238              
239             =cut
240              
241 11     11 1 54 sub bits { return 0 }
242              
243             =head2 next_hsp
244              
245             Title : next_hsp
246             Usage : while( $hsp = $obj->next_hsp()) { ... }
247             Function : Returns the next available High Scoring Pair
248             Example :
249             Returns : Bio::Search::HSP::HSPI object or null if finished
250             Args : none
251              
252             =cut
253              
254             =head2 hsps
255              
256             Usage : $hit_object->hsps();
257             Purpose : Get a list containing all HSP objects.
258             : Get the numbers of HSPs for the current hit.
259             Example : @hsps = $hit_object->hsps();
260             : $num = $hit_object->hsps(); # alternatively, use num_hsps()
261             Returns : Array context : list of Bio::Search::HSP::BlastHSP.pm objects.
262             : Scalar context: integer (number of HSPs).
263             : (Equivalent to num_hsps()).
264             Argument : n/a. Relies on wantarray
265             Throws : Exception if the HSPs have not been collected.
266              
267             See Also : L, L
268              
269             =cut
270              
271             =head2 num_hsps
272              
273             Usage : $hit_object->num_hsps();
274             Purpose : Get the number of HSPs for the present Blast hit.
275             Example : $nhsps = $hit_object->num_hsps();
276             Returns : Integer
277             Argument : n/a
278             Throws : Exception if the HSPs have not been collected.
279              
280             See Also : L
281              
282             =cut
283              
284             =head2 rewind
285              
286             Title : rewind
287             Usage : $hit->rewind;
288             Function: Allow one to reset the HSP iteration to the beginning
289             Since this is an in-memory implementation
290             Returns : none
291             Args : none
292              
293             =cut
294              
295             =head2 iteration
296              
297             Title : iteration
298             Usage : $obj->iteration($newval)
299             Function: PSI-BLAST iteration
300             Returns : value of iteration
301             Args : newvalue (optional)
302              
303              
304             =cut
305              
306              
307 0     0 1   sub iteration { return 0 }
308              
309             1;