TFBS::Site(3pm)

πŸ’– TFBS::Site β€” bestie edition πŸ’–

okay so welcome to TFBS::Site(3pm), the Perl manual page you're gonna actually enjoy reading for once. grab a boba, sit down, let's get into it πŸ§‹βœ¨


✨ NAME ✨

TFBS::Site β€” it's a nucleotide sequence feature object, and what it represents is a (possibly putative) transcription factor binding site. yes really. that's the whole vibe. πŸ§¬πŸ‘‘


🌸 SYNOPSIS 🌸

here's the moment you've been waiting for, the code, untouched, iconic, no notes:

# manual creation of site object;
# for details, see documentation of Bio::SeqFeature::Generic;

my $site = TFBS::Site
              (-start => $start_pos,     # integer
               -end   => $end_pos,       # integer
               -score => $score,         # float
               -source => "TFBS",        # string
               -primary => "TF binding site",  # primary tag
               -strand => $strand,       # -1, 0 or 1
               -seqobj => $seqobj,       # a Bio::Seq object whose sequence
                                         #            contains the site
               -pattern => $pattern_obj  # usu. TFBS::Matrix:PWM obj.
               -);

# Searching sequence with a pattern (PWM) and retrieving individual sites:
#
#   The following objects should be defined for this example:
#       $pwm    -   a TFBS::Matrix::PWM object
#       $seqobj -   a Bio::Seq object
#   Consult the documentation for the above modules if you do not know
#   how to create them.

#   Scanning sequence with $pwm returns a TFBS::SiteSet object:

my $site_set = $pwm->search_seq(-seqobj => $seqobj,
                                -threshold => "80%");

#   To retrieve individual sites from $site_set, create an iterator obj:

my $site_iterator = $site_set->Iterator(-sort_by => "score");

while (my $site = $site_iterator->next())  {
    # do something with $site
}

like, look at that. beautiful. no cap. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so a TFBS::Site object is literally just holding data for a transcription factor binding site on a nucleotide sequence β€” could be predicted, could be real, doesn't matter, it's holding it. what data? start, end, strand, score, tags, plus references to the sequence object and the pattern object it's vibing with. πŸ“¦

and the best part: TFBS::Site is a subclass of Bio::SeqFeature::Generic, which means it inherited all of that module's methods. main character energy honestly. πŸ‘‘

on top of all that, it also has its own pattern() method β€” that's the accessor for the pattern object hanging out with the site object. πŸŽ€


πŸ“¬ FEEDBACK πŸ“¬

got a bug? got thoughts? got feelings? send bug reports and other comments to the author. they wanna hear it, fr fr.


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

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


🌈 APPENDIX 🌈

everything else you need to know about the object methods lives right here. and heads up: internal methods are preceded with an underscore, so if you see a _ bestie, that's a private one, mind ya business πŸ™ˆ

also, reminder, because it matters: TFBS::Site is a class that extends Bio::SeqFeature::Generic. so for other available methods, please go consult the Bio::SeqFeature::Generic documentation. i'm not gatekeeping, i'm just telling you where the rest of the lore is πŸ“šβœ¨

🧚 new

  • Title β€” new
  • Usage β€” my $site = TFBS::Site->new(%args)
  • Function β€” constructor for the TFBS::Site object. it makes the thing. ✨
  • Returns β€” a TFBS::Site object
  • Args β€”
    • -start, β€” integer
    • -end, β€” integer
    • -strand, β€” -1, 0 or 1
    • -score, β€” float
    • -source, β€” string (method used to detect it)
    • -primary, β€” string (primary tag)
    • -seqobj, β€” a Bio::Seq object
    • -pattern β€” a pattern object, usu. TFBS::Matrix::PWM

πŸ“ pattern

  • Title β€” pattern
  • Usage β€”
my $pattern = $site->pattern();  # gets the pattern
$site->pattern($pwm);            # sets the pattern to $pwm
  • Function β€” gets/sets the pattern object associated with the site
  • Returns β€” pattern object, here a TFBS::Matrix::PWM object
  • Args β€” pattern object (optional, for setting the pattern only)

πŸ’œ rel_score

  • Title β€” rel_score
  • Usage β€” my $percent_score = $site->rel_score() * 100; # gets the pattern
  • Function β€” gets the relative score (between 0.0 to 1.0) with respect of the score range of the associated pattern (matrix)
  • Returns β€” floating point number between 0 and 1, or undef if pattern not defined
  • Args β€” none

πŸ”₯ GFF

  • Title β€” GFF
  • Usage β€”
print $site->GFF();
print $site->GFF($gff_formatter)
  • Function β€” returns a "standard" GFF string β€” the "generic" gff_string method is left untouched for possible customizations
  • Returns β€” a string (NOT newline terminated! ) 😀
  • Args β€” a $gff_formatter function reference (optional)

🌸 the inherited ones 🌸

location start end length score frame sub_SeqFeature add_sub_SeqFeature flush_sub_SeqFeature primary_tag source_tag has_tag add_tag_value each_tag_value all_tags remove_tag attach_seq seq entire_seq seq_id annotation gff_format gff_string

all of the above methods are inherited from Bio::SeqFeature::Generic. please see Bio::SeqFeature::Generic for details on their usage β€” that's where the full tea is at β˜•πŸ«Ά


and that's the page!! this was TFBS::Site from perl v5.42.3, dated 2026-08-21, and it's literally the TFBS::Site(3pm) manpage, xoxo, go write some bomb Perl πŸ’–πŸŽ€πŸ¦‹ periodt ✨

πŸ“¦ where this page comes from