TFBS::MatrixSet(3pm)
okay bestie, pull up a chair π this is the TFBS::MatrixSet(3pm) page from the User Contributed Perl Documentation, and it is exactly as iconic as it sounds. no cap.
β¨ NAME β¨
TFBS::Matrix::Set β an aggregate class that represents a whole set of matrix patterns, and it's packing all the methods you need to mess with that set as one big beautiful unit π
πΈ SYNOPSIS πΈ
okay so here's the vibe, fr fr:
# creation of a TFBS::MatrixSet object
# let @list_of_matrix_objects be a list of TFBS::Matrix::* objects
###################################
# Create a TFBS::MatrixSet object:
my $matrixset = TFBS::MatrixSet->new(); # creates an empty set
$matrixset->add_Matrix(@list_of_matrix_objects); #add matrix objects to set
$matrixset->add_Matrix($matrixobj); # adds a single matrix object to set
# or, same as above:
my $matrixset = TFBS::MatrixSet->new(@list_of_matrix_objects, $matrixobj);
###################################
#
π¦ DESCRIPTION π¦
TFBS::MatrixSet is an aggregate class that stores a whole set of TFBS::Matrix::* subclass objects and hands you the methods to manipulate those sets as one glorious whole. The way that it works? You either create TFBS::MatrixSet objects de novo, or some database retrieval method (TFBS::DB::*) just hands one back to you like a little gift π
π FEEDBACK π
Found a bug? Got thoughts? Send those bug reports and other comments straight to the author, bestie π«Ά
π AUTHOR - Boris Lenhard π
Boris Lenhard <Boris.Lenhard@cgb.ki.se> β and modified by Eivind Valen <eivind.valen@gmail.com> β¨
π APPENDIX π
The rest of this doc spills the tea on every single object method, ok? Internal methods are the ones preceded with an underscore, so you can clock them instantly π
new
literally just vibes, no docs listed here π
new2
same energy, no extra deets, moving on π
add_matrix
- Title:
add_matrix - Usage:
$matrixset->add_matrix(@list_of_matrix_objects); - Function: adds matrix objects to the matrixset
- Returns: an object reference (which you're usually gonna ignore, ngl)
- Args: one or more
TFBS::Matrix::*objects
add_matrix_set
- Title:
add_matrix - Usage:
$matrixset->add_matrix(@list_of_matrixset_objects); - Function: adds to the matrixset the matrix objects contained in one or more other matrixsets
- Returns: an object reference (again, usually ignored π«Ά)
- Args: one or more
TFBS::MatrixSetobjects
search_seq
- Title:
search_seq - Usage:
my $siteset = $matrixset->search_seq(%args) - Function: scans a nucleotide sequence with all the patterns stored in
$matrixset.
heads up: this only works if all the matrix objects in$matrixsetunderstand thesearch_seqmethod β and rn, onlyTFBS::Matrix::PWMobjects do.
- Returns: a
TFBS::SiteSetobject - Args: you have to specify exactly one of these three π
-fileβ the name of a fasta file (single sequence)-seqobjβ aBio::Seqobject (or, more accurately, aBio::PrimarySeqobject or a subclass thereof)-seqstringβ a string containing the sequence
and then this one:
-thresholdβ minimum score for the hit, either absolute (like11.2) or relative (like"75%"). OPTIONAL: default"80%"
search_aln
- Title:
search_aln - Usage:
my $site_pair_set = $matrixset->search_aln(%args) - Function: scans a pairwise alignment of nucleotide sequences with the pattern represented by the PWM. It reports only those hits that are present in equivalent positions of both sequences, exceed a specified threshold score in both, AND are found in regions of the alignment that are above the specified conservation cutoff value. Obsessed with the specificity honestly π
heads up again: this only works if all matrix objects in$matrixsetunderstand thesearch_alnmethod β currently onlyTFBS::Matrix::PWMobjects do.
- Returns: a
TFBS::SitePairSetobject - Args: you must specify exactly one of these three π
-fileβ the name of the alignment file in Clustal format-alignobjβ aBio::SimpleAlignobject (or, more accurately, aBio::PrimarySeqobject or a subclass thereof)-alignstringβ a multi-line string containing the alignment in clustal format
and then the rest:
-thresholdβ minimum score for the hit, either absolute (like11.2) or relative (like"75%"). OPTIONAL: default"80%"-windowβ size of the sliding window (in nucleotides) used to calculate local conservation in the alignment. OPTIONAL: default50-cutoffβ conservation cutoff (%) for including a region in the results of the pattern search. OPTIONAL: default"70%"-subpartβ a subpart of the alignment to search, given like this:
-subpart => { relative_to => 1,
start => 140,
end => 180 }
where start and end are coordinates in the sequence indicated by relative_to (1 for the 1st sequence in the alignment, 2 for the 2nd). OPTIONAL: by default it searches the entire alignment.
-conservationβ a conservation profile, aTFBS::ConservationProfile. OPTIONAL: by default the conservation profile is computed internally on the fly (which is less efficient, ngl).
size
- Title:
size - Usage:
my $number_of_matrices = $matrixset->size; - Function: gets the number of matrix objects in the
$matrixset(aka the size of the set, duh) - Returns: a number
- Args: none
Iterator
- Title:
Iterator - Usage:
my $matrixset_iterator =
$matrixset->Iterator(-sort_by =>'total_ic');
while (my $matrix_object = $matrix_iterator->next) {
# do whatever you want with individual matrix objects
}
- Function: returns an iterator object you can use to go through every single member of the set, one by one, no skipping π
- Returns: an iterator object (currently undocumented in TFBS β but it understands the
nextmethod, iykyk) - Args:
-sort_byβ optional. Currently it accepts:'ID'(alphabetically)'name'(alphabetically)'class'(alphabetically)'total_ic'(numerically, decreasing order)
-reverseβ optional. Reverses the default sorting order if true
randomize_columns
- Title:
randomize_columns - Usage:
$matrixset->randomize_columns(); - Function: randomizes the columns between all the matrices in the set (in place, so watch out π)
- Returns: nothing
- Args: none
remove_Matrix_by_ID
- Title:
remove_Matrix_by_ID - Usage:
$matrixset->remove_Matrix_by_ID($id); - Function: removes a matrix from the set
- Returns: nothing
- Args: none
cluster
- Title:
cluster - Usage:
$matrixset->cluster(%args) - Function: clusters the matrices in the set
- Returns: the root node of the hierarchical clustering tree, an integer specifying the optimal number of clusters, and an array of
TFBS::MatrixSets, one for each cluster π - Args: many, bestie:
-stampdirβ the directory where stamp is located. Not necessary if it's in thePATH.-tempdirβ directory to put temporary files in. Defaults to"/tmp".-nocleanβ0to clean up temporary files,1otherwise-treeβ method for constructing the tree (UPGMA/SOTA). Default:UPGMA
fbp
- Title:
fbp - Usage:
$matrixset->fbp(%args); - Function: creates a familial binding profile (FBP) for the set β¨
- Returns: a familial binding profile represented as a
TFBS::Matrix::PFM - Args: many
-stampdirβ the directory where stamp is located. Not necessary if it's in thePATH.-tempdirβ directory to put temporary files in. Defaults to"/tmp".-nocleanβ0to clean up temporary files,1otherwise-alignβ alignment method
and that's the whole page, bestie!! this gorgeous thing is perl v5.42.3, dated 2026-08-21, and it's giving TFBS::MatrixSet(3pm) energy from start to finish πβ¨ go forth and manipulate your matrix sets, you absolute main character π¦π
π¦ 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