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

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

πŸ’… Bio::S...ullHSP(3pm) πŸ’…

okay bestie, welcome to Bio::S...ullHSP(3pm) β€” yes that's the manual name, no I did not make it up, it's literally what the page header says. we're doing the Bio::Search::HSP::BlastPullHSP page and it's giving very niche, very perl, very iconic. let's get into it 🫢


✨ NAME ✨

Bio::Search::HSP::BlastPullHSP β€” a parser and an HSP object, specifically for BlastN hsps. that's the whole job description. she parses, she objects, she serves πŸ’…


🌸 SYNOPSIS 🌸

so like, generally? you don't even build these by hand, you let Bio::SearchIO do it for you. main character energy:

# generally we use Bio::SearchIO to build these objects
use Bio::SearchIO;
my $in = Bio::SearchIO->new(-format => 'hmmer_pull',
                                                        -file   => 'result.blast');

while (my $result = $in->next_result) {
            while (my $hit = $result->next_hit) {
                    print $hit->name, "\n";
                    print $hit->score, "\n";
                    print $hit->significance, "\n";

                    while (my $hsp = $hit->next_hsp) {
                            # process HSPI objects
                    }
            }
}

see how it's nested? results, then hits, then hsps, going deeper and deeper like your feelings about a segfault at 2am 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

This object implements a parser for BlastN hsp output. short. sweet. does exactly what it says on the tin, no notes ✨


πŸ’Œ FEEDBACK πŸ’Œ

🌈 Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. so like, if you have thoughts? send them. your participation is much appreciated, fr fr.

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. ngl that's the move β€” there are many experienced and reponsive experts hanging out there who 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. like, give them the whole situation, not just "it doesn't work" πŸ™ˆ

πŸ› 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 bix@sendu.me.uk

periodt. that's the author, that's the contact, we love a credited icon πŸ’œ


πŸ“– APPENDIX πŸ“–

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ β€” that's your lil heads up so you know which ones are the secret backstage methods, iykyk πŸ”₯

🌟 new

Title   : new
Usage   : my $obj = Bio::Search::HSP::BlastNHSP->new();
Function: Builds a new Bio::Search::HSP::BlastNHSP object.
Returns : Bio::Search::HSP::BlastNHSP
Args    : -chunk  => [Bio::Root::IO, $start, $end] (required if no -parent)
          -parent => Bio::PullParserI object (required if no -chunk)

          where the array ref provided to -chunk contains an IO object
          for a filehandle to something representing the raw data of the
          hsp, and $start and $end define the tell() position within the
          filehandle that the hsp data starts and ends (optional; defaults
          to start and end of the entire thing described by the filehandle)

okay so this is the constructor. you build a brand new Bio::Search::HSP::BlastNHSP object. and listen β€” the args are a whole situation: you need -chunk or -parent, like you genuinely cannot skip both, they're required if the other one isn't there. the -chunk array ref carries an IO object for a filehandle to whatever raw data represents the hsp, plus $start and $end which define the tell() position within that filehandle where the hsp data starts and ends β€” and those two are optional, they default to the start and end of the entire thing described by the filehandle. so it's giving "flexible but also read the fine print" πŸ’€

⭐ query

Title   : query
Usage   : my $query = $hsp->query
Function: Returns a SeqFeature representing the query in the HSP
Returns : L<Bio::SeqFeature::Similarity>
Args    : none

gives you a SeqFeature representing the query in the HSP. no args, she just hands it over 🫢

πŸ“ hit

Title   : hit
Usage   : my $hit = $hsp->hit
Function: Returns a SeqFeature representing the hit in the HSP
Returns : L<Bio::SeqFeature::Similarity>
Args    : [optional] new value to set

same vibe, but for the hit in the HSP. returns a Bio::SeqFeature::Similarity. and ooh, this one takes an optional new value to set β€” so you can read and write, versatile queen πŸ’…

🧚 gaps

Title    : gaps
Usage    : 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 none
Args     : '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'

Get the number of gap characters in the query, hit, or total alignment. Returns an Integer β€” the number of gap characters, or 0 if there are none. and the args are:

  • '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'

so if you just call it with nothing, you get total. queen of reasonable defaults ✨

🌸 strand

Title   : strand
Usage   : $hsp->strand('query')
Function: Retrieves the strand for the HSP component requested
Returns : +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

Retrieves the strand for the HSP component requested. Returns +1 or -1 (or 0 if unknown β€” she's honest about not knowing 😭). your args options:

  • 'hit' or 'subject' or 'sbjct' β†’ get the strand of the subject
  • 'query' β†’ get the query strand (this is the default)
  • 'list' or 'array' β†’ get both query and hit together, two for one, slay

πŸ’œ start

Title   : start
Usage   : $hsp->start('query')
Function: Retrieves the start for the HSP component requested
Returns : integer, or list of two integers (query start and subject start) in
          list context
Args    : 'hit' or 'subject' or 'sbjct' to retrieve the start of the subject
          'query' to retrieve the query start (default)

Retrieves the start for the HSP component requested. Returns an integer β€” or, if you're in list context, a list of two integers (query start and subject start). look at her being context-aware, we love range πŸ’…

  • 'hit' or 'subject' or 'sbjct' β†’ the start of the subject
  • 'query' β†’ the query start (default, obviously)

πŸ¦„ end

Title   : end
Usage   : $hsp->end('query')
Function: Retrieves the end for the HSP component requested
Returns : integer, or list of two integers (query end and subject end) in
          list context
Args    : 'hit' or 'subject' or 'sbjct' to retrieve the end of the subject
          'query' to retrieve the query end (default)

same energy as start but she's the end. Retrieves the end for the HSP component requested. Returns an integer, or a list of two integers (query end and subject end) in list context.

  • 'hit' or 'subject' or 'sbjct' β†’ the end of the subject
  • 'query' β†’ the query end (default)

matched set, bestie. start and end, always together 🫢

πŸ”₯ pvalue

Title   : pvalue
Usage   : my $pvalue = $hsp->pvalue();
Function: Returns the P-value for this HSP
Returns : undef (Hmmpfam reports do not have p-values)
Args    : none

Returns the P-value for this HSP. except. okay. listen. it returns undef, because Hmmpfam reports do not have p-values. so she's not being difficult, there's genuinely nothing to give you here 😭 no args needed either way.


reminder bestie: every option, every arg, every default up there is exactly as written. don't be out here renaming flags, the perl will simply not vibe with that πŸ’€

and that's the whole page!! slayed, served, documented. this fine piece of documentation is perl v5.32.1, dated 2021-08-15, and it lives under the name Bio::S...ullHSP(3pm) β€” so go forth, parse those BlastN hsps, and remember: you ate πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from