Bio::S...esultI(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’… NAME πŸ’…

Bio::Search::Result::ResultI β€” the abstract interface to Search Result objects πŸ¦‹ (it's a pure interface, bestie, meaning it's the vibe, the blueprint, the idea of a result β€” not a thing you can just instantiate, no cap)


✨ SYNOPSIS ✨

# Bio::Search::Result::ResultI objects cannot be instantiated since this
# module defines a pure interface.

# Given an object that implements the Bio::Search::Result::ResultI
interface, # you can do the following things with it:

    use Bio::SearchIO;
    my $io = Bio::SearchIO->new(-format => 'blast',
                                -file   => 't/data/HUMBETGLOA.tblastx');
    my $result = $io->next_result;
    while( $hit = $result->next_hit()) { # enter code here for hit processing
    }

    my $id = $result->query_name();

    my $desc = $result->query_description();

    my $dbname = $result->database_name();

    my $size = $result->database_letters();

    my $num_entries = $result->database_entries();

    my $gap_ext = $result->get_parameter('gapext');

    my @params = $result->available_parameters;

    my $kappa = $result->get_statistic('kappa');

    my @statnames = $result->available_statistics;

🌸 DESCRIPTION 🌸

So like, Bio::Search::Result::ResultI objects are data structures holding the results from running a search algorithm. Because of that, they can carry all sorts of algorithm-specific info plus the deets of the actual execution β€” but every single one of them will always have a few fundamental elements, including the ability to hand you back Bio::Search::Hit::HitI objects. That's the whole point, periodt. πŸ‘‘


🫢 FEEDBACK 🫢

πŸ’Œ Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules β€” like genuinely, your comments and suggestions are the moment. Please send them preferably to one of the Bioperl mailing lists. 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. Like, for real β€” so many experienced and responsive 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 so we can keep track of the bugs and their resolution. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

πŸ‘‘ AUTHOR πŸ‘‘

Aaron Mackey <amackey@virginia.edu> (original author)

Steve Chervitz <sac@bioperl.org>

See the FEEDBACK section for where to send bug reports and comments. πŸ“¬


Copyright (c) 1999-2001 Aaron Mackey, Steve Chervitz. All Rights Reserved.


πŸ’€ DISCLAIMER πŸ’€

This software is provided "as is" without warranty of any kind. (Not me manifesting bugs, that's just literally what it says. 🫠)


πŸŽ€ APPENDIX πŸŽ€

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (iykyk, the underscore ones are the private besties).

πŸ¦‹ next_hit

  • Title : next_hit
  • Usage : while( $hit = $result->next_hit()) { ... }
  • Function : Returns the next available Hit object, representing potential matches between the query and various entities from the database.
  • Returns : a Bio::Search::Hit::HitI object or undef if there are no more.
  • Args : none

πŸ¦‹ sort_hits

  • Title : sort_hits
  • Usage : $result->sort_hits(\&sort_function)
  • Function : Sorts the available hit objects by a user-supplied function. Defaults to sort by descending score.
  • Returns : n/a
  • Args : A coderef for the sort function. See the documentation on the Perl sort() function for guidelines on writing sort functions.
  • Note : To access the special variables $a and $b used by the Perl sort() function the user function must access the Bio::Search::Result::ResultI namespace. For example, use :
$result->sort_hits( sub{$Bio::Search::Result::ResultI::a->length <=>
                            $Bio::Search::Result::ResultI::b->length});

NOT $result->sort_hits($a->length <=>$b->length);

⚠️ Bestie this one gets people every time β€” you gotta fully qualify that namespace or it's not gonna work, fr fr.

πŸ¦‹ _default sort_hits

  • Title : _default_sort_hits
  • Usage : Do not call directly.
  • Function : Sort hits in descending order by score
  • Args : None
  • Returns : 1 on success
  • Note : Used by $result->sort_hits()

πŸ¦‹ query_name

  • Title : query_name
  • Usage : $id = $result->query_name();
  • Function : Get the string identifier of the query used by the algorithm that performed the search.
  • Returns : a string.
  • Args : none

πŸ¦‹ query_accession

  • Title : query_accession
  • Usage : $id = $result->query_accession();
  • Function : Get the accession (if available) for the query sequence
  • Returns : a string
  • Args : none

πŸ¦‹ query_length

  • Title : query_length
  • Usage : $id = $result->query_length();
  • Function : Get the length of the query sequence used in the search.
  • Returns : a number
  • Args : none

πŸ¦‹ query_description

  • Title : query_description
  • Usage : $id = $result->query_description();
  • Function : Get the description of the query sequence used in the search.
  • Returns : a string
  • Args : none

πŸ¦‹ database_name

  • Title : database_name
  • Usage : $name = $result->database_name()
  • Function : Used to obtain the name of the database that the query was searched against by the algorithm.
  • Returns : a scalar string
  • Args : none

πŸ¦‹ database_letters

  • Title : database_letters
  • Usage : $size = $result->database_letters()
  • Function : Used to obtain the size of database that was searched against.
  • Returns : a scalar integer (units specific to algorithm, but probably the total number of residues in the database, if available) or undef if the information was not available to the Processor object.
  • Args : none

πŸ¦‹ database_entries

  • Title : database_entries
  • Usage : $num_entries = $result->database_entries()
  • Function : Used to obtain the number of entries contained in the database.
  • Returns : a scalar integer representing the number of entities in the database or undef if the information was not available.
  • Args : none

πŸ¦‹ get_parameter

  • Title : get_parameter
  • Usage : my $gap_ext = $result->get_parameter('gapext')
  • Function : Returns the value for a specific parameter used when running this result
  • Returns : string
  • Args : name of parameter (string)

πŸ¦‹ available_parameters

  • Title : available_parameters
  • Usage : my @params = $result->available_parameters
  • Function : Returns the names of the available parameters
  • Returns : Return list of available parameters used for this result
  • Args : none

πŸ¦‹ get_statistic

  • Title : get_statistic
  • Usage : my $gap_ext = $result->get_statistic('kappa')
  • Function : Returns the value for a specific statistic available from this result
  • Returns : string
  • Args : name of statistic (string)

πŸ¦‹ available_statistics

  • Title : available_statistics
  • Usage : my @statnames = $result->available_statistics
  • Function : Returns the names of the available statistics
  • Returns : Return list of available statistics used for this result
  • Args : none

πŸ¦‹ algorithm

  • Title : algorithm
  • Usage : my $r_type = $result->algorithm
  • Function : Obtain the name of the algorithm used to obtain the Result
  • Returns : string (e.g., BLASTP)
  • Args : [optional] scalar string to set value

πŸ¦‹ algorithm_version

  • Title : algorithm_version
  • Usage : my $r_version = $result->algorithm_version
  • Function : Obtain the version of the algorithm used to obtain the Result
  • Returns : string (e.g., 2.1.2)
  • Args : [optional] scalar string to set algorithm version value

πŸ¦‹ algorithm_reference

  • Title : algorithm_reference
  • Usage : $obj->algorithm_reference($newval)
  • Function :
  • Returns : value of the literature reference for the algorithm
  • Args : newvalue (optional)
  • Comments : The default implementation in ResultI returns an empty string rather than throwing a NotImplemented exception, since the ref may not always be available and is not critical.

πŸ¦‹ rid

πŸ¦‹ num_hits

  • Title : num_hits
  • Usage : my $hitcount= $result->num_hits
  • Function : returns the number of hits for this query result
  • Returns : integer
  • Args : none

πŸ¦‹ hits

  • Title : hits
  • Usage : my @hits = $result->hits
  • Function : Returns the HitI objects contained within this Result
  • Returns : Array of Bio::Search::Hit::HitI objects
  • Args : none

See Also: Bio::Search::Hit::HitI

πŸ¦‹ no_hits_found

  • Usage : $nohits = $blast->no_hits_found();
  • Purpose : Get boolean indicator indicating whether or not any hits were present in the report.

This is NOT the same as determining the number of hits via the hits() method, which will return zero hits if there were no hits in the report or if all hits were filtered out during the parse.

Thus, this method can be used to distinguish these possibilities for hitless reports generated when filtering.

  • Returns : Boolean
  • Argument : none

πŸ¦‹ set_no_hits_found

  • Usage : $blast->set_no_hits_found();
  • Purpose : Set boolean indicator indicating whether or not any hits were present in the report.
  • Returns : n/a
  • Argument : none

And that's the whole page, bestie β€” you ate that. πŸ’…βœ¨

This was Bio::Search::Result::ResultI, documented as part of the User Contributed Perl Documentation, running on perl v5.32.1, dated 2021-08-15. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from