NucleotideColours.pl
From Organic Design wiki
<perl>
- !/usr/bin/perl
sub nucleotide_colors {
my $params = {
motif => undef, blocks => 0, @_};
unless(ref $params->{'motif'} eq 'SCALAR') {
&return_html_error('title_text' => 'INTERNAL ERROR', 'error_msg' => qq|&nucleotide_colors subroutine variable 'motif' requires a SCALAR reference as input|); exit 0;
}
my $nucleotide_color_scheme = {
'G' => 'black', 'g' => 'black', 'T' => 'red', 't' => 'red', 'A' => 'green', 'a' => 'green', 'C' => 'blue', 'c' => 'blue' };
if($params->{blocks}) {
${$params->{motif}} =~s/(\w{$params->{blocks}})/$1 /g;
} ${$params->{motif}} =~ s/([@{[join "",keys%{$nucleotide_color_scheme}]}])/{$1}" class="est">$1<\/font>/g;
} </perl>