Skip to content

Commit

Permalink
hyper is back after GLR
Browse files Browse the repository at this point in the history
  • Loading branch information
cjfields committed Sep 5, 2015
1 parent c3a3bc0 commit 45c82ed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Bio/Tools/CodonTable.pm6
Expand Up @@ -134,11 +134,13 @@ class Bio::Tools::CodonTable {
my $protein = '';

# special case most common scenario
# TODO: This could definitely be optimized using hyper/race/etc.
if $seq ~~ m:i/^^<[atgc]>+$$/ {
$protein = $seq.comb(/.../).map({
@!TABLES[ self.id-1 ].substr( %codons{ $_.lc }, 1);
}).join('');
my $aa = $seq.comb(/.../)>>.map(
{
@!TABLES[ self.id-1 ].substr( %codons{ $_.lc }, 1);
}
);
$protein = $aa.join('');
} else {
loop (my $i = 0; $i < ($seq.chars - (CODONSIZE - 1)); $i+=CODONSIZE) {
given substr($seq, $i, CODONSIZE).lc {
Expand Down

0 comments on commit 45c82ed

Please sign in to comment.