| 1 | # | ||||||||||
| 2 | # BioPerl module for Bio::Search::Hit::GenericHit | ||||||||||
| 3 | # | ||||||||||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||
| 5 | # | ||||||||||
| 6 | # Cared for by Jason Stajich <jason@bioperl.org> | ||||||||||
| 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<bioperl-l@bioperl.org> | ||||||||||
| 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 | $Bio::Search::Hit::BlastHit::VERSION = '1.7.8'; | |||||||||
| 85 | 12 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 86 | |||||||||||
| 87 | 12 | ▶ | use Bio::Search::SearchUtils; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 88 | |||||||||||
| 89 | 12 | ▶ | use base qw(Bio::Search::Hit::GenericHit); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 90 | |||||||||||
| 91 | =head2 new | ||||||||||
| 92 | |||||||||||
| 93 | Title : new | ||||||||||
| 94 | Usage : my $obj = Bio::Search::Hit::GenericHit->new(); | ||||||||||
| 95 | Function: Builds a new Bio::Search::Hit::GenericHit object | ||||||||||
| 96 | Returns : Bio::Search::Hit::GenericHit | ||||||||||
| 97 | Args : See Bio::Search::Hit::GenericHit() for other args. | ||||||||||
| 98 | Here are the BLAST-specific args that can be used when | ||||||||||
| 99 | creating BlastHit objects: | ||||||||||
| 100 | -iteration => integer for the PSI-Blast iteration number | ||||||||||
| 101 | -found_again => boolean, true if hit appears in a | ||||||||||
| 102 | "previously found" section of a PSI-Blast report. | ||||||||||
| 103 | |||||||||||
| 104 | =cut | ||||||||||
| 105 | |||||||||||
| 106 | 885 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||
| 107 | 885 | my($class,@args) = @_; | |||||||||
| 108 | |||||||||||
| 109 | 885 | my $self = $class->SUPER::new(@args); | |||||||||
| 110 | 885 | my ($iter,$found) = $self->_rearrange([qw(ITERATION | |||||||||
| 111 | FOUND_AGAIN | ||||||||||
| 112 | )], @args); | ||||||||||
| 113 | |||||||||||
| 114 | 885 | ▶ | defined $iter && $self->iteration($iter); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 115 | 885 | ▶ | defined $found && $self->found_again($found); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 116 | |||||||||||
| 117 | 885 | return $self; | |||||||||
| 118 | } | ||||||||||
| 119 | |||||||||||
| 120 | =head2 iteration | ||||||||||
| 121 | |||||||||||
| 122 | Usage : $hit->iteration( $iteration_num ); | ||||||||||
| 123 | Purpose : Gets the iteration number in which the Hit was found. | ||||||||||
| 124 | Example : $iteration_num = $sbjct->iteration(); | ||||||||||
| 125 | Returns : Integer greater than or equal to 1 | ||||||||||
| 126 | Non-PSI-BLAST reports will report iteration as 1, but this number | ||||||||||
| 127 | is only meaningful for PSI-BLAST reports. | ||||||||||
| 128 | Argument : iteration_num (optional, used when setting only) | ||||||||||
| 129 | Throws : none | ||||||||||
| 130 | |||||||||||
| 131 | See Also : L<found_again()|found_again> | ||||||||||
| 132 | |||||||||||
| 133 | =cut | ||||||||||
| 134 | |||||||||||
| 135 | 0 | ▶ | sub iteration{ | ||||||||
|
Subroutine
iteration: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 136 | 0 | my ($self,$value) = @_; | |||||||||
| 137 | 0 | ▶ | if( defined $value) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 138 | 0 | $self->{'_psiblast_iteration'} = $value; | |||||||||
| 139 | } | ||||||||||
| 140 | 0 | return $self->{'_psiblast_iteration'}; | |||||||||
| 141 | } | ||||||||||
| 142 | |||||||||||
| 143 | =head2 found_again | ||||||||||
| 144 | |||||||||||
| 145 | Title : found_again | ||||||||||
| 146 | Usage : $hit->found_again; | ||||||||||
| 147 | $hit->found_again(1); | ||||||||||
| 148 | Purpose : Gets a boolean indicator whether or not the hit has | ||||||||||
| 149 | been found in a previous iteration. | ||||||||||
| 150 | This is only applicable to PSI-BLAST reports. | ||||||||||
| 151 | |||||||||||
| 152 | This method indicates if the hit was reported in the | ||||||||||
| 153 | "Sequences used in model and found again" section of the | ||||||||||
| 154 | PSI-BLAST report or if it was reported in the | ||||||||||
| 155 | "Sequences not found previously or not previously below threshold" | ||||||||||
| 156 | section of the PSI-BLAST report. Only for hits in iteration > 1. | ||||||||||
| 157 | |||||||||||
| 158 | Example : if( $hit->found_again()) { ... }; | ||||||||||
| 159 | Returns : Boolean, true (1) if the hit has been found in a | ||||||||||
| 160 | previous PSI-BLAST iteration. | ||||||||||
| 161 | Returns false (0 or undef) for hits that have not occurred in a | ||||||||||
| 162 | previous PSI-BLAST iteration. | ||||||||||
| 163 | Argument : Boolean (1 or 0). Only used for setting. | ||||||||||
| 164 | Throws : none | ||||||||||
| 165 | |||||||||||
| 166 | See Also : L<iteration()|iteration> | ||||||||||
| 167 | |||||||||||
| 168 | =cut | ||||||||||
| 169 | |||||||||||
| 170 | 0 | ▶ | sub found_again { | ||||||||
|
Subroutine
found_again: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 171 | 0 | my $self = shift; | |||||||||
| 172 | 0 | ▶ | return $self->{'_found_again'} = shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 173 | 0 | return $self->{'_found_again'}; | |||||||||
| 174 | } | ||||||||||
| 175 | |||||||||||
| 176 | |||||||||||
| 177 | 0 | ▶ | sub expect { shift->significance(@_) } | ||||||||
|
Subroutine
expect: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 178 | |||||||||||
| 179 | |||||||||||
| 180 | 12 | 1; | |||||||||