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

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

πŸ’– Bio::Search::Result::GenericResult β€” the manual, bestie edition πŸ’–

User Contributed Perl Documentation Β· Bio::S...Result(3pm)

okay so. you found the manual page for Bio::Search::Result::GenericResult and honestly? iconic of you. grab a strawberry πŸ“ and let's get into it.


✨ NAME ✨

Bio::Search::Result::GenericResult β€” a Generic Implementation of the Bio::Search::Result::ResultI interface that's applicable to most search results. she's the general-purpose girlie. she fits basically everywhere. πŸ’…


🌸 SYNOPSIS 🌸

here's the whole vibe, verbatim, no notes:

# typically one gets Results from a SearchIO stream
use Bio::SearchIO;
my $io = Bio::SearchIO->new(-format => 'blast',
                            -file   => 't/data/HUMBETGLOA.tblastx');
while( my $result = $io->next_result ) {
    # process all search results within the input stream
    while( my $hit = $result->next_hit ) {
        # insert code here for hit processing
    }
}

use Bio::Search::Result::GenericResult;
my @hits = (); # would be a list of Bio::Search::Hit::HitI objects
# typically these are created from a Bio::SearchIO stream
my $result = Bio::Search::Result::GenericResult->new
    ( -query_name        => 'HUMBETGLOA',
      -query_accession   => ''
      -query_description => 'Human haplotype C4 beta-globin gene, complete cds.'
      -query_length      => 3002
      -database_name     => 'ecoli.aa'
      -database_letters  => 4662239,
      -database_entries  => 400,
      -parameters        => { 'e' => '0.001' },
      -statistics        => { 'kappa' => 0.731 },
      -algorithm         => 'blastp',
      -algorithm_version => '2.1.2',
      );

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

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

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

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

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

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

my @params = $result->available_parameters;

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

my @statnames = $result->available_statistics;

# TODO: Show how to configure a SearchIO stream so that it generates #
GenericResult objects.

(and yes, that last line is a TODO that lives in the source, we're keeping it fr fr β€” someone's gonna get to it. someday. πŸ’€)


πŸ¦‹ DESCRIPTION πŸ¦‹

so what is this thing? GenericResult is an implementation of the Bio::Search::Result::ResultI interface, and it gives you a generic place to store results from a sequence database search. a little home for your search output. a cozy lil apartment for data. 🏠✨

here's the tea though β€” unless you're literally writing a parser, you will never need to create a GenericResult or any other ResultI-implementing object yourself. like, never ever. πŸ™ˆ if you're using the SearchIO system, ResultI objects just appear, auto-magically, created from a SearchIO stream which returns Bio::Search::Result::ResultI objects. the stream does the work, you do the vibing. πŸ‘‘

and if you wanna know what you can actually do with a GenericResult (or any other ResultI object), the API documentation lives over in Bio::Search::Result::ResultI. go read that one, bestie, it's the real main character. πŸ“–πŸ’–


πŸ’Œ FEEDBACK πŸ’Œ

πŸ“¬ Mailing Lists

user feedback is an integral part of the evolution of this and other Bioperl modules β€” like, genuinely, the whole thing grows because people talk to each other. 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

okay important, pls read this part: direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

...and not to the module maintainer directly. (respect the maintainer's peace, bestie. 😭) there are many experienced and reponsive experts on the list who'll be able to look at the problem and quickly address it. and if you can, include a thorough description of the problem with code and data examples β€” the more detail the better, it helps so much. ✨

πŸ› Reporting Bugs

report bugs to the Bioperl bug tracking system so we can keep track of the bugs and their resolution β€” that's the whole point, we wanna know what got fixed. bug reports can be submitted via the web:

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

πŸ‘‘ AUTHOR - Jason Stajich and Steve Chervitz πŸ‘‘

Email jason@bioperl.org Email sac@bioperl.org


🌈 CONTRIBUTORS 🌈

Sendu Bala, bix@sendu.me.uk


to be continued, bestie... πŸ’œ

🌸 APPENDIX 🌸

okay so this is the deep-lore part πŸ’– the rest of the docs break down every single object method, one by one, no skips. Internal methods are the shy ones β€” they usually start with an underscore, _. iykyk πŸ™ˆ


✨ new

  • Title β€” new
  • Usage β€” my $obj = Bio::Search::Result::GenericResult->new();
  • Function β€” builds you a shiny new Bio::Search::Result::GenericResult object
  • Returns β€” Bio::Search::Result::GenericResult
  • Args β€” all of these cuties, and yes they're exact:
-query_name        => Name of query Sequence
-query_accession   => Query accession number (if available)
-query_description => Description of query sequence
-query_length      => Length of query sequence
-database_name     => Name of database
-database_letters  => Number of residues in database
-database_entries  => Number of entries in database
-hits              => array ref of Bio::Search::Hit::HitI objects
-parameters        => hash ref of search parameters (key => value)
-statistics        => hash ref of search statistics (key => value)
-algorithm         => program name (blastx)
-algorithm_version   => version of the algorithm (2.1.2)
-algorithm_reference => literature reference string for this algorithm
-rid               => value of the BLAST Request ID (eg. RID: ZABJ4EA7014)
-hit_factory       => Bio::Factory::ObjectFactoryI capable of making
                      Bio::Search::Hit::HitI objects

🧚 algorithm

  • Title β€” algorithm
  • Usage β€” my $r_type = $hsp->algorithm
  • Function β€” hands you the name of the algorithm that was used to obtain the Result
  • Returns β€” a string, like BLASTP
  • Args β€” [optional] scalar string if you wanna set the value

🧚 algorithm_version

  • Title β€” algorithm_version
  • Usage β€” my $r_version = $hsp->algorithm_version
  • Function β€” hands you the version of the algorithm that was used to obtain the Result
  • Returns β€” a string, like 2.1.2
  • Args β€” [optional] scalar string to set the algorithm version value

πŸ‘‘ Bio::Search::Result::ResultI interface methods

Bio::Search::Result::ResultI implementation β€” this is the interface flex, periodt.

πŸ’« next_hit

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

πŸ’« 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 β€” [optional] new string value for query name

πŸ’« query_accession

  • Title β€” query_accession
  • Usage β€” $id = $result->query_accession();
  • Function β€” get the accession (if available) for the query sequence
  • Returns β€” a string
  • Args β€” [optional] new string value for accession

πŸ’« query_gi

  • Title β€” query_gi
  • Usage β€” $acc = $hit->query_gi();
  • Function β€” retrieve the NCBI Unique ID (aka the GI #), if available, for the query
  • Returns β€” a scalar string (empty string if it's not set)
  • Args β€” none

πŸ’« query_length

  • Title β€” query_length
  • Usage β€” $id = $result->query_length();
  • Function β€” get the length of the query sequence that was used in the search
  • Returns β€” a number
  • Args β€” [optional] new integer value for query length

πŸ’« query_description

  • Title β€” query_description
  • Usage β€” $id = $result->query_description();
  • Function β€” get the description of the query sequence that was used in the search
  • Returns β€” a string
  • Args β€” [optional] new string for the query description

πŸ’« 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 β€” [optional] new string for the db name

πŸ’« database_letters

  • Title β€” database_letters
  • Usage β€” $size = $result->database_letters()
  • Function β€” used to obtain the size of the database that was searched against
  • Returns β€” a scalar integer (units are algorithm-specific, but it's probably the total number of residues in the database, if available) or undef if the information wasn't available to the Processor object
  • Args β€” [optional] new scalar integer for number of letters in db

πŸ’« 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 wasn't available
  • Args β€” [optional] new integer for the number of sequence entries in the db

πŸ’« get_parameter

  • Title β€” get_parameter
  • Usage β€” my $gap_ext = $report->get_parameter('gapext')
  • Function β€” returns the value for a specific parameter that was used when running this report
  • Returns β€” string
  • Args β€” name of parameter (string)

πŸ’« available_parameters

  • Title β€” available_parameters
  • Usage β€” my @params = $report->available_paramters
  • Function β€” returns the names of the available parameters
  • Returns β€” return list of available parameters used for this report
  • Args β€” none
not me pointing out that the usage line above literally says available_paramters πŸ’€ that's the original spelling, bestie, we keep it exactly as-is, no editing the lore.

πŸ’« get_statistic

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

πŸ’« available_statistics

  • Title β€” available_statistics
  • Usage β€” my @statnames = $report->available_statistics
  • Function β€” returns the names of the available statistics
  • Returns β€” return list of available statistics used for this report
  • Args β€” none

🌈 Bio::Search::Report

Bio::Search::Result::GenericResult specific methods β€” the house-specific ones, main character energy only.

πŸ“ add_hit

  • Title β€” add_hit
  • Usage β€” $report->add_hit($hit)
  • Function β€” adds a HitI to the stored list of hits
  • Returns β€” number of HitI currently stored
  • Args β€” Bio::Search::Hit::HitI

πŸ“ hit_factory

  • Title β€” hit_factory
  • Usage β€” $hit->hit_factory($hit_factory)
  • Function β€” get/set the factory used to build HitI objects if necessary
  • Returns β€” Bio::Factory::ObjectFactoryI
  • Args β€” Bio::Factory::ObjectFactoryI

πŸ“ rewind

  • Title β€” rewind
  • Usage β€” $result->rewind;
  • Function β€” lets you reset the Hit iterator back to the beginning, since this is an in-memory implementation
  • Returns β€” none
  • Args β€” none

πŸ“ _nexthitindex

  • Title β€” _nexthitindex
  • Usage β€” private πŸ™ˆ (that's it, that's the whole entry)

πŸ“ add_parameter

  • Title β€” add_parameter
  • Usage β€” $report->add_parameter('gapext', 11);
  • Function β€” adds a parameter
  • Returns β€” none
  • Args β€”
    • key β€” key value name for this parama
    • value β€” value for this parameter

πŸ“ add_statistic

  • Title β€” add_statistic
  • Usage β€” $report->add_statistic('lambda', 2.3);
  • Function β€” adds a parameter
  • Returns β€” none
  • Args β€”
    • key β€” key value name for this parama
    • value β€” value for this parameter

πŸ“ 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 available hits for this Result
  • Returns β€” array of L<Bio::Search::Hit::HitI> objects
  • Args β€” none

πŸ“ algorithm_reference

  • Title β€” algorithm_reference
  • Usage β€” $obj->algorithm_reference($newval)
  • Function β€” (left blank in the original, bestie, we do not invent lore)
  • Returns β€” string containing the literature reference for the algorithm
  • Args β€” newvalue string (optional)
  • Comments β€” formerly named program_reference(), which is still supported for backwards compatibility 🫢

πŸ“ program_reference

  • Title β€” program_reference
  • Usage β€” $obj->program_reference()
  • Function β€” (blank in the original, no cap)
  • Returns β€” string containing the literature reference for the algorithm
  • Args β€” (blank)
  • Comments β€” Deprecated β€” use algorithm_reference() instead. πŸ’€

πŸ“ rid

πŸ“ no_hits_found

See documentation in Bio::Search::Result::ResultI::no_hits_found()

πŸ“ set_no_hits_found

See documentation in Bio::Search::Result::ResultI::set_no_hits_found()

πŸ“ to_string

  • Title β€” to_string
  • Usage β€” print $blast->to_string;
  • Function β€” returns a string representation for the Blast result. Primarily intended for debugging purposes.
  • Example β€” see usage
  • Returns β€” a string of the form:
[GenericResult] <analysis_method> query=<name> <description> db=<database

e.g.:

[GenericResult] BLASTP query=YEL060C vacuolar protease B, db=PDBUNIQ
  • Args β€” None

and that's the whole page, bestie πŸŽ€ no details dropped, every Title, Usage, Function, Returns, Args, and Comments survived the vibe check intact.

this edition was perl v5.32.1, dated 2021-08-15, and it's the Bio::S...Result(3pm) page β€” go forth and next_hit() responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from