Newer
Older
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use strict;
use lib 't';
use TestUtils qw(test_getter_setter);
use MultiTestDB;
BEGIN { $| = 1;
use Test;
plan tests => 22;
}
my $multi_db = MultiTestDB->new;
my $db = $multi_db->get_DBAdaptor('core');
my $verbose = 0;
# Test Creation
my $rca = $db->get_RepeatConsensusAdaptor();
ok(ref($rca) && $rca->isa('Bio::EnsEMBL::DBSQL::RepeatConsensusAdaptor'));
#
# Test fetch_by_dbID
#
my $rc = $rca->fetch_by_dbID(9);
ok($rc->name() eq 'MIR3');
ok($rc->dbID == 9);
ok($rc->repeat_consensus eq '');
ok($rc->length() == 0);
ok($rc->repeat_class eq 'Type I Transposons/SINE');
#
# Test fetch_by_name
#
$rc = $rca->fetch_by_name('MIR');
ok($rc->name() eq 'MIR');
ok($rc->dbID() == 1);
ok($rc->repeat_consensus eq '');
ok($rc->length() == 0);
ok($rc->repeat_class eq 'Type I Transposons/SINE');
#
# Test fetch_by_name_class
#
$rc = $rca->fetch_by_name_class('MER65A', 'LTRs');
ok($rc->name() eq 'MER65A');
ok($rc->dbID() == 283);
ok($rc->repeat_class eq 'LTRs');
ok($rc->repeat_consensus eq '');
ok($rc->length() == 0);
#
# Test fetch_all_by_class_seq
#
ok(@{$rca->fetch_all_by_class_seq('LTRs', '')} == 38);
#
# Test store
#
$multi_db->save('core', 'repeat_consensus');
$rc = Bio::EnsEMBL::RepeatConsensus->new
(-REPEAT_CONSENSUS => 'ACTG',
-NAME => 'ACTG(n)',
-LENGTH => 4,
-REPEAT_CLASS => 'Simple_repeat');
$rca->store($rc);
ok($rc->dbID && $rc->adaptor());
$rc = $rca->fetch_by_dbID($rc->dbID);
ok($rc->repeat_consensus eq 'ACTG');
ok($rc->repeat_class eq 'Simple_repeat');
ok($rc->length() == 4);
ok($rc->name eq 'ACTG(n)');
$multi_db->restore('core', 'repeat_consensus');