Newer
Older
Ewan Birney
committed
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
98
99
100
101
102
103
104
105
106
107
108
109
110
use lib 't';
BEGIN { $| = 1;
use Test;
plan tests => 4;
}
my $loaded = 0;
END {print "not ok 1\n" unless $loaded;}
use EnsTestDB;
use Bio::EnsEMBL::DBLoader;
$loaded = 1;
ok(1);
# Database will be dropped when this
# object goes out of scope
my $ens_test = EnsTestDB->new;
$ens_test->do_sql_file("t/minidatabase.dump");
ok($ens_test);
my $db = $ens_test->get_DBSQL_Obj;
$sla= $db->get_SliceAdaptor();
$slice = $sla->new_slice('1',4,400,'NCBI_28');
ok($slice);
&write_feature();
ok(1);
($outf) = $slice->get_all_SimilarityFeatures_above_score(5);
#ok($outf);
sub write_feature {
$dna_f_ad = $db->get_DnaAlignFeatureAdaptor();
$feature1 = new Bio::EnsEMBL::SeqFeature();
$feature1->start(5);
$feature1->end (7);
$feature1->strand(1);
$feature1->score(10);
$feature1->seqname(1);
#$feature1->analysis($self->analysis);
$feature2 = new Bio::EnsEMBL::SeqFeature();
$feature2->start (105);
$feature2->end (107);
$feature2->strand (1);
$feature2->score (10);
$feature2->seqname("dummy-hid");
$fp = new Bio::EnsEMBL::FeaturePair(-feature1 => $feature1,
-feature2 => $feature2);
push(@feats,$fp);
$feature1 = new Bio::EnsEMBL::SeqFeature();
$feature1->start(10);
$feature1->end (14);
$feature1->strand(1);
$feature1->score(10);
$feature1->seqname(1);
#$feature1->analysis($self->analysis);
$feature2 = new Bio::EnsEMBL::SeqFeature();
$feature2->start (106);
$feature2->end (110);
$feature2->strand (1);
$feature2->score (10);
$feature2->seqname('dummy-hid');
$fp2 = new Bio::EnsEMBL::FeaturePair(-feature1 => $feature1,
-feature2 => $feature2);
push(@feats,$fp2);
$dnaf = Bio::EnsEMBL::DnaDnaAlignFeature->new( -features => \@feats );
$dnaf->seqname(1);
$dnaf->hseqname('dummy-hid');
$dnaf->analysis($db->get_AnalysisAdaptor->fetch_by_logic_name("dummy-blast"));
$dna_f_ad->store(1,$dnaf);
}