Bio::S...delHit(3pm)
okay bestie, gather round, because this is the manual page for Bio::Search::Hit::ModelHit(3pm) and it's giving β¨model-based hit energyβ¨ π
β¨ NAME β¨
Bio::Search::Hit::ModelHitβ a model-based implementation of theBio::Search::Hit::HitIinterface π
πΈ SYNOPSIS πΈ
use Bio::Search::Hit::ModelHit;
my $hit = Bio::Search::Hit::ModelHit->new(-algorithm => 'rnamotif');
# typically one gets HitI objects from a SearchIO stream via a ResultI
use Bio::SearchIO;
my $parser = Bio::SearchIO->new(-format => 'infernal', -file => 'trap.inf');
my $result = $parser->next_result;
my $hit = $result->next_hit;
π« DESCRIPTION π«
This object handles the hit data from a database search using models or descriptors instead of sequences, such as Infernal, HMMER, RNAMotif, etc. π§¬β¨
Unless you're writing a parser, you won't ever need to create a ModelHit or any other HitI-implementing object. If you use the SearchIO system, HitI objects are created automatically from a SearchIO stream which returns Bio::Search::Hit::HitI objects. π
β οΈ Note that severalHitI-based methods have been overridden fromModelHitdue to their unreliability when dealing with queries that aren't sequence-based. It may be possible to reimplement these at a later point, but for the time being they will throw warnings and return w/o results.
For documentation on what you can do with ModelHit (and other HitI objects), please see the API documentation in Bio::Search::Hit::HitI. π
π¬ 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. π«Ά
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
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 - Chris Fields π
Email cjfields at bioperl dot org
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ π
π HitI methods implemented in parent class Bio::Search::Hit::ModelHit π
new
bestie, you're building a new Bio::Search::Hit::ModelHit from scratch? iconic. π
- Title:
new - Usage:
my $obj = Bio::Search::Hit::ModelHit->new(); - Function: Builds a new
Bio::Search::Hit::ModelHitobject β¨ - Returns:
Bio::Search::Hit::ModelHit - Args:
-nameβ Name of Hit (required) π-descriptionβ Description (optional)-accessionβ Accession number (optional)-ncbi_giβ NCBI GI UID (optional)-lengthβ Length of the Hit (optional)-scoreβ Raw Score for the Hit (optional)-bitsβ Bit Score for the Hit (optional)-significanceβ Significance value for the Hit (optional)-algorithmβ Algorithm used (BLASTP, FASTX, etc...)-hspsβ Array ref of HSPs for this Hit.-found_againβ boolean, true if hit appears in a "previously found" section of a PSI-Blast report.-hsp_factoryβBio::Factory::ObjectFactoryIable to create HSPI objects.
add_hsp
got an HSP? add it to the collection, no cap. π§©
- Title:
add_hsp - Usage:
$hit->add_hsp($hsp) - Function: Add a HSP to the collection of HSPs for a Hit
- Returns: number of HSPs in the Hit
- Args:
Bio::Search::HSP::HSPIobject, OR hash ref containing data suitable for creating a HSPI object (&hsp_factory must be set to get it back)
hsp_factory
get or set the factory for building HSPI objects when you need it. π
- Title:
hsp_factory - Usage:
$hit->hsp_factory($hsp_factory) - Function: Get/set the factory used to build HSPI objects if necessary.
- Returns:
Bio::Factory::ObjectFactoryI - Args:
Bio::Factory::ObjectFactoryI
π Bio::Search::Hit::HitI methods π
Implementation of Bio::Search::Hit::HitI methods
name
grab (or set) the name of the Hit sequence. π·οΈ
- Title:
name - Usage:
$hit_name = $hit->name(); - Function: returns the name of the Hit sequence
- Returns: a scalar string
- Args: [optional] scalar string to set the name
accession
get that accession number if it's there. π
- Title:
accession - Usage:
$acc = $hit->accession(); - Function: Retrieve the accession (if available) for the hit
- Returns: a scalar string (empty string if not set)
- Args: none
description
get (or set) the description. π
- Title:
description - Usage:
$desc = $hit->description(); - Function: Retrieve the description for the hit
- Returns: a scalar string
- Args: [optional] scalar string to set the description
length
how long is this hit? find out. π
- Title:
length - Usage:
my $len = $hit->length - Function: Returns the length of the hit
- Returns: integer
- Args: [optional] integer to set the length
algorithm
what algorithm made this hit? here's the spec. π§ͺ
- Title:
algorithm - Usage:
$alg = $hit->algorithm(); - Function: Gets the algorithm specification that was used to obtain the hit. For BLAST, the algorithm denotes what type of sequence was aligned against what (BLASTN: dna-dna, BLASTP prt-prt, BLASTX translated dna-prt, TBLASTN prt-translated dna, TBLASTX translated dna-translated dna).
- Returns: a scalar string
- Args: [optional] scalar string to set the algorithm
raw_score
the raw score, whatever that means for your algorithm. π―
- Title:
raw_score - Usage:
$score = $hit->raw_score(); - Function: Gets the "raw score" generated by the algorithm. What this score is exactly will vary from algorithm to algorithm, returning undef if unavailable.
- Returns: a scalar value
- Args: [optional] scalar value to set the raw score
score
literally just raw_score(). β¨
significance
the E or P value β probability it was random chance. π²
- Title:
significance - Usage:
$significance = $hit->significance(); - Function: Used to obtain the E or P value of a hit, i.e. the probability that this particular hit was obtained purely by random chance. If information is not available (nor calculatable from other information sources), return undef.
- Returns: a scalar value or undef if unavailable
- Args: [optional] scalar value to set the significance
bits
bit score of the best HSP. π₯
- Usage:
$hit_object->bits(); - Purpose: Gets the bit score of the best HSP for the current hit.
- Example:
$bits = $hit_object->bits(); - Returns: Integer or undef if bit score is not set
- Argument: n/a
- Comments: For BLAST1, the non-bit score is listed in the summary line.
- See Also:
score()
next_hsp
iterate through your HSPs. π
- Title:
next_hsp - Usage:
while( $hsp = $obj->next_hsp()) { ... } - Function: Returns the next available High Scoring Pair
- Example:
- Returns:
Bio::Search::HSP::HSPIobject or null if finished - Args: none
hsps
get all the HSPs (or just count them). π
- Usage:
$hit_object->hsps(); - Purpose:
- Get a list containing all HSP objects.
- Get the numbers of HSPs for the current hit.
- Example:
@hsps = $hit_object->hsps();
$num = $hit_object->hsps(); # alternatively, use num_hsps()
- Returns:
- Array context : list of
Bio::Search::HSP::BlastHSP.pmobjects. - Scalar context: integer (number of HSPs).
- (Equivalent to
num_hsps()).
- Array context : list of
- Argument: n/a. Relies on
wantarray - Throws: Exception if the HSPs have not been collected.
- See Also:
hsp(),num_hsps()
num_hsps
how many HSPs? this many. π’
- Usage:
$hit_object->num_hsps(); - Purpose: Get the number of HSPs for the present hit.
- Example:
$nhsps = $hit_object->num_hsps(); - Returns: Integer or
'-'if HSPs have not been callected - Argument: n/a
- See Also:
hsps()
rewind
reset that HSP iterator back to the start. π
- Title:
rewind - Usage:
$hit->rewind; - Function: Allow one to reset the HSP iterator to the beginning. Since this is an in-memory implementation.
- Returns: none
- Args: none
ambiguous_aln
set/get the ambiguity code. π€
- Usage:
$ambig_code = $hit_object->ambiguous_aln(); - Purpose: Sets/Gets ambiguity code data member.
- Example: (see usage)
- Returns: String =
'q','s','qs','-''q'= query sequence contains overlapping sub-sequences while sbjct does not.'s'= sbjct sequence contains overlapping sub-sequences while query does not.'qs'= query and sbjct sequence contains overlapping sub-sequences relative to each other.'-'= query and sbjct sequence do not contains multiple domains relative to each other OR both contain the same distribution of similar domains.
- Argument: n/a
- Throws: n/a
- Comment: Note: "sbjct" is synonymous with "hit"
overlap
see the docs in Bio::Search::Hit::HitI::overlap(). π
n
get the N number for the current hit. π
- Usage:
$hit_object->n(); - Purpose:
- Gets the N number for the current hit.
- This is the number of HSPs in the set which was ascribed the lowest P-value (listed on the description line).
- This number is not the same as the total number of HSPs.
- To get the total number of HSPs, use
num_hsps().
- Example:
$n = $hit_object->n(); - Returns: Integer
- Argument: n/a
- Throws: Exception if HSPs have not been set.
- Comments:
- Calling
n()on such reports will result in a call tonum_hsps(). - The
num_hsps()method will count the actual number of HSPs in the alignment listing, which may exceed N in some cases.
- Calling
- See Also:
num_hsps()
π
p
okay so bestie, p is literally the P-value getter for the best HSP. here's the whole vibe check:
- Usage β
$hit_object->p( [format] ); - Purpose β grab the P-value for the best HSP
- Example β
$p = $sbjct->p;
$p = $sbjct->p('exp'); # get exponent only.
($num, $exp) = $sbjct->p('parts'); # split sci notation into parts
- Returns β
- a Float or scientific notation number β that's the raw P-value, and it's the DEFAULT
- an Integer if
format == 'exp'β the magnitude of the base 10 exponent - a 2-element list
(float, int)ifformat == 'parts'and the P-value is in scientific notation (peep the Comments below)
- Argument β
format, a string of'raw' | 'exp' | 'parts''raw'returns the value given in the report. Default. (1.2e-34)'exp'returns the exponent value only (34)'parts'returns the decimal and exponent as a 2-element list (1.2, -34) (see Comments)
- Throws β warns if no P-value is defined. Uses
expectinstead. - Comments β ngl, using the
'parts'argument is not recommended since it will not work as expected if the P-value is not in scientific notation. That is, floats are not converted into sci notation before splitting into parts. π« - See Also β
expect(),signif(),Bio::Search::SearchUtils::get_exponent()
π¦ hsp
- Usage β
$hit_object->hsp( [string] ); - Purpose β get a single HSPI object for the present HitI object
- Example β
$hspObj = $hit_object->hsp; # same as 'best'
$hspObj = $hit_object->hsp('best');
$hspObj = $hit_object->hsp('worst');
- Returns β an object reference for a
Bio::Search::HSP::BlastHSP.pmobject - Argument β a String (or no argument at all)
- No argument (default) = the highest scoring HSP (same as
'best') 'best'or'first'= the highest scoring HSP'worst'or'last'= the lowest scoring HSP
- No argument (default) = the highest scoring HSP (same as
- Throws β an exception if the HSPs have not been collected, and an exception if an unrecognized argument is used π
- See Also β
hsps(),num_hsps()
β rank
- Title β
rank - Usage β
$obj->rank($newval) - Function β get/set the rank of this Hit in the Query search list, i.e. this is the Nth hit for a specific query
- Returns β value of
rank - Args β newvalue (optional)
πΈ locus
- Title β
locus - Usage β
$locus = $hit->locus(); - Function β retrieve the locus (if available) for the hit
- Returns β a scalar string (empty string if not set)
- Args β none
π each_accession_number
- Title β
each_accession_number - Usage β
@each_accession_number = $hit->each_accession_number(); - Function β get each accession number listed in the description of the hit. If there are no alternatives, then only the primary accession will be given
- Returns β a list of all accession numbers in the description
- Args β none
π§ tiled_hsps
See documentation in Bio::Search::SearchUtils::tile_hsps()
π query_length
- Title β
query_length - Usage β
$obj->query_length($newval) - Function β get/set the
query_length - Returns β value of
query_length(a scalar) - Args β on set, the new value (a scalar or undef, optional)
π₯ ncbi_gi
- Title β
ncbi_gi - Usage β
$acc = $hit->ncbi_gi(); - Function β retrieve the NCBI Unique ID (aka the GI #), if available, for the hit
- Returns β a scalar string (empty string if not set)
- Args β none
- Note β as of Sept. 2016 NCBI records will no longer have a GI; this attributue will remain in place for older records π
π ModelHit methods overridden in ModelHit
The following methods have been overridden due to their current reliance on sequence-based queries. They may be implemented in future versions of this class.
length_alngapsmatchesstartendrangefrac_identicalfrac_conservedfrac_aligned_queryfrac_aligned_hitnum_unaligned_hitnum_unaligned_queryseq_indsstrandframelogical_length
and that's the whole page, bestie!! π«Ά this was Bio::S...delHit(3pm), shipped as part of perl v5.32.1 and dated 2021-08-15 β go off, you read the entire thing, main character energy fr fr πβ¨
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms