TFBS::...nsensus(3pm)

TFBS::...nsensus(3pm)

okay so bestie, real quick before we dive in: this is a page from the User Contributed Perl Documentation, and the manual name up top is literally TFBS::...nsensus(3pm) πŸ’… so that's the one we're reading. Keep that in your pocket.


✨ NAME ✨

TFBS::Word β€” IUPAC DNA consensus word-based pattern class

and yes, the actual NAME line in the original has =head1 DESCRIPTION glued onto the end of it with zero shame 😭 pod podding, we love to see it.


πŸ¦‹ DESCRIPTION πŸ¦‹

TFBS::Word is a base class, okay? It's giving "universal constructor that my subclasses call" energy β€” those subclasses are the TFBS::Matrix::* crew. On top of that it brings word pattern manipulation methods that don't care what flavour of word you're working with.

It is not meant to be instantiated itself, bestie. It's a base class. Do not come for it directly. Respect the hierarchy 🫢


πŸ“£ FEEDBACK πŸ“£

Got a bug? Got a comment? Got feelings? Please send bug reports and other comments to the author. That's the whole vibe.


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

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


πŸŽ€ APPENDIX πŸŽ€

The rest of this documentation details each of the object methods. Internal methods are preceded with an underscore. (iykyk, that leading _ is your little secret-handshake signifier ✨)


🍼 new

  • Title: new
  • Usage: my $pwm = TFBS::Matrix::PWM->new(%args)
  • Function: constructor for the TFBS::Matrix::PWM object
  • Returns: a new TFBS::Matrix::PWM object
  • Args: you must specify the -word argument:
# you must specify the -word argument:
-word,       # a strig consisting of letters in
             # IUPAC degenerate DNA alphabet
             # (any of ACGTSWKMPYBDHVN)

#######

-name,        # string, OPTIONAL
-ID,          # string, OPTIONAL
-class,       # string, OPTIONAL
-tags         # a hash reference reference, OPTIONAL

so -word is the only mandatory one β€” it's a string built out of the IUPAC degenerate DNA alphabet, and the letters you're allowed are exactly ACGTSWKMPYBDHVN 🌸 (yes the original says "strig", yes we're leaving it, it's iconic and also not our business 😌)

then you've got your optionals: -name, -ID, -class, and -tags, which is a hash reference reference πŸ™ˆ β€” that's the manpage's words, not mine, and everything there is a string, OPTIONAL except the hash ref. The ####### divider? Also theirs. Cute.


πŸ” search_seq

  • Title: search_seq
  • Usage: my $siteset = $pwm->search_seq(%args)
  • Function: scans a nucleotide sequence with the pattern represented by the PWM
  • Returns: a TFBS::SiteSet object
  • Args: you must specify either one of the following three:
-file,       # the name od a fasta file (single sequence)
   #or
-seqobj      # a Bio::Seq object
             # (more accurately, a Bio::PrimarySeqobject or a
             #  subclass thereof)
   #or
-seqstring # a string containing the sequence

-max_mismatches,  # number of allowed positions in the site that do
                  # not match the consensus
                          # OPTIONAL: default 0

so you pick one of -file (the name of a fasta file, and it's a single sequence bestie, don't get cute), or -seqobj (a Bio::Seq object β€” more accurately a Bio::PrimarySeqobject or a subclass of it), or -seqstring (just a plain old string holding the sequence). one of the three. pick one. πŸ’€

and then -max_mismatches is the number of allowed positions in the site that do not match the consensus. It's OPTIONAL with a default of 0 β€” so by default every position has to match, periodt.


πŸ”Ž search_aln

  • Title: search_aln
  • Usage: my $site_pair_set = $pwm->search_aln(%args)
  • Function: scans a pairwise alignment of nucleotide sequences with the pattern represented by the word. So here's the tea: it reports only those hits that
    • are present in equivalent positions of both sequences, and
    • exceed a specified threshold score in both, AND
    • are found in regions of the alignment above the specified conservation cutoff value
  • Returns: a TFBS::SitePairSet object
  • Args: you must specify either one of the following three:
-file,       # the name of the alignment file in Clustal
                    format
   #or
-alignobj      # a Bio::SimpleAlign object
             # (more accurately, a Bio::PrimarySeqobject or a
             #  subclass thereof)
   #or
-alignstring # a multi-line string containing the alignment
             # in clustal format
#############

-max_mismatches,  # number of allowed positions in the site that do
                   # not match the consensus
                           # OPTIONAL: default 0

-window,     # size of the sliding window (inn nucleotides)
             # for calculating local conservation in the
             # alignment
             # OPTIONAL: default 50

-cutoff      # conservation cutoff (%) for including the
             # region in the results of the pattern search
             # OPTIONAL: default "70%"

so again, pick one: -file (the name of the alignment file in Clustal format), or -alignobj (a Bio::SimpleAlign object β€” more accurately a Bio::PrimarySeqobject or a subclass thereof, same deal as before), or -alignstring (a multi-line string containing the alignment, in clustal format).

then the optionals:

  • -max_mismatches β€” number of allowed positions in the site that do not match the consensus. OPTIONAL, default 0. same as above, no slips allowed unless you say so.
  • -window β€” size of the sliding window, in nucleotides, for calculating local conservation in the alignment. OPTIONAL, default 50. (the original says "inn nucleotides", and honestly? inn. we're keeping inn 🧚)
  • -cutoff β€” conservation cutoff, in percent, for including the region in the results of the pattern search. OPTIONAL, default "70%" β€” yes with the quotes, that's how it's written, don't @ me.
heads up supernatural beings: only regions above that conservation cutoff even get to play, and the hit has to clear the score in both sequences at equivalent positions. it's not a vibe check, it's a whole audit πŸ’…

🌈 and then... the mystery trio

okay so the page just ends with these three method names listed, and that is all it says about them:

  • to_PWM
  • validate_word
  • length

no title, no usage, no function, no returns, no args. just... names. floating. main character energy with zero backstory 😭 that's the entire documentation for them, bestie, and I refuse to invent anything on their behalf. what you see is what you get.


and that's the whole page, no cap. every option, every default, every typo, every #or, all of it. 🫢

written by Boris Lenhard <Boris.Lenhard@cgb.ki.se>, shipping as part of perl v5.42.3 with a date stamp of 2026-08-21, filed under TFBS::...nsensus(3pm) πŸ’– go forth and build consensus, queen πŸ‘‘βœ¨

πŸ“¦ where this page comes from