TFBS::...ignment(3pm)
π TFBS::Matrix::Alignment π (a.k.a. the page your shell calls TFBS::...ignment(3pm))
Hiii bestie, quick vibe check: you're reading a page from the User Contributed Perl Documentation, and it's about TFBS::Matrix::Alignment β the class that ships with the TFBS toolkit. Pull up a chair, we're aligning profiles today and it's gonna be so satisfying. π¦
β¨ NAME β¨
TFBS::Matrix::Alignment β literally the class for alignment of PFM objects. That's it, that's the whole job. π
πΈ SYNOPSIS πΈ
Okay so first thing, if you wanna make an alignment, go read the docs for the individual TFBS::DB::* modules first β those teach you how to connect to the different kinds of pattern databases and how to pull TFBS::Matrix::* objects out of them. Not optional, you need the objects first, bestie. π«Ά
- Making an alignment: (See documentation of individual
TFBS::DB::*modules to learn how to connect to different types of pattern databases and retrieveTFBS::Matrix::*objects from them.)
my $db_obj = TFBS::DB::JASPAR2->new
(-connect => ["dbi:mysql:JASPAR2:myhost",
"myusername", "mypassword"]);
my $pfm1 = $db_obj->get_Matrix_by_ID("M0001", "PFM");
my $pfm2 = $db_obj->get_Matrix_by_ID("M0002", "PFM");
my $alignment= new TFBS::Matrix::Alignment(
-pfm1=>$pfm1,
-pfm2=>$pfm2,
-binary=>"/TFBS/Ext/matrix_aligner",
);
π DESCRIPTION π
TFBS::Matrix::Alignment is a class for representing and performing pairwise alignments of profiles (in the form of TFBS::PFM objects). π no cap, that's what it does.
The aligning itself gets done with a semi-global variant of the Needleman-Wunsch algorithm β and the twist is that it only permits the opening of one internal gap. One. Singular. The algorithm is described in Sandelin et al Funct Integr Genomics. 2003 Jun 25, if you want the receipts for reference. π₯
π FEEDBACK π
Found a bug? Got thoughts? Send your bug reports and any other comments straight to the author. They want to hear it, fr fr. β¨
π AUTHOR - Boris Lenhard π
Boris Lenhard <Boris.Lenhard@cgb.ki.se>
π APPENDIX π
The rest of this doc walks through each of the object methods, one by one. Heads up: any method whose name starts with an underscore is an internal method β not your business, don't touch. π
π§ new
- Title :
new - Usage :
my $alignment = TFBS::Matrix::Alignment->new(%args) - Function: constructor for the
TFBS::Matrix::Alignmentobject - Returns : a new
TFBS::Matrix::Alignmentobject - Args : # you must specify:
-pfm1, # a TFBS::Matrix::PFM object
-pfm2, # another TFBS::Matrix::PFM object
-binary, # a valid path to the comparison algorithm (matrixalign)
#######
-ext_penalty #OPTIONAL gap extension penalty in Needleman-Wunsch
algorithmstring. Default 0.01
-open_penalty, #OPTIONAL gap opening penalty in Needleman-Wunsch
algorithmstring. Default 3.0
So the mandatory trio is -pfm1, -pfm2 and -binary (that path has to actually be a valid path to the comparison algorithm, matrixalign, no funny business). Then there's the optional stuff below the divider: -ext_penalty is the optional gap extension penalty in Needleman-Wunsch, default 0.01, and -open_penalty is the optional gap opening penalty in Needleman-Wunsch, default 3.0. Give 'em numbers, they'll behave. πΈ
β score
- Title :
score - Usage :
my $score = $alignmentobject->score(); - Function: access an alignment score (where each aligned position can contribute max 2)
- Returns : a floating point number
- Args : none
Grab that alignment score, bestie. Each aligned position can contribute a max of 2. Two. That's the ceiling. π«Ά
π score (yes, the heading says score again β but the Title down here is gaps, ik ik)
- Title :
gaps - Usage :
my $nr_of_gaps = $alignmentobject->gaps(); - Function: access the number of gaps in an alignment
- Returns : an integer
- Args : none
Not me pointing out the heading is just straight-up score twice β I'm keeping it exactly as the page has it, because facts don't change even when headings get copy-pasted. π Anyway: this is your gaps counter, and it hands you back a whole integer.
π length
- Title :
length - Usage :
my $length = $alignmentobject->length(); - Function: access the length of an alignment (ie the number of aligned positions)
- Returns : an integer
- Args : none
Length of the alignment = the number of aligned positions. Integer, again. Clean. π
π¦ strand
- Title :
strand - Usage :
my $strand = $alignmentobject->strand(); - Function: access the orientation of the aligned patterns:
++= oriented as input+-= second pattern is reverse-complemented
- Returns : a string
- Args : none
The vibe check for orientation: ++ means it's oriented as input, +- means the second pattern got reverse-complemented. It's giving "which way is this pointing" energy. π
π₯ alignment
- Title :
alignment - Usage :
my $alignment_string = $alignmentobject->alignment(); - Function: access a string describing the alignment
- Returns : a string, where each number refers to a position in the respective PFM. Position numbering is according to orientation: ie if the second profile is reversed, position
1corresponds to the last position in the input profile. Gaps are denoted as-.
RXR-VDR - 1 2 3 - 4 5 -
PPARgamma-RXRal 1 2 3 4 5 6 7 8
- Args : none
Look at that alignment, it ate and left no crumbs. π
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
Around line 39:
You forgot a '=back' before '=head1'
Not the pod parser catching the typo in front of everyone π β but we respect the transparency, no cap.
Okay that's the whole page, bestie, every single detail intact β nothing skipped, nothing invented, promise. π«Ά
And per the footer: this was written against perl v5.42.3, dated 2026-08-21, and it's brought to you as TFBS::...ignment(3pm). Slay, bye. πβ¨π
π¦ where this page comes from
- ubuntu stonking: libtfbs-perl 0.7.1+ds-6build1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms