3 # BioPerl module for Bio::Search::HSP::HMMERHSP
5 # Cared for by Jason Stajich <jason@bioperl.org>
7 # Copyright Jason Stajich
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
15 Bio::Search::HSP::HMMERHSP - A HSP object for HMMER results
19 use Bio::Search::HSP::HMMERHSP;
20 # us it just like a Bio::Search::HSP::GenericHSP object
24 This object is a specialization of L<Bio::Search::HSP::GenericHSP>.
30 User feedback is an integral part of the evolution of this and other
31 Bioperl modules. Send your comments and suggestions preferably to
32 the Bioperl mailing list. Your participation is much appreciated.
34 bioperl-l@bioperl.org - General discussion
35 http://bioperl.org/MailList.shtml - About the mailing lists
39 Report bugs to the Bioperl bug tracking system to help us keep track
40 of the bugs and their resolution. Bug reports can be submitted via
43 bioperl-bugs@bioperl.org
44 http://bugzilla.bioperl.org/
46 =head1 AUTHOR - Jason Stajich
48 Email jason@bioperl.org
50 Describe contact details here
54 Additional contributors names and emails here
58 The rest of the documentation details each of the object methods.
59 Internal methods are usually preceded with a _
64 # Let the code begin...
67 package Bio
::Search
::HSP
::HMMERHSP
;
70 use Bio::Search::HSP::GenericHSP;
72 @ISA = qw(Bio::Search::HSP::GenericHSP);
77 Usage : my $obj = new Bio::Search::HSP::HMMERHSP();
78 Function: Builds a new Bio::Search::HSP::HMMERHSP object
79 Returns : Bio::Search::HSP::HMMERHSP
82 Plus Bio::Seach::HSP::GenericHSP methods
84 -algorithm => algorithm used (BLASTP, TBLASTX, FASTX, etc)
87 -bits => bit value for HSP
88 -score => score value for HSP (typically z-score but depends on
90 -hsp_length=> Length of the HSP (including gaps)
91 -identical => # of residues that that matched identically
92 -conserved => # of residues that matched conservatively
93 (only protein comparisions;
94 conserved == identical in nucleotide comparisons)
95 -hsp_gaps => # of gaps in the HSP
96 -query_gaps => # of gaps in the query in the alignment
97 -hit_gaps => # of gaps in the subject in the alignment
98 -query_name => HSP Query sequence name (if available)
99 -query_start => HSP Query start (in original query sequence coords)
100 -query_end => HSP Query end (in original query sequence coords)
101 -hit_name => HSP Hit sequence name (if available)
102 -hit_start => HSP Hit start (in original hit sequence coords)
103 -hit_end => HSP Hit end (in original hit sequence coords)
104 -hit_length => total length of the hit sequence
105 -query_length=> total length of the query sequence
106 -query_seq => query sequence portion of the HSP
107 -hit_seq => hit sequence portion of the HSP
108 -homology_seq=> homology sequence for the HSP
109 -hit_frame => hit frame (only if hit is translated protein)
110 -query_frame => query frame (only if query is translated protein)
114 =head2 Bio::Search::HSP::HSPI methods
116 Implementation of Bio::Search::HSP::HSPI methods follow
121 Usage : my $r_type = $hsp->algorithm
122 Function: Obtain the name of the algorithm used to obtain the HSP
123 Returns : string (e.g., BLASTP)
124 Args : [optional] scalar string to set value
131 Usage : my $pvalue = $hsp->pvalue();
132 Function: Returns the P-value for this HSP or undef
133 Returns : float or exponential (2e-10)
134 P-value is not defined with NCBI Blast2 reports.
135 Args : [optional] numeric to set value
142 Usage : my $evalue = $hsp->evalue();
143 Function: Returns the e-value for this HSP
144 Returns : float or exponential (2e-10)
145 Args : [optional] numeric to set value
149 =head2 frac_identical
151 Title : frac_identical
152 Usage : my $frac_id = $hsp->frac_identical( ['query'|'hit'|'total'] );
153 Function: Returns the fraction of identitical positions for this HSP
154 Returns : Float in range 0.0 -> 1.0
155 Args : arg 1: 'query' = num identical / length of query seq (without gaps)
156 'hit' = num identical / length of hit seq (without gaps)
157 'total' = num identical / length of alignment (with gaps)
159 arg 2: [optional] frac identical value to set for the type requested
163 =head2 frac_conserved
165 Title : frac_conserved
166 Usage : my $frac_cons = $hsp->frac_conserved( ['query'|'hit'|'total'] );
167 Function : Returns the fraction of conserved positions for this HSP.
168 This is the fraction of symbols in the alignment with a
170 Returns : Float in range 0.0 -> 1.0
171 Args : arg 1: 'query' = num conserved / length of query seq (without gaps)
172 'hit' = num conserved / length of hit seq (without gaps)
173 'total' = num conserved / length of alignment (with gaps)
175 arg 2: [optional] frac conserved value to set for the type requested
182 Usage : my $gaps = $hsp->gaps( ['query'|'hit'|'total'] );
183 Function : Get the number of gaps in the query, hit, or total alignment.
184 Returns : Integer, number of gaps or 0 if none
185 Args : arg 1: 'query' = num gaps in query seq
186 'hit' = num gaps in hit seq
187 'total' = num gaps in whole alignment
189 arg 2: [optional] integer gap value to set for the type requested
196 Usage : my $qseq = $hsp->query_string;
197 Function: Retrieves the query sequence of this HSP as a string
199 Args : [optional] string to set for query sequence
207 Usage : my $hseq = $hsp->hit_string;
208 Function: Retrieves the hit sequence of this HSP as a string
210 Args : [optional] string to set for hit sequence
216 =head2 homology_string
218 Title : homology_string
219 Usage : my $homo_string = $hsp->homology_string;
220 Function: Retrieves the homology sequence for this HSP as a string.
221 : The homology sequence is the string of symbols in between the
222 : query and hit sequences in the alignment indicating the degree
223 : of conservation (e.g., identical, similar, not similar).
225 Args : [optional] string to set for homology sequence
232 Usage : my $len = $hsp->length( ['query'|'hit'|'total'] );
233 Function : Returns the length of the query or hit in the alignment
235 or the aggregate length of the HSP (including gaps;
236 this may be greater than either hit or query )
238 Args : arg 1: 'query' = length of query seq (without gaps)
239 'hit' = length of hit seq (without gaps)
240 'total' = length of alignment (with gaps)
242 arg 2: [optional] integer length value to set for specific type
246 =head2 percent_identity
248 Title : percent_identity
249 Usage : my $percentid = $hsp->percent_identity()
250 Function: Returns the calculated percent identity for an HSP
251 Returns : floating point between 0 and 100
261 Usage : $hsp->frame($queryframe,$subjectframe)
262 Function: Set the Frame for both query and subject and insure that
264 This overrides the frame() method implementation in
266 Returns : array of query and subjects if return type wants an array
267 or query frame if defined or subject frame
269 Note : Frames are stored in the GFF way (0-2) not 1-3
270 as they are in BLAST (negative frames are deduced by checking
271 the strand of the query or hit)
279 Usage : my $aln = $hsp->gel_aln
280 Function: Returns a Bio::SimpleAlign representing the HSP alignment
281 Returns : Bio::SimpleAlign
288 $self->warn("Innapropriate to build a Bio::SimpleAlign from a HMMER HSP object");
294 Title : num_conserved
295 Usage : $obj->num_conserved($newval)
296 Function: returns the number of conserved residues in the alignment
298 Args : integer (optional)
305 Title : num_identical
306 Usage : $obj->num_identical($newval)
307 Function: returns the number of identical residues in the alignment
309 Args : integer (optional)
317 Purpose : Get a list of residue positions (indices) for all identical
318 : or conserved residues in the query or sbjct sequence.
319 Example : @s_ind = $hsp->seq_inds('query', 'identical');
320 : @h_ind = $hsp->seq_inds('hit', 'conserved');
321 : @h_ind = $hsp->seq_inds('hit', 'conserved', 1);
322 Returns : List of integers
323 : May include ranges if collapse is true.
324 Argument : seq_type = 'query' or 'hit' or 'sbjct' (default = query)
325 : ('sbjct' is synonymous with 'hit')
326 : class = 'identical' or 'conserved' or 'nomatch' or 'gap'
327 : (default = identical)
328 : (can be shortened to 'id' or 'cons')
330 : collapse = boolean, if true, consecutive positions are merged
331 : using a range notation, e.g., "1 2 3 4 5 7 9 10 11"
332 : collapses to "1-5 7 9-11". This is useful for
333 : consolidating long lists. Default = no collapse.
337 See Also : L<Bio::Search::BlastUtils::collapse_nums()|Bio::Search::BlastUtils>, L<Bio::Search::Hit::HitI::seq_inds()|Bio::Search::Hit::HitI>
341 =head2 Inherited from Bio::SeqFeature::SimilarityPair
343 These methods come from Bio::SeqFeature::SimilarityPair
348 Usage : my $query = $hsp->query
349 Function: Returns a SeqFeature representing the query in the HSP
350 Returns : Bio::SeqFeature::Similarity
351 Args : [optional] new value to set
357 Usage : my $hit = $hsp->hit
358 Function: Returns a SeqFeature representing the hit in the HSP
359 Returns : Bio::SeqFeature::Similarity
360 Args : [optional] new value to set
366 Usage : $evalue = $obj->significance();
367 $obj->significance($evalue);
368 Function: Get/Set the significance value
370 Args : [optional] new value to set
376 Usage : my $score = $hsp->score();
377 Function: Returns the score for this HSP or undef
379 Args : [optional] numeric to set value
386 Usage : my $bits = $hsp->bits();
387 Function: Returns the bit value for this HSP or undef