Bio::Matrix::IO(3pm)

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

πŸ’– Bio::Matrix::IO β€” a factory for Matrix parsing πŸ’–

okay bestie, so you found yourself a Bio::Matrix::IO manpage (that's the 3pm one, perl module docs, we love that for us) and you're like "what is this". Don't worry. I got you. This is the whole thing, no skips, no cap. 🫢


✨ SYNOPSIS ✨

use Bio::Matrix::IO;
my $parser = Bio::Matrix::IO->new(-format => 'scoring',
                                  -file   => 'BLOSUMN50');

my $matrix = $parser->next_matrix;

that's literally the whole vibe. make a parser, ask it for a matrix, slay. πŸ’…


🌸 DESCRIPTION 🌸

So this is a general factory framework for writing parsers for Matricies. Yes, that's a whole framework just for making matrix parsers β€” it's giving infrastructure, it's giving "someone had to do it". πŸ”₯

It includes parsing output from distance output like PHYLIP's ProtDist. And lowkey the plan is that once their Matrix objects get written, it should be possible to fit parsers for PWM and PSSMs in here too. Future goals, bestie, we're manifesting them. πŸ¦‹


πŸŽ€ FEEDBACK πŸŽ€

Mailing Lists πŸ’Œ

User feedback is an integral part of the evolution of this and other Bioperl modules. So like, your opinion genuinely matters here β€” send your comments and suggestions preferably to the Bioperl mailing list. 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. Bestie, I know, sliding into the maintainer's DMs feels faster, but there are many experienced and reponsive experts on the list who will be able look at the problem and quickly address it. So go where the experts are. πŸ‘‘

And please include a thorough description of the problem with code and data examples if at all possible. The more detail the better β€” that's the difference between "helped instantly" and "three days of back and forth". ⭐

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

no gatekeeping, just report it. πŸ’œ


πŸ‘‘ AUTHOR - Jason Stajich πŸ‘‘

Email jason-at-bioperl-dot-org


πŸ’€ APPENDIX πŸ’€

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _. (iykyk β€” if it starts with an underscore, it's private business, don't be nosy. πŸ“)

new

Title   : new
Usage   : my $obj = Bio::Matrix::IO->new();
Function: Builds a new Bio::Matrix::IO object
Returns : an instance of Bio::Matrix::IO
Args    :

builds you a fresh, brand-new Bio::Matrix::IO object. main character energy, obviously. ✨

newFh

Title   : newFh
Usage   : $fh = Bio::Matrix::IO->newFh(-file=>$filename,-format=>'Format')
Function: does a new() followed by an fh()
Example : $fh = Bio::Matrix::IO->newFh(-file=>$filename,-format=>'Format')
          $matrix = <$fh>;   # read a matrix object
          print $fh $matrix; # write a matrix object
Returns : filehandle tied to the Bio::SeqIO::Fh class
Args    :

it does a new() and then an fh() β€” two steps, one call, efficiency queen. 🧚

fh

Title   : fh
Usage   : $obj->fh
Function: Get a filehandle type access to the matrix parser
Example : $fh = $obj->fh;      # make a tied filehandle
          $matrix = <$fh>;     # read a matrix object
          print $fh $matrix;   # write a matrix object
Returns : filehandle tied to Bio::Matrix::IO class
Args    : none

gives you filehandle-style access to the matrix parser. read a matrix with < $fh >, write one with print $fh $matrix. so clean, so tidy. 🌈

format

Title   : format
Usage   : $format = $obj->format()
Function: Get the matrix format
Returns : matrix format
Args    : none

just hands you the matrix format. that's it. that's the method. iconic behavior honestly. πŸ’…

next_matrix

Title   : next_matrix
Usage   : my $matrix = $matixio->next_matrix;
Function: Parse the next matrix from the data stream
Returns : L<Bio::Matrix::MatrixI> type object or undef when finished
Args    : none

parses the next matrix off the data stream. you get a L<Bio::Matrix::MatrixI> type object back β€” or undef when it's all done. when you hit that undef, that's your cue to stop asking. periodt. πŸŽ€

write_matrix

Title   : write_matrix
Usage   : $io->write_matrix($matrix)
Function: Writes a matrix out to the data stream
Returns : none
Args    : Array of Bio::Matrix::MatrixI object
         - note that not all matricies can be converted to
           each format, beware with mixing matrix types and output formats

writes a matrix out to the data stream. returns nothing, it just does the thing. πŸ’–

⚠️ heads up bestie: not all matricies can be converted to each format. so beware with mixing matrix types and output formats. that's a real "you were warned" moment, don't come crying to me. 😭

_load_format_module

Title   : _load_format_module
Usage   : *INTERNAL Matrix::IO stuff*
Function: Loads up (like use) a module at run time on demand

internal Matrix::IO stuff β€” it loads up (like use) a module at run time on demand. dynamic, mysterious, does not want to be perceived. πŸ™ˆ

_guess_format

Title   : _guess_format
Usage   : $obj->_guess_format($filename)
Returns : guessed format of filename (lower case)
Args    : filename

takes a filename and returns the guessed format of that filename, in lower case. it's a detective. a lowercase detective. πŸ”


that's the whole page, bestie β€” every flag, every method, every word. you're basically a Bioperl expert now. go forth and parse. 🌟

signing off with love: this was Bio::Matrix::IO(3pm) from the User Contributed Perl Documentation, version perl v5.32.1, dated 2021-08-15. mwah. πŸ’‹

πŸ“¦ where this page comes from