TFBS::Matrix(3pm)

πŸ’– NAME πŸ’–

TFBS::Matrix β€” bestie, it's the base class for matrix patterns, and it's holding all the methods that literally every one of them shares 🫢


✨ DESCRIPTION ✨

okay so TFBS::Matrix is a base class. What does that mean fr fr? It's the blueprint. It's giving main character energy but it does not get instantiated itself, okay? No solo debut for this one πŸ’…

What it actually is: a universal constructor that its subclasses (TFBS::Matrix::*) call whenever they need to be born, plus a whole lil collection of matrix manipulation methods that don't care what type of matrix you handed them. Type-independent. Universal. Iconic.

Not meant to be instantiated itself. So don't try it, bestie, that's not her role 🌸

πŸ“£ FEEDBACK πŸ“£

Found a bug? Got thoughts? Comments? Not me gatekeeping feedback β€” please send bug reports and other comments to the author <3


πŸ‘‘ AUTHOR - Boris Lenhard πŸ‘‘

Boris Lenhard <Boris.Lenhard@cgb.ki.se>

Modified by Eivind Valen eivind.valen@gmail.com ✨


πŸŽ€ APPENDIX πŸŽ€

The rest of the documentation details each of the object methods. Heads up: internal methods are preceded with an underscore β€” iykyk, those are the behind-the-scenes girlies πŸ™ˆ

🧚 matrix

  • Title: matrix
  • Usage:
my $matrix = $pwm->matrix();
$pwm->matrix( [ [12, 3, 0, 0, 4, 0],
                [ 0, 0, 0,11, 7, 0],
                [ 0, 9,12, 0, 0, 0],
                [ 0, 0, 0, 1, 1,12]
              ]);
  • Function: it's the get/set for the matrix data β€” grab it or set it, your call πŸ’–
  • Returns: a reference to a 2D array of integers (PFM) or floats (ICM, PWM)
  • Args: none for a get; for a set you can pass a four line string, a reference to 2D array, or a 2D piddle

πŸ¦‹ pdl_matrix

  • Title: pdl_matrix
  • Usage: my $pdl = $pwm->pdl_matrix();
  • Function: access the PDL matrix used to store the actual matrix data, directly β€” no middleman, no filter 🫢
  • Returns: a PDL object, aka a piddle</piddle>
  • Args: none

🌈 revcom

  • Title: revcom
  • Usage: my $revcom_pfm = $pfm->revcom();
  • Function: create a matrix pattern object which is the reverse complement of the current one β€” flip it and reverse it πŸ”₯
  • Returns: a TFBS::Matrix::* object of the same type as the one the method acted upon
  • Args: none

πŸ’œ rawprint

  • Title: rawprint
  • Usage: my $rawstring = $pfm->rawprint);
  • Function: convert matrix data to a simple, tab-separated format
  • Returns: a four-line string of tab-separated integers or floats
  • Args: none

πŸ“ prettyprint

  • Title: prettyprint
  • Usage: my $prettystring = $pfm->prettyprint();
  • Function: convert matrix data to a human-readable string format β€” the glow-up version ✨
  • Returns: a four-line string with nucleotides and aligned numbers
  • Args: none

⭐ STAMPprint

  • Title: STAMPprint
  • Usage: my $STAMPstring = $pfm->STAMPprint();
  • Function: convert the matrix to a STAMP readable format
  • Returns: a string of the matrix in a TRANSFAC like format for STAMP
  • Args: none

πŸŽ€ length

  • Title: length
  • Usage: my $pattern_length = $pfm->length;
  • Function: gets the pattern length in nucleotides β€” that's the number of columns in the matrix, bestie
  • Returns: an integer
  • Args: none

πŸ’… randomize_columns

  • Title: randomize_columns
  • Usage: $pfm->randomize_columns();
  • Function: randomizes the columns of a matrix, in place β€” yes, it messes with the original, that's the whole point πŸ™ˆ
  • Returns: nothing
  • Args: none

okay bestie that's the whole page, no cap πŸ’– this was TFBS::Matrix(3pm) from the User Contributed Perl Documentation, sitting pretty at perl v5.42.3 and dated 2026-08-21. slay, go forth and matrix πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from