File: Backtranslate.t

package info (click to toggle)
bioperl 1.7.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 35,888 kB
  • sloc: perl: 94,151; xml: 14,982; makefile: 20
file content (34 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings;

BEGIN {
    use Bio::Root::Test;
    test_begin( -tests => 8, -requires_module => 'List::MoreUtils');
}

use_ok 'Bio::Tools::SeqPattern::Backtranslate';

can_ok 'Bio::Tools::SeqPattern::Backtranslate', '_reverse_translate_motif';

my @data;
while (<DATA>) {
    chomp;
    push @data, [split];
}

foreach my $line (@data) {
    if ( $line->[1] ) {
        is _reverse_translate_motif( $line->[0] ), $line->[1];
    } else {
        throws_ok { _reverse_translate_motif( $line->[0] ) }
        qr/syntax token/;
    }
}

__DATA__
MAEELKAVAP ATGGCNGARGARYTNAARGCNGTNGCNCCN
LKGHB[WhYq]Q YTNAARGGNCAYRAYYRNCAR
(LK){2,3}[^GHB][WHYQ]Q (YTNAAR){2,3}HBNYRNCAR
LK[^GHB][WHYQ]Q YTNAARHBNYRNCAR
(LK){2,3}[^GHB][WHYQ]QX.X (YTNAAR){2,3}HBNYRNCARNNNNNNNNN
/&%/&%(/)(/%