sub color {
my($colorkey) = @_;
my $color = '';
my %color_key = (
A => " A ",
C => " C ",
G => " G ",
T => " T ",
R => " R ",
Y => " Y ",
M => " M ",
K => " K ",
S => " S ",
W => " W ",
B => " F ",
D => " F ",
H => " H ",
V => " V ",
N => " N ",
L => " L ",
P => " P ",
Q => " Q ",
I => " I ",
E => " E ",
_ => " _ ",
);
# Translate each character in the sequence coloured character
for ( my $i = 0 ; $i < length($colorkey) ; ++$i ) {
$color
.= $color_key{substr($colorkey, $i, 1)};
}
return
}