Bio::M...SM::Psm(3pm)
β¨ Bio::M...SM::Psm β¨
okay bestie, gather round π this is the manual page for Bio::M...SM::Psm(3pm), the Perl module from the User Contributed Perl Documentation. It's giving matrix energy, and we're gonna go through it top to bottom, no skipping, no cap.
πΈ NAME πΈ
Bio::Matrix::PSM::Psm β handle combination of site matricies
(yes, "matricies", we don't fix it, we respect it π«Ά)
π¦ SYNOPSIS π¦
use Bio::Matrix::PSM::IO;
#To get a Psm object from a file use the Psm parser:
my $psmIO = Bio::Matrix::PSM::IO->new(-format=>'meme', -file=>$file);
# Now go through all entities in the file with next_psm, which
# returns a Psm object see Bio::Matrix::PSM::IO for detailed
# documentation (matrix predictions or matrix sequence matches or
# both):
while (my $psm=$psmIO->next_psm) {
my %psm_header=$psm->header;
my $ic=$psm_header{IC};
my $sites=$psm_header{sites};
my $width=$psm_header{width};
my $score=$psm_header{e_val};
my $IUPAC=$psm->IUPAC;
my $instances=$psm->instances;
foreach my $instance (@{$instances}) {
my $id=$instance->primary_id;
#Do something with the id
}
}
#or create from memmory:
my $psm= Bio::Matrix::PSM::Psm->new( -pA=>\@pA,-pC=>\@pC,-pG=>\@pG,-pT=>\@pT,
-id=>$id,
-instances=>$instances, -e_val=>$e_val,
-IC=>$ic, -width=>$width, -sites=>$sites)
# where pA through pG are the respective frequencies of the matrix (see also
# Bio::Matrix::PSM::SiteMatrix), and everything else is self-explenatory,
# except for -instances (reference to an array of
# Bio::Matrix::PSM::InstanceSite objects) which is documented below.
so basically: you either pull a Psm out of a file with the parser and vibe through every entity using next_psm (which hands you a Psm object β full docs live in Bio::Matrix::PSM::IO, and yeah it covers matrix predictions, matrix sequence matches, or both π), or you build one straight from memory. pA through pG are the respective frequencies of the matrix (peep Bio::Matrix::PSM::SiteMatrix too), everything else is self-explenatory, except -instances which is a reference to an array of Bio::Matrix::PSM::InstanceSite objects and is documented further down. π
π DESCRIPTION π
So the whole point: handle a combination of site matrices and/or their corresponding sequence matches (a.k.a. instances). This object inherits from Bio::Matrix::PSM::SiteMatrix, so all those methods are yours to use, no extra work. It may also hold an array of Bio::Matrix::PSM::InstanceSite objects β but you have to go get them yourself via the Bio::Matrix::PSM::Psm->instances method (see below π). To some extent this is an expanded SiteMatrix object, holding data from analysis that also deals with sequence matches of a particular matrix.
π DESIGN ISSUES π
not the design issues section π okay so the author is being real with us:
This does not make too much sense to me β I am mixing PSM with PSM sequence matches. Though they are very closely related, I am not satisfied by the way this is implemented here. Heikki suggested different objects when one has something like meme. But does this mean we have to write a different objects for mast, meme, transfac, theiresias, etc.? To me the best way is to return SiteMatrix object + arrray of InstanceSite objects β and then mast will return undef for SiteMatrix and transfac will return undef for InstanceSite. Probably I cannot see some other design issues that might arise from such approach, but it seems more straightforward. Hilmar does not like this because it is an exception from the general BioPerl rules. Should I leave this as an option? Also the header rightfully belongs the driver object, and could be retrieved as hashes. I do not think it can be done any other way, unless we want to create even one more object with very unclear content.
it's giving open-source honesty, we love to see it π«Ά
π FEEDBACK π
π Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions 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. Many experienced and reponsive 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 to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
π AUTHOR - Stefan Kirov π
Email skirov@utk.edu
π DISCLAIMER π
This software is provided "as is" without warranty of any kind.
no warranty, bestie. none. zero. nada. π
β SEE ALSO β
SiteMatrix, meme, transfac, InstanceSite
π APPENDIX π
β¨ new
- Title :
new - Usage :
my $psm= Bio::Matrix::PSM::Psm->new( -pA=>\@pA,-pC=>\@pC,
-pG=>\@pG,-pT=>\@pT,-id=>$id,
-instances=>$instances,
-e_val=>$e_val,
-IC=>$ic, -width=>$width,
-sites=>$sites)
- Function: Creates a new
Bio::Matrix::PSM::Psmobject - Throws :
- Example :
- Returns :
Bio::Matrix::PSM::Psmobject - Args : hash
β¨ instances
- Title :
instances - Usage :
my @instances=@{$psm->instances}; - Function: Gets/sets the instances (
Bio::Matrix::PSM::InstanceSiteobjects) associated with the Psm object - Throws :
- Example :
- Returns : array reference (
Bio::Matrix::PSM::InstanceSiteobjects) - Args : array reference (
Bio::Matrix::PSM::InstanceSiteobjects)
β¨ header
- Title :
header - Usage :
my %header=$psm->header;
my $ic=$psm->header('IC');
- Function: Gets the general information, common for most files, dealing with PSM such as information content (IC), score (e-value, etc.), number of sites (sites) and width. This list may expand. The current list should be in
@Bio::Matrix::PSM::Psm::HEADER. Returnsundefif an argument is supplied that is not in@Bio::Matrix::PSM::meme::HEADER. - Throws :
- Example :
- Returns : hash or string
- Args : string (
IC,e_val...)
β¨ matrix
- Title :
matrix - Usage :
my $matrix=$psm->matrix; - Function: Gets/sets the
SiteMatrixrelated information - Throws :
- Example :
- Returns :
Bio::Matrix::PSM::SiteMatrixobjects - Args :
Bio::Matrix::PSM::SiteMatrixobjects
and that's the whole page, bestie, you ate it π
this was perl v5.32.1, dated 2021-08-15, from Bio::M...SM::Psm(3pm) β slay, go write some matrices π¦β¨π
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms