Summary | Included libraries | Package variables | Description | General documentation | Methods |
_consensus2matrixref | No description | Code |
_replace_patterns_in_sitepairset | No description | Code |
_replace_patterns_in_siteset | No description | Code |
_transpose_arrayref | No description | Code |
length | Description | Code |
search_aln | Description | Code |
search_seq | Description | Code |
to_PWM | Description | Code |
validate_word | Description | Code |
length | code | next | Top |
search_aln | code | prev | next | Top |
Title : search_aln |
search_seq | code | prev | next | Top |
Title : search_seq |
to_PWM | code | prev | next | Top |
validate_word | code | prev | next | Top |
_consensus2matrixref | description | prev | next | Top |
my ($word) = @_; my %iupac = ( T => [0,0,0,1], G => [0,0,1,0], K => [0,0,1,1], C => [0,1,0,0], Y => [0,1,0,1], S => [0,1,1,0], B => [0,1,1,1], A => [1,0,0,0], W => [1,0,0,1], R => [1,0,1,0], D => [1,0,1,1], M => [1,1,0,0], H => [1,1,0,1], V => [1,1,1,0], N => [1,1,1,1] ); my @vert_array; foreach my $letter (split '', $word) { push @vert_array, ($iupac{uc($letter)} or croak ("$letter is not a legal IUPAC DNA character")); } return _transpose_arrayref(\@vert_array);}
_replace_patterns_in_sitepairset | description | prev | next | Top |
my ($self, $sitepairset) = @_; my $iter = $sitepairset->Iterator; while (my $sitepair = $iter->next) { $sitepair->feature1->pattern($self); $sitepair->feature2->pattern($self); } } # utility functions}
_replace_patterns_in_siteset | description | prev | next | Top |
my ($self, $siteset) = @_; my $iter = $siteset->Iterator; while (my $site = $iter->next) { $site->pattern($self); }}
_transpose_arrayref | description | prev | next | Top |
my $vert_arrayref = shift; my $maxcol = scalar(@$vert_arrayref) - 1; my @horiz_array; foreach my $row (0..3) { push @horiz_array, [ map { $vert_arrayref->[$_][$row] } 0..$maxcol ]; } return\@ horiz_array; } 1;}
length | description | prev | next | Top |
return length $_[0]->word; } # private methods}
search_aln | description | prev | next | Top |
my ($self, @args) = @_; my ($max_mismatch) = $self->_rearrange([qw(MAX_MISMATCHES)], @args) or 0; $max_mismatch = 0 unless defined $max_mismatch; my $pwm = $self->to_PWM; my $sitepairset = $pwm->search_aln(@args, -threshold => $self->length - $max_mismatch); $self->_replace_patterns_in_sitepairset($sitepairset); return $sitepairset;}
search_seq | description | prev | next | Top |
my ($self, @args) = @_; my ($max_mismatch) = $self->_rearrange([qw(MAX_MISMATCHES)], @args) or 0; $max_mismatch = 0 unless defined $max_mismatch; my $pwm = $self->to_PWM; my $siteset = $pwm->search_seq(@args, -threshold => $self->length - $max_mismatch); $self->_replace_patterns_in_siteset($siteset); return $siteset;}
to_PWM | description | prev | next | Top |
my ($self, @args) = @_; my $pwm = TFBS::Matrix::PWM->new(-ID => $self->ID, -name => $self->name, -class => $self->class, -matrix => _consensus2matrixref($self->word), -tags => {$self->all_tags} ); return $pwm;}
validate_word | description | prev | next | Top |
my ($self, $word) = @_; $word =~ s/[ACGTSWKMRYBDHVN]//gi; return ($word eq "");}
FEEDBACK | Top |
AUTHOR - Boris Lenhard | Top |
APPENDIX | Top |
new | Top |
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:
-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