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::MatrixSet objects

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 $matrixset understand the search_seq method β€” and rn, only TFBS::Matrix::PWM objects do.
  • Returns: a TFBS::SiteSet object
  • Args: you have to specify exactly one of these three πŸ‘‡
  • -file β€” the name of a fasta file (single sequence)
  • -seqobj β€” a Bio::Seq object (or, more accurately, a Bio::PrimarySeq object or a subclass thereof)
  • -seqstring β€” a string containing the sequence

and then this one:

  • -threshold β€” minimum score for the hit, either absolute (like 11.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 $matrixset understand the search_aln method β€” currently only TFBS::Matrix::PWM objects do.
  • Returns: a TFBS::SitePairSet object
  • Args: you must specify exactly one of these three πŸ‘‡
  • -file β€” the name of the alignment file in Clustal format
  • -alignobj β€” a Bio::SimpleAlign object (or, more accurately, a Bio::PrimarySeq object 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 (like 11.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: default 50
  • -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, a TFBS::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 next method, 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 the PATH.
    • -tempdir β€” directory to put temporary files in. Defaults to "/tmp".
    • -noclean β€” 0 to clean up temporary files, 1 otherwise
    • -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 the PATH.
    • -tempdir β€” directory to put temporary files in. Defaults to "/tmp".
    • -noclean β€” 0 to clean up temporary files, 1 otherwise
    • -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