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

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

✨ NAME ✨

Bio::SearchIO::Writer::HSPTableWriter β€” tab-delimited data for Bio::Search::HSP::HSPI objects πŸ’…

and yes bestie, she's a 3pm page, living her best life in the User Contributed Perl Documentation section. no cap.


🌸 SYNOPSIS 🌸

okay so here's the vibe. Example 1: just roll with the default columns, she's already perfect ✨

use Bio::SearchIO;
use Bio::SearchIO::Writer::HSPTableWriter;

my $in = Bio::SearchIO->new();

my $writer = Bio::SearchIO::Writer::HSPTableWriter->new();

my $out = Bio::SearchIO->new( -writer => $writer );

while ( my $result = $in->next_result() ) {
    $out->write_result($result, ($in->report_count - 1 ? 0 : 1) );
}

Example 2: now we're picking and choosing which columns we want, main character energy πŸŽ€

use Bio::SearchIO;
use Bio::SearchIO::Writer::HSPTableWriter;

my $in = Bio::SearchIO->new();

my $writer = Bio::SearchIO::Writer::HSPTableWriter->new(
                              -columns => [qw(
                                              query_name
                                              query_length
                                              hit_name
                                              hit_length
                                              rank
                                              frac_identical_query
                                              expect
                                              )]  );

my $out = Bio::SearchIO->new( -writer => $writer,
                              -file   => ">searchio.out" );

while ( my $result = $in->next_result() ) {
    $out->write_result($result, ($in->report_count - 1 ? 0 : 1) );
}

πŸ¦‹ Custom Labels πŸ¦‹

and like, if the default column labels aren't giving what they need to give, you can rename them, periodt. Just pass a -labels hash reference when you build the HSPTableWriter object. the keys are the column number (and bestie, left-most column = 1, not zero, don't come for me) for whichever label(s) you're customizing. here's the moment:

my $writer = Bio::SearchIO::Writer::HSPTableWriter->new(
                           -columns => [qw( query_name
                                            query_length
                                            hit_name
                                            hit_length  )],
                           -labels  => { 1 => 'QUERY_GI',
                                         3 => 'HIT_IDENTIFIER' } );

πŸ’– DESCRIPTION πŸ’–

Bio::SearchIO::Writer::HSPTableWriter generates output at the finest level of granularity for data within a search result. it's giving microscope πŸ”¬. the data for each HSP inside each hit in a search result comes out in tab-delimited format, one row per HSP. slay.

⭐ Available Columns ⭐

here are all the columns you can name in the -columns parameter when you're creating an HSPTableWriter object. and lowkey important: if you don't pass a -columns parameter at all, this exact list, in this exact order, is the default. πŸ‘‘

  • query_name β€” sequence identifier of the query
  • query_length β€” full length of the query sequence
  • hit_name β€” sequence identifier of the hit
  • hit_length β€” full length of the hit sequence
  • round β€” round number for hit (PSI-BLAST)
  • rank
  • expect β€” expect value for the alignment
  • score β€” score for the alignment (e.g., BLAST score)
  • bits β€” bit score for the alignment
  • frac_identical_query β€” fraction of identical substitutions in query
  • frac_identical_hit β€” fraction of identical substitutions in hit
  • frac_conserved_query β€” fraction of conserved substitutions in query
  • frac_conserved_hit β€” fraction of conserved substitutions in hit
  • length_aln_query β€” length of the aligned portion of the query sequence
  • length_aln_hit β€” length of the aligned portion of the hit sequence
  • gaps_query β€” number of gap characters in the aligned query sequence
  • gaps_hit β€” number of gap characters in the aligned hit sequence
  • gaps_total β€” number of gap characters in the aligned query and hit sequences
  • start_query β€” starting coordinate of the aligned portion of the query sequence
  • end_query β€” ending coordinate of the aligned portion of the query sequence
  • start_hit β€” starting coordinate of the aligned portion of the hit sequence
  • end_hit β€” ending coordinate of the aligned portion of the hit sequence
  • strand_query β€” strand of the aligned query sequence
  • strand_hit β€” strand of the aligned hit sequence
  • frame β€” reading frame of the aligned query sequence
  • hit_description β€” full description of the hit sequence
  • query_description β€” full description of the query sequence
  • frac_identical_total β€” fraction of total identical substitutions
  • frac_conserved_total β€” fraction of total conserved substitutions

want the tea on any of these? 🍡 the docs for the corresponding method over in Bio::Search::HSP::HSPI have you covered.


πŸ™ˆ TODO πŸ™ˆ

still gotta figure out the best way to work in algorithm-specific score columns. the best route is probably to have algorithm-specific subclasses (e.g., BlastHSPTableWriter, FastaHSPTableWriter). it's giving future era, not yet, bestie. πŸ’€


🫢 FEEDBACK 🫢

πŸ’Œ Mailing Lists πŸ’Œ

user feedback is, like, an integral part of the evolution of this and other Bioperl modules β€” fr fr. send your comments and suggestions preferably to one of the Bioperl mailing lists. your participation is so appreciated, genuinely πŸ₯Ή

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 responsive experts will be able look at the problem and quickly address it. if at all possible, please include a thorough description of the problem with code and data examples. give them the full picture bestie, not just a vibe 🧚

πŸ› 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 πŸ‘‘

Steve Chervitz <sac@bioperl.org>

see the FEEDBACK section for where to send bug reports and comments.


Copyright (c) 2001 Steve Chervitz. All Rights Reserved.

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iconic behavior honestly πŸ’…


πŸ’€ DISCLAIMER πŸ’€

this software is provided "as is" without warranty of any kind. no promises, no cap, that's the deal.


πŸ”₯ SEE ALSO πŸ”₯

  • Bio::SearchIO::Writer::HitTableWriter
  • Bio::SearchIO::Writer::ResultTableWriter

🧚 METHODS 🧚

🌟 to_string() 🌟

heads up bestie: this method is not intended for direct use. the SearchIO::write_result() method calls it automatically if the writer is hooked up to a SearchIO object, just like the SYNOPSIS section shows.
  • Title β€” to_string()
  • Usage β€” print $writer->to_string( $result_obj, [$include_labels] );
  • Argument β€” $result_obj = a Bio::Search::Result::ResultI object; $include_labels = boolean, if true column labels are included (default: false)
  • Returns β€” a string containing a tab-delimited set of data for each HSP in each Hit of the supplied ResultI object
  • Throws β€” n/a

🌸 end_report 🌸

  • Title β€” end_report
  • Usage β€” $self->end_report()
  • Function β€” the method to call when ending a report; this is mostly for cleanup for formats which require you to have something at the end of the document. nothing for a text message.
  • Returns β€” string
  • Args β€” none

πŸ’œ filter πŸ’œ

  • Title β€” filter
  • Usage β€” $writer->filter('hsp', \&hsp_filter);
  • Function β€” filter out either at HSP, Hit, or Result level
  • Returns β€” none
  • Args β€” string => data type, CODE reference

and that's the whole page bestie πŸŽ€ brought to you by perl v5.32.1, dated 2021-08-15, out of the User Contributed Perl Documentation for Bio::S...eWriter(3pm). go write some tab-delimited HSP rows, you're gonna eat πŸ’…βœ¨

πŸ“¦ where this page comes from