NAME
Bio::Search::HSP::PullHSPI - Bio::Search::HSP::HSPI interface for pull parsers.
SYNOPSIS
# This is an interface and cannot be instantiated# generally we use Bio::SearchIO to build these objectsuse Bio::SearchIO;my $in = Bio::SearchIO->new(-format => 'hmmer_pull',-file => 'result.hmmer');while (my $result = $in->next_result) {while (my $hit = $result->next_hit) {while (my $hsp = $hit->next_hsp) {$r_type = $hsp->algorithm;$pvalue = $hsp->p();$evalue = $hsp->evalue();$frac_id = $hsp->frac_identical( ['query'|'hit'|'total'] );$frac_cons = $hsp->frac_conserved( ['query'|'hit'|'total'] );$gaps = $hsp->gaps( ['query'|'hit'|'total'] );$qseq = $hsp->query_string;$hseq = $hsp->hit_string;$homo_string = $hsp->homology_string;$len = $hsp->length( ['query'|'hit'|'total'] );$len = $hsp->length( ['query'|'hit'|'total'] );$rank = $hsp->rank;}}}
DESCRIPTION
PullHSP is for fast implementations that only do parsing work on the hsp data when you actually request information by calling one of the HSPI methods.
Many methods of HSPI are implemented in a way suitable for inheriting classes that use Bio::PullParserI. It only really makes sense for PullHSP modules to be created by (and have as a -parent) PullHit modules.
In addition to the usual -chunk and -parent, -hsp_data is all you should supply when making a PullHSP object. This will store that data and make it accessible via _raw_hsp_data, which you can access in your subclass. It would be best to simply provide the data as the input -chunk instead, if the raw data is large enough.
SEE ALSO
This module inherits methods from these other modules:
Bio::SeqFeatureI, Bio::SeqFeature::FeaturePair Bio::SeqFeature::SimilarityPair
Please refer to these modules for documentation of the many additional inherited methods.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Sendu Bala
Email [email protected]
COPYRIGHT
Copyright (c) 2006 Sendu Bala. All Rights Reserved.
DISCLAIMER
This software is provided "as is" without warranty of any kind.
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
_setup
Title : _setupUsage : $self->_setup(@args)Function: Implementers should call this to setup common fields and deal withcommon arguments to new().Returns : n/aArgs : @args received in new().
algorithm
Title : algorithmUsage : my $r_type = $hsp->algorithmFunction: Obtain the name of the algorithm used to obtain the HSPReturns : string (e.g., BLASTP)Args : none
pvalue
Title : pvalueUsage : my $pvalue = $hsp->pvalue();Function: Returns the P-value for this HSP or undefReturns : float or exponential (2e-10)Args : none
evalue
Title : evalueUsage : my $evalue = $hsp->evalue();Function: Returns the e-value for this HSPReturns : float or exponential (2e-10)Args : none
frac_identical
Title : frac_identicalUsage : my $frac_id = $hsp->frac_identical( ['query'|'hit'|'total'] );Function: Returns the fraction of identitical positions for this HSPReturns : Float in range 0.0 -> 1.0Args : 'query' = num identical / length of query seq (without gaps)'hit' = num identical / length of hit seq (without gaps)'total' = num identical / length of alignment (with gaps)default = 'total'
frac_conserved
Title : frac_conservedUsage : my $frac_cons = $hsp->frac_conserved( ['query'|'hit'|'total'] );Function : Returns the fraction of conserved positions for this HSP.This is the fraction of symbols in the alignment with apositive score.Returns : Float in range 0.0 -> 1.0Args : 'query' = num conserved / length of query seq (without gaps)'hit' = num conserved / length of hit seq (without gaps)'total' = num conserved / length of alignment (with gaps)default = 'total'
num_identical
Title : num_identicalUsage : $obj->num_identical($newval)Function: returns the number of identical residues in the alignmentReturns : integerArgs : integer (optional)
num_conserved
Title : num_conservedUsage : $obj->num_conserved($newval)Function: returns the number of conserved residues in the alignmentReturns : inetgerArgs : integer (optional)
gaps
Title : gapsUsage : my $gaps = $hsp->gaps( ['query'|'hit'|'total'] );Function : Get the number of gap characters in the query, hit, or total alignment.Returns : Integer, number of gap characters or 0 if noneArgs : 'query', 'hit' or 'total'; default = 'total'
query_string
Title : query_stringUsage : my $qseq = $hsp->query_string;Function: Retrieves the query sequence of this HSP as a stringReturns : stringArgs : none
hit_string
Title : hit_stringUsage : my $hseq = $hsp->hit_string;Function: Retrieves the hit sequence of this HSP as a stringReturns : stringArgs : none
homology_string
Title : homology_stringUsage : my $homo_string = $hsp->homology_string;Function: Retrieves the homology sequence for this HSP as a string.: The homology sequence is the string of symbols in between the: query and hit sequences in the alignment indicating the degree: of conservation (e.g., identical, similar, not similar).Returns : stringArgs : none
length
Title : lengthUsage : my $len = $hsp->length( ['query'|'hit'|'total'] );Function : Returns the length of the query or hit in the alignment (without gaps)or the aggregate length of the HSP (including gaps;this may be greater than either hit or query )Returns : integerArgs : 'query' = length of query seq (without gaps)'hit' = length of hit seq (without gaps)'total' = length of alignment (with gaps)default = 'total'Args : none
hsp_length
Title : hsp_lengthUsage : my $len = $hsp->hsp_length()Function: shortcut length('hsp')Returns : floating point between 0 and 100Args : none
percent_identity
Title : percent_identityUsage : my $percentid = $hsp->percent_identity()Function: Returns the calculated percent identity for an HSPReturns : floating point between 0 and 100Args : none
get_aln
Title : get_alnUsage : my $aln = $hsp->get_alnFunction: Returns a Bio::SimpleAlign representing the HSP alignmentReturns : Bio::SimpleAlignArgs : none
seq_inds
Title : seq_indsPurpose : Get a list of residue positions (indices) for all identical: or conserved residues in the query or sbjct sequence.Example : @s_ind = $hsp->seq_inds('query', 'identical');: @h_ind = $hsp->seq_inds('hit', 'conserved');: @h_ind = $hsp->seq_inds('hit', 'conserved', 1);Returns : List of integers: May include ranges if collapse is true.Argument : seq_type = 'query' or 'hit' or 'sbjct' (default = query)('sbjct' is synonymous with 'hit')class = 'identical' or 'conserved' or 'nomatch' or 'gap'(default = identical)(can be shortened to 'id' or 'cons')Note that 'conserved' includes identical unless youuse 'conserved-not-identical'collapse = boolean, if true, consecutive positions are mergedusing a range notation, e.g., "1 2 3 4 5 7 9 10 11"collapses to "1-5 7 9-11". This is useful forconsolidating long lists. Default = no collapse.Throws : n/a.Comments :
See Also : Bio::Search::BlastUtils::collapse_nums(), Bio::Search::Hit::HitI::seq_inds()
Inherited from Bio::SeqFeature::SimilarityPair
These methods come from Bio::SeqFeature::SimilarityPair
query
Title : queryUsage : my $query = $hsp->queryFunction: Returns a SeqFeature representing the query in the HSPReturns : Bio::SeqFeature::SimilarityArgs : [optional] new value to set
hit
Title : hitUsage : my $hit = $hsp->hitFunction: Returns a SeqFeature representing the hit in the HSPReturns : Bio::SeqFeature::SimilarityArgs : [optional] new value to set
significance
Title : significanceUsage : $evalue = $obj->significance();$obj->significance($evalue);Function: Get/Set the significance value (see Bio::SeqFeature::SimilarityPair)Returns : significance value (scientific notation string)Args : significance value (sci notation string)
score
Title : scoreUsage : my $score = $hsp->score();Function: Returns the score for this HSP or undefReturns : numericArgs : [optional] numeric to set value
bits
Title : bitsUsage : my $bits = $hsp->bits();Function: Returns the bit value for this HSP or undefReturns : numericArgs : none
strand
Title : strandUsage : $hsp->strand('query')Function: Retrieves the strand for the HSP component requestedReturns : +1 or -1 (0 if unknown)Args : 'hit' or 'subject' or 'sbjct' to retrieve the strand of the subject'query' to retrieve the query strand (default)'list' or 'array' to retrieve both query and hit together
start
Title : startUsage : $hsp->start('query')Function: Retrieves the start for the HSP component requestedReturns : integer, or list of two integers (query start and subject start) inlist contextArgs : 'hit' or 'subject' or 'sbjct' to retrieve the start of the subject'query' to retrieve the query start (default)
end
Title : endUsage : $hsp->end('query')Function: Retrieves the end for the HSP component requestedReturns : integer, or list of two integers (query end and subject end) inlist contextArgs : 'hit' or 'subject' or 'sbjct' to retrieve the end of the subject'query' to retrieve the query end (default)
seq
Usage : $hsp->seq( [seq_type] );Purpose : Get the query or sbjct sequence as a Bio::Seq.pm object.Example : $seqObj = $hsp->seq('query');Returns : Object reference for a Bio::LocatableSeq object.Argument : seq_type = 'query' or 'hit' or 'sbjct' (default = 'query').: ('sbjct' is synonymous with 'hit'): default is 'query'
seq_str
Usage : $hsp->seq_str( seq_type );Purpose : Get the full query, sbjct, or 'match' sequence as a string.: The 'match' sequence is the string of symbols in between the: query and sbjct sequences.Example : $str = $hsp->seq_str('query');Returns : StringArgument : seq_Type = 'query' or 'hit' or 'sbjct' or 'match': ('sbjct' is synonymous with 'hit'): default is 'query'Throws : Exception if the argument does not match an accepted seq_type.Comments :
See Also : seq(), seq_inds(), _set_match_seq()
rank
Usage : $hsp->rank( [string] );Purpose : Get the rank of the HSP within a given Blast hit.Example : $rank = $hsp->rank;Returns : Integer (1..n) corresponding to the order in which the HSPappears in the BLAST report.
matches
Usage : $hsp->matches(-seq => 'hit'|'query',-start => $start,-stop => $stop);Purpose : Get the total number of identical and conservative matches: in the query or sbjct sequence for the given HSP. Optionally can: report data within a defined interval along the seq.Example : ($id,$cons) = $hsp_object->matches(-seq => 'hit');: ($id,$cons) = $hsp_object->matches(-seq => 'query',-start => 300,-stop => 400);Returns : 2-element array of integersArgument : (1) seq_type = 'query' or 'hit' or 'sbjct' (default = query): ('sbjct' is synonymous with 'hit'): (2) start = Starting coordinate (optional): (3) stop = Ending coordinate (optional)
n
Usage : $hsp_obj->n()Purpose : Get the N value (num HSPs on which P/Expect is based).Returns : Integer or null string if not defined.Argument : n/aThrows : n/aComments : The 'N' value is listed in parenthesis with P/Expect value:: e.g., P(3) = 1.2e-30 ---> (N = 3).: Not defined in NCBI Blast2 with gaps.: This typically is equal to the number of HSPs but not always.
range
Usage : $hsp->range( [seq_type] );Purpose : Gets the (start, end) coordinates for the query or sbjct sequence: in the HSP alignment.Example : ($query_beg, $query_end) = $hsp->range('query');: ($hit_beg, $hit_end) = $hsp->range('hit');Returns : Two-element array of integersArgument : seq_type = string, 'query' or 'hit' or 'sbjct' (default = 'query'): ('sbjct' is synonymous with 'hit')Throws : n/aComments : This is a convenience method for constructions such as($hsp->query->start, $hsp->query->end)