1
# -*-Perl-*- Test Harness script for Bioperl
2
# $Id: EncodedSeq.t 15112 2008-12-08 18:12:38Z sendu $
10
test_begin(-tests => 37);
12
use_ok('Bio::Seq::EncodedSeq');
16
my ($str, $aln, $seq, $loc);
18
ok $seq = Bio::Seq::EncodedSeq->new(
19
-seq => '--atg---gta--',
24
is $seq->alphabet, 'dna';
29
is $seq->column_from_residue_number(4), 9;
33
$seq->column_from_residue_number(8);
37
ok $loc = $seq->location_from_column(4);
38
isa_ok $loc, 'Bio::Location::Simple';
39
is $loc->to_FTstring, "2";
41
ok $loc = $seq->location_from_column(6);
42
isa_ok $loc,'Bio::Location::Simple';
44
is $loc->location_type, 'IN-BETWEEN';
45
is $loc->to_FTstring, '3^4';
47
is $loc = $seq->location_from_column(2), undef;
49
is $seq->encoding, "GGCCCGGGCCCGG";
50
is $seq->encoding(-explicit => 1), "GGCDEGGGCDEGG";
52
ok $seq = Bio::Seq::EncodedSeq->new(
58
is $seq->encoding('CCGGG'), 'CCGGGCCCC';
59
is $seq->seq, 'atcg---ta';
60
is $seq->column_from_residue_number(14), 2;
61
is $seq->encoding('3C2GCG'), 'CCCGGCGCC';
62
is $seq->seq, 'at-c--gta';
64
is $seq->location_from_column(2)->to_FTstring, 14;
65
is $seq->location_from_column(5)->to_FTstring, "12^13";
66
is $seq->encoding("B", Bio::Location::Simple->new(-start => 10, -end => 11,
67
-location_type => 'IN-BETWEEN')), 'B';
68
is $seq->seq, 'at-c--gt-a';
69
is $seq->encoding, 'CBCCGGCGCC';
70
is $seq->cds(-nogaps => 1)->seq, 'tacgat';
71
is $seq->translate->seq, 'YD';
72
ok $seq = $seq->trunc(4,10); # kinda testing LocatableSeq's new trunc() here as well.
73
is $seq->seq, 'c--gt-a';
74
is $seq->encoding, 'CBCCGGC';