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
88
89
90
91
92
93
94
95
96
97
use strict;
use warnings;
use lib 't';
BEGIN { $| = 1;
use Test;
plan tests => 23;
}
use TestUtils qw( debug test_getter_setter );
use Bio::EnsEMBL::FeaturePair;
use Bio::EnsEMBL::Slice;
use Bio::EnsEMBL::Analysis;
use Bio::EnsEMBL::CoordSystem;
use MultiTestDB;
our $verbose= 0; #turn on or off debug statements
my $coord_system = Bio::EnsEMBL::CoordSystem->new
(-NAME => 'chromosome',
-VERSION => 'NCBI34',
-DBID => 123,
-TOP_LEVEL => 1);
my $analysis = Bio::EnsEMBL::Analysis->new(-LOGIC_NAME => 'test');
my $slice = Bio::EnsEMBL::Slice->new(-COORD_SYSTEM => $coord_system,
-SEQ_REGION_NAME => 'X',
-START => 1_000_000,
-END => 2_000_000);
#
# Test new and getters
#
my $start = 10;
my $end = 100;
my $strand = -1;
my $hstart = 1;
my $hend = 90;
my $hstrand = 1;
my $hseqname = 'RF1231';
my $percent_id = 90.8;
my $p_value = '1.52';
my $score = 50;
my $species = 'Homo_sapiens';
my $hspecies = 'Mus_musculus';
my $fp = Bio::EnsEMBL::FeaturePair->new(-START => $start,
-END => $end,
-STRAND => $strand,
-ANALYSIS => $analysis,
-SLICE => $slice,
-HSTART => $hstart,
-HSTRAND => $hstrand,
-HEND => $hend,
-HSEQNAME => $hseqname,
-PERCENT_ID => $percent_id,
-P_VALUE => $p_value,
-SCORE => $score,
-SPECIES => $species,
-HSPECIES => $hspecies);
ok($fp && $fp->isa('Bio::EnsEMBL::FeaturePair'));
ok($fp->start == $start);
ok($fp->end == $end);
ok($fp->strand == $strand);
ok($fp->analysis == $analysis);
ok($fp->slice == $slice);
ok($fp->hstart == $hstart);
ok($fp->hend == $hend);
ok($fp->hseqname eq $hseqname);
ok($fp->percent_id == $percent_id);
ok($fp->p_value == $p_value);
ok($fp->score == $score);
ok($fp->species eq $species);
ok($fp->hspecies eq $hspecies);
#
# Test setters
#
ok(test_getter_setter($fp, 'hstart', 1002));
ok(test_getter_setter($fp, 'hend', 2002));
ok(test_getter_setter($fp, 'hseqname', 'test'));
ok(test_getter_setter($fp, 'percent_id', 123.2));
ok(test_getter_setter($fp, 'p_value', 23.0));
ok(test_getter_setter($fp, 'score', 123));
ok(test_getter_setter($fp, 'species', 'Rattus_norvegicus'));
ok(test_getter_setter($fp, 'hspecies', 'Danio_rerio'));
ok($fp->display_id eq $fp->hseqname());