2 # BioPerl module for Bio::Search::HSP::HMMERHSP
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Jason Stajich <jason@bioperl.org>
8 # Copyright Jason Stajich
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Search::HSP::HMMERHSP - A HSP object for HMMER results
20 use Bio::Search::HSP::HMMERHSP;
21 # use it just like a Bio::Search::HSP::GenericHSP object
25 This object is a specialization of L<Bio::Search::HSP::GenericHSP>.
31 User feedback is an integral part of the evolution of this and other
32 Bioperl modules. Send your comments and suggestions preferably to
33 the Bioperl mailing list. Your participation is much appreciated.
35 bioperl-l@bioperl.org - General discussion
36 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
40 Please direct usage questions or support issues to the mailing list:
42 I<bioperl-l@bioperl.org>
44 rather than to the module maintainer directly. Many experienced and
45 reponsive experts will be able look at the problem and quickly
46 address it. Please include a thorough description of the problem
47 with code and data examples if at all possible.
51 Report bugs to the Bioperl bug tracking system to help us keep track
52 of the bugs and their resolution. Bug reports can be submitted via the
55 https://github.com/bioperl/bioperl-live/issues
57 =head1 AUTHOR - Jason Stajich
59 Email jason-at-bioperl.org
63 The rest of the documentation details each of the object methods.
64 Internal methods are usually preceded with a _
68 # Let the code begin...
70 package Bio
::Search
::HSP
::HMMERHSP
;
73 use base
qw(Bio::Search::HSP::GenericHSP);
78 Usage : my $obj = Bio::Search::HSP::HMMERHSP->new();
79 Function: Builds a new Bio::Search::HSP::HMMERHSP object
80 Returns : Bio::Search::HSP::HMMERHSP
83 Plus Bio::Search::HSP::GenericHSP methods
85 -algorithm => algorithm used (BLASTP, TBLASTX, FASTX, etc)
88 -bits => bit value for HSP
89 -score => score value for HSP (typically z-score but depends on
91 -hsp_length => Length of the HSP (including gaps)
92 -identical => # of residues that that matched identically
93 -conserved => # of residues that matched conservatively
94 (only protein comparisons -
95 conserved == identical in nucleotide comparisons)
96 -hsp_gaps => # of gaps in the HSP
97 -query_gaps => # of gaps in the query in the alignment
98 -hit_gaps => # of gaps in the subject in the alignment
99 -query_name => HSP Query sequence name (if available)
100 -query_start => HSP Query start (in original query sequence coords)
101 -query_end => HSP Query end (in original query sequence coords)
102 -hit_name => HSP Hit sequence name (if available)
103 -hit_start => HSP Hit start (in original hit sequence coords)
104 -hit_end => HSP Hit end (in original hit sequence coords)
105 -hit_length => total length of the hit sequence
106 -query_length => total length of the query sequence
107 -query_seq => query sequence portion of the HSP
108 -hit_seq => hit sequence portion of the HSP
109 -homology_seq => homology sequence for the HSP
110 -hit_frame => hit frame (only if hit is translated protein)
111 -query_frame => query frame (only if query is translated protein)
115 =head2 Bio::Search::HSP::HSPI methods
117 Implementation of Bio::Search::HSP::HSPI methods follow
122 Usage : my $r_type = $hsp->algorithm
123 Function: Obtain the name of the algorithm used to obtain the HSP
124 Returns : string (e.g., BLASTP)
125 Args : [optional] scalar string to set value
132 Usage : my $pvalue = $hsp->pvalue();
133 Function: Returns the P-value for this HSP or undef
134 Returns : float or exponential (2e-10)
135 P-value is not defined with NCBI Blast2 reports.
136 Args : [optional] numeric to set value
143 Usage : my $evalue = $hsp->evalue();
144 Function: Returns the e-value for this HSP
145 Returns : float or exponential (2e-10)
146 Args : [optional] numeric to set value
150 =head2 frac_identical
152 Title : frac_identical
153 Usage : my $frac_id = $hsp->frac_identical( ['query'|'hit'|'total'] );
154 Function: Returns the fraction of identitical positions for this HSP
155 Returns : Float in range 0.0 -> 1.0
156 Args : arg 1: 'query' = num identical / length of query seq (without gaps)
157 'hit' = num identical / length of hit seq (without gaps)
158 'total' = num identical / length of alignment (with gaps)
160 arg 2: [optional] frac identical value to set for the type requested
164 =head2 frac_conserved
166 Title : frac_conserved
167 Usage : my $frac_cons = $hsp->frac_conserved( ['query'|'hit'|'total'] );
168 Function : Returns the fraction of conserved positions for this HSP.
169 This is the fraction of symbols in the alignment with a
171 Returns : Float in range 0.0 -> 1.0
172 Args : arg 1: 'query' = num conserved / length of query seq (without gaps)
173 'hit' = num conserved / length of hit seq (without gaps)
174 'total' = num conserved / length of alignment (with gaps)
176 arg 2: [optional] frac conserved value to set for the type requested
183 Usage : my $gaps = $hsp->gaps( ['query'|'hit'|'total'] );
184 Function : Get the number of gaps in the query, hit, or total alignment.
185 Returns : Integer, number of gaps or 0 if none
186 Args : arg 1: 'query' = num gaps in query seq
187 'hit' = num gaps in hit seq
188 'total' = num gaps in whole alignment
190 arg 2: [optional] integer gap value to set for the type requested
197 Usage : my $qseq = $hsp->query_string;
198 Function: Retrieves the query sequence of this HSP as a string
200 Args : [optional] string to set for query sequence
208 Usage : my $hseq = $hsp->hit_string;
209 Function: Retrieves the hit sequence of this HSP as a string
211 Args : [optional] string to set for hit sequence
217 =head2 homology_string
219 Title : homology_string
220 Usage : my $homo_string = $hsp->homology_string;
221 Function: Retrieves the homology sequence for this HSP as a string.
222 : The homology sequence is the string of symbols in between the
223 : query and hit sequences in the alignment indicating the degree
224 : of conservation (e.g., identical, similar, not similar).
226 Args : [optional] string to set for homology sequence
233 Usage : my $len = $hsp->length( ['query'|'hit'|'total'] );
234 Function : Returns the length of the query or hit in the alignment
236 or the aggregate length of the HSP (including gaps;
237 this may be greater than either hit or query )
239 Args : arg 1: 'query' = length of query seq (without gaps)
240 'hit' = length of hit seq (without gaps)
241 'total' = length of alignment (with gaps)
243 arg 2: [optional] integer length value to set for specific type
247 =head2 percent_identity
249 Title : percent_identity
250 Usage : my $percentid = $hsp->percent_identity()
251 Function: Returns the calculated percent identity for an HSP
252 Returns : floating point between 0 and 100
262 Usage : my ($qframe, $hframe) = $hsp->frame('list',$queryframe,$subjectframe)
263 Function: Set the Frame for both query and subject and insure that
265 This overrides the frame() method implementation in
267 Returns : array of query and subject frame if return type wants an array
268 or query frame if defined or subject frame if not defined
269 Args : 'hit' or 'subject' or 'sbjct' to retrieve the frame of the subject (default)
270 'query' to retrieve the query frame
271 'list' or 'array' to retrieve both query and hit frames together
272 Note : Frames are stored in the GFF way (0-2) not 1-3
273 as they are in BLAST (negative frames are deduced by checking
274 the strand of the query or hit)
281 Usage : my $aln = $hsp->gel_aln
282 Function: Returns a Bio::SimpleAlign representing the HSP alignment
283 Returns : Bio::SimpleAlign
290 $self->warn("Inappropriate to build a Bio::SimpleAlign from a HMMER HSP object");
296 Title : num_conserved
297 Usage : $obj->num_conserved($newval)
298 Function: returns the number of conserved residues in the alignment
300 Args : integer (optional)
307 Title : num_identical
308 Usage : $obj->num_identical($newval)
309 Function: returns the number of identical residues in the alignment
311 Args : integer (optional)
319 Purpose : Get a list of residue positions (indices) for all identical
320 : or conserved residues in the query or sbjct sequence.
321 Example : @s_ind = $hsp->seq_inds('query', 'identical');
322 : @h_ind = $hsp->seq_inds('hit', 'conserved');
323 : @h_ind = $hsp->seq_inds('hit', 'conserved', 1);
324 Returns : List of integers
325 : May include ranges if collapse is true.
326 Argument : seq_type = 'query' or 'hit' or 'sbjct' (default = query)
327 : ('sbjct' is synonymous with 'hit')
328 : class = 'identical' or 'conserved' or 'nomatch' or 'gap'
329 : (default = identical)
330 : (can be shortened to 'id' or 'cons')
332 : collapse = boolean, if true, consecutive positions are merged
333 : using a range notation, e.g., "1 2 3 4 5 7 9 10 11"
334 : collapses to "1-5 7 9-11". This is useful for
335 : consolidating long lists. Default = no collapse.
339 See Also : L<Bio::Search::BlastUtils::collapse_nums()|Bio::Search::BlastUtils>,
340 L<Bio::Search::Hit::HitI::seq_inds()|Bio::Search::Hit::HitI>
344 =head2 Inherited from Bio::SeqFeature::SimilarityPair
346 These methods come from Bio::SeqFeature::SimilarityPair
351 Usage : my $query = $hsp->query
352 Function: Returns a SeqFeature representing the query in the HSP
353 Returns : Bio::SeqFeature::Similarity
354 Args : [optional] new value to set
360 Usage : my $hit = $hsp->hit
361 Function: Returns a SeqFeature representing the hit in the HSP
362 Returns : Bio::SeqFeature::Similarity
363 Args : [optional] new value to set
369 Usage : $evalue = $obj->significance();
370 $obj->significance($evalue);
371 Function: Get/Set the significance value
373 Args : [optional] new value to set
379 Usage : my $score = $hsp->score();
380 Function: Returns the score for this HSP or undef
382 Args : [optional] numeric to set value
389 Usage : my $bits = $hsp->bits();
390 Function: Returns the bit value for this HSP or undef
396 sub bits
{ return 0; }