TFBS
Word
TFBS::Word - base class for word-based patterns
|
| No package variables defined. |
TFBS::Word is a base class consisting of universal constructor called by its subclasses (TFBS::Matrix::*), and word pattern manipulation methods that are independent of the word type. It is not meant to be instantiated itself.
|
Methods description
Required in all subclasses
Methods code
sub length
{ ## wird length does not have to be defined, but its subroutine does
shift->throw("Error: method 'length' not implemented");
}
sub new
{ my ($caller, @args) = @_;
my $self = $caller->SUPER::new(@args);
my ($id, $name, $class, $word, $tagref) = $self->_rearrange([qw(ID NAME CLASS
WORD TAGS)], @args);
if (defined $word) { $self->word($word); }
else { $self->throw("Need a -word argument"); }
$self->name($name);
$self->ID($id);
$self->{'tags'} = ($tagref or {});
return $self;}
sub search_aln
{ shift->throw("Error: method search_aln not implemented");}
sub search_seq
{ shift->throw("Error: method search_seq not implemented");}
sub validate_word
{ shift->throw("Error: method 'validate_word' not implemented");}
sub word
{ my ($self, @args) = @_;
if(scalar(@args) == 0) {
return $self->{'word'};
}
my ($word) = @args;
if (defined $word and ! $self->validate_word($word)) {
$self->throw("Trying to set the word to an invalid value: $word");
}
else {
return $self->{'word'} = $word;
}}
General documentation