File Coverage

Bio/Search/Hit/BlastHit.pm
Criterion Covered Total %
statement 15 23 65.2
branch 2 8 25.0
condition n/a
subroutine 4 7 57.1
pod 3 4 75.0
total 24 42 57.1


line stmt bran cond sub pod time code
1             #
2             # BioPerl module for Bio::Search::Hit::GenericHit
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::BlastHit - Blast-specific subclass of Bio::Search::Hit::GenericHit
17              
18             =head1 SYNOPSIS
19              
20             use Bio::Search::Hit::BlastHit;
21             my $hit = Bio::Search::Hit::BlastHit->new(-algorithm => 'blastp');
22              
23             # See Bio::Search::Hit::GenericHit for information about working with Hits.
24              
25             # TODO: Describe how to configure a SearchIO stream so that it generates
26             # GenericHit objects.
27              
28             =head1 DESCRIPTION
29              
30             This object is a subclass of Bio::Search::Hit::GenericHit
31             and provides some operations that facilitate working with BLAST
32             and PSI-BLAST Hits.
33              
34             For general information about working with Hits, see
35             Bio::Search::Hit::GenericHit.
36              
37             =head1 FEEDBACK
38              
39             =head2 Mailing Lists
40              
41             User feedback is an integral part of the evolution of this and other
42             Bioperl modules. Send your comments and suggestions preferably to
43             the Bioperl mailing list. Your participation is much appreciated.
44              
45             bioperl-l@bioperl.org - General discussion
46             http://bioperl.org/wiki/Mailing_lists - About the mailing lists
47              
48             =head2 Support
49              
50             Please direct usage questions or support issues to the mailing list:
51              
52             I
53              
54             rather than to the module maintainer directly. Many experienced and
55             reponsive experts will be able look at the problem and quickly
56             address it. Please include a thorough description of the problem
57             with code and data examples if at all possible.
58              
59             =head2 Reporting Bugs
60              
61             Report bugs to the Bioperl bug tracking system to help us keep track
62             of the bugs and their resolution. Bug reports can be submitted via the
63             web:
64              
65             https://github.com/bioperl/bioperl-live/issues
66              
67             =head1 AUTHOR - Jason Stajich and Steve Chervitz
68              
69             Email jason@bioperl.org
70             Email sac@bioperl.org
71              
72             =head1 APPENDIX
73              
74             The rest of the documentation details each of the object methods.
75             Internal methods are usually preceded with a _
76              
77             =cut
78              
79              
80             # Let the code begin...
81              
82              
83             package Bio::Search::Hit::BlastHit;
84 12     12   944 use strict;
  12         22  
  12         334  
85              
86 12     12   464 use Bio::Search::SearchUtils;
  12         20  
  12         258  
87              
88 12     12   50 use base qw(Bio::Search::Hit::GenericHit);
  12         21  
  12         2947  
89              
90             =head2 new
91              
92             Title : new
93             Usage : my $obj = Bio::Search::Hit::GenericHit->new();
94             Function: Builds a new Bio::Search::Hit::GenericHit object
95             Returns : Bio::Search::Hit::GenericHit
96             Args : See Bio::Search::Hit::GenericHit() for other args.
97             Here are the BLAST-specific args that can be used when
98             creating BlastHit objects:
99             -iteration => integer for the PSI-Blast iteration number
100             -found_again => boolean, true if hit appears in a
101             "previously found" section of a PSI-Blast report.
102              
103             =cut
104              
105             sub new {
106 2274     2274 1 6582 my($class,@args) = @_;
107              
108 2274         5063 my $self = $class->SUPER::new(@args);
109 2274         6481 my ($iter,$found) = $self->_rearrange([qw(ITERATION
110             FOUND_AGAIN
111             )], @args);
112              
113 2274 50       4475 defined $iter && $self->iteration($iter);
114 2274 50       2899 defined $found && $self->found_again($found);
115              
116 2274         7712 return $self;
117             }
118              
119             =head2 iteration
120              
121             Usage : $hit->iteration( $iteration_num );
122             Purpose : Gets the iteration number in which the Hit was found.
123             Example : $iteration_num = $sbjct->iteration();
124             Returns : Integer greater than or equal to 1
125             Non-PSI-BLAST reports will report iteration as 1, but this number
126             is only meaningful for PSI-BLAST reports.
127             Argument : iteration_num (optional, used when setting only)
128             Throws : none
129              
130             See Also : L
131              
132             =cut
133              
134             sub iteration{
135 0     0 1   my ($self,$value) = @_;
136 0 0         if( defined $value) {
137 0           $self->{'_psiblast_iteration'} = $value;
138             }
139 0           return $self->{'_psiblast_iteration'};
140             }
141              
142             =head2 found_again
143              
144             Title : found_again
145             Usage : $hit->found_again;
146             $hit->found_again(1);
147             Purpose : Gets a boolean indicator whether or not the hit has
148             been found in a previous iteration.
149             This is only applicable to PSI-BLAST reports.
150              
151             This method indicates if the hit was reported in the
152             "Sequences used in model and found again" section of the
153             PSI-BLAST report or if it was reported in the
154             "Sequences not found previously or not previously below threshold"
155             section of the PSI-BLAST report. Only for hits in iteration > 1.
156              
157             Example : if( $hit->found_again()) { ... };
158             Returns : Boolean, true (1) if the hit has been found in a
159             previous PSI-BLAST iteration.
160             Returns false (0 or undef) for hits that have not occurred in a
161             previous PSI-BLAST iteration.
162             Argument : Boolean (1 or 0). Only used for setting.
163             Throws : none
164              
165             See Also : L
166              
167             =cut
168              
169             sub found_again {
170 0     0 1   my $self = shift;
171 0 0         return $self->{'_found_again'} = shift if @_;
172 0           return $self->{'_found_again'};
173             }
174              
175              
176 0     0 0   sub expect { shift->significance(@_) }
177              
178              
179             1;