~ubuntu-branches/ubuntu/trusty/bioperl/trusty

« back to all changes in this revision

Viewing changes to t/Tools/EUtilities/elink_llinks.t

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2013-09-22 13:39:48 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20130922133948-c6z62zegjyp7ztou
Tags: 1.6.922-1
* New upstream release.
* Replaces and Breaks grinder (<< 0.5.3-3~) because of overlaping contents.
  Closes: #722910
* Stop Replacing and Breaking bioperl ( << 1.6.9 ): not needed anymore. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*-Perl-*- Test Harness script for Bioperl
2
 
# $Id: elink_llinks.t 15112 2008-12-08 18:12:38Z sendu $
3
 
 
4
 
use strict;
5
 
use warnings;
6
 
 
7
 
BEGIN {
8
 
    use lib '.';
9
 
        use Bio::Root::Test;
10
 
        
11
 
        test_begin(-tests => 86,
12
 
                           -requires_module => 'XML::Simple');
13
 
        
14
 
    use_ok('Bio::Tools::EUtilities');
15
 
    use_ok('Bio::Tools::EUtilities::EUtilParameters');
16
 
}
17
 
 
18
 
# check -correspondence => 0 (default) - this is set up to return the
19
 
# exact same thing as correspondece = 1, tested below)
20
 
my $eutil = Bio::Tools::EUtilities->new(
21
 
    -eutil      => 'elink',
22
 
    -file       => test_input_file('eutils','elink_llinks.xml'));
23
 
 
24
 
isa_ok($eutil, 'Bio::Tools::EUtilities::Link');
25
 
is(join(',',$eutil->get_databases), '');
26
 
 
27
 
# for elinks, IDs are globbed together when called from the parser unless a database is specified
28
 
is(join(',',$eutil->get_ids), '730439,68536103,1621261,20807972', 'get_ids');
29
 
my @ls = $eutil->get_LinkSets;
30
 
is(scalar(@ls), 4, 'uncorrelated LinkSets lump everything together');
31
 
is(join(',',$ls[1]->get_databases), '');
32
 
isa_ok($ls[0], 'Bio::Tools::EUtilities::EUtilDataI');
33
 
isa_ok($ls[0], 'Bio::Tools::EUtilities::Link::LinkSet');
34
 
 
35
 
# check data in LinkSets
36
 
is(join(',',$ls[0]->get_ids), '730439');
37
 
is(join(',',$ls[0]->get_databases), '');
38
 
is(join(',',$ls[0]->get_submitted_ids), '730439');
39
 
is($ls[0]->get_dbfrom, 'protein');
40
 
is(join(',',$ls[0]->get_link_names), '');
41
 
is($ls[0]->has_scores, 0);
42
 
is($ls[0]->has_linkout, 0);
43
 
is($ls[0]->has_neighbor, 0);
44
 
 
45
 
# HistoryI
46
 
is($ls[0]->get_webenv, undef);
47
 
is($ls[0]->get_query_key, undef);
48
 
 
49
 
# no LinkInfo
50
 
my @info = $ls[0]->get_LinkInfo;
51
 
is(scalar(@info), 0);
52
 
 
53
 
# has UrlLink!
54
 
my @urls = $ls[0]->get_UrlLinks;
55
 
is(scalar(@urls), 1);
56
 
 
57
 
is($urls[0]->get_dbfrom, 'protein');
58
 
is($urls[0]->get_attribute, 'registration required');
59
 
is($urls[0]->get_icon_url, 'http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--salilab.org-modbase-img-modbase.jpg');
60
 
is($urls[0]->get_subject_type, 'structure');
61
 
is($urls[0]->get_url, 'http://salilab.org/modbase/search?databaseID=730439');
62
 
is($urls[0]->get_link_name, undef);
63
 
is($urls[0]->get_provider_name, 'MODBASE, Database of Comparative Protein Structure Models (Sali Lab/UCSF)');
64
 
is($urls[0]->get_provider_abbr, 'modbase');
65
 
is($urls[0]->get_provider_id, 5447);
66
 
is($urls[0]->get_provider_url, 'http://salilab.org/modbase');
67
 
is($urls[0]->get_provider_icon_url, 'http://salilab.org/modbase/img/modbase.jpg');
68
 
 
69
 
# Another LinkSet...
70
 
is(join(',',$ls[1]->get_ids), '68536103');
71
 
is(join(',',$ls[1]->get_databases), '');
72
 
is(join(',',$ls[1]->get_submitted_ids), '68536103');
73
 
is(join(',',$ls[1]->get_link_names), '');
74
 
is($ls[1]->get_dbfrom, 'protein');
75
 
is($ls[1]->has_scores, 0);
76
 
is($ls[1]->has_linkout, 0);
77
 
is($ls[1]->has_neighbor, 0);
78
 
 
79
 
# no LinkInfo
80
 
@info = $ls[1]->get_LinkInfo;
81
 
is(scalar(@info), 0);
82
 
 
83
 
# no UrlLinks
84
 
@urls = $ls[1]->get_UrlLinks;
85
 
is(scalar(@urls), 0);
86
 
 
87
 
# HistoryI
88
 
is($ls[1]->get_webenv, undef);
89
 
is($ls[1]->get_query_key, undef);
90
 
 
91
 
# check -correspondence => 1
92
 
$eutil = Bio::Tools::EUtilities->new(
93
 
    -eutil      => 'elink',
94
 
    -file       => test_input_file('eutils','elink_llinks_corr.xml'));
95
 
 
96
 
isa_ok($eutil, 'Bio::Tools::EUtilities::Link');
97
 
is(join(',',$eutil->get_databases), '');
98
 
 
99
 
# for elinks, IDs are globbed together when called from the parser unless a database is specified
100
 
is(join(',',$eutil->get_ids), '1621261,68536103,20807972,730439', 'get_ids');
101
 
@ls = $eutil->get_LinkSets;
102
 
is(scalar(@ls), 4, 'correlated LinkSets separate ID data');
103
 
is(join(',',$ls[1]->get_databases), '');
104
 
isa_ok($ls[0], 'Bio::Tools::EUtilities::EUtilDataI');
105
 
isa_ok($ls[0], 'Bio::Tools::EUtilities::Link::LinkSet');
106
 
 
107
 
# check data in LinkSets
108
 
is(join(',',$ls[0]->get_ids), '1621261');
109
 
is(join(',',$ls[0]->get_databases), '');
110
 
is(join(',',$ls[0]->get_submitted_ids), '1621261');
111
 
is(join(',',$ls[0]->get_link_names), '');
112
 
is($ls[0]->get_dbfrom, 'protein');
113
 
is($ls[0]->has_scores, 0);
114
 
is($ls[0]->has_linkout, 0);
115
 
is($ls[0]->has_neighbor, 0);
116
 
 
117
 
# HistoryI
118
 
is($ls[0]->get_webenv, undef);
119
 
is($ls[0]->get_query_key, undef);
120
 
 
121
 
# no LinkInfo
122
 
@info = $ls[0]->get_LinkInfo;
123
 
is(scalar(@info), 0);
124
 
 
125
 
# has UrlLink!
126
 
@urls = $ls[0]->get_UrlLinks;
127
 
is(scalar(@urls), 1);
128
 
 
129
 
is($urls[0]->get_dbfrom, 'protein');
130
 
is($urls[0]->get_attribute, 'registration required');
131
 
is($urls[0]->get_icon_url, 'http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--salilab.org-modbase-img-modbase.jpg');
132
 
is($urls[0]->get_subject_type, 'structure');
133
 
is($urls[0]->get_url, 'http://salilab.org/modbase/search?databaseID=1621261');
134
 
is($urls[0]->get_link_name, undef);
135
 
is($urls[0]->get_provider_name, 'MODBASE, Database of Comparative Protein Structure Models (Sali Lab/UCSF)');
136
 
is($urls[0]->get_provider_abbr, 'modbase');
137
 
is($urls[0]->get_provider_id, 5447);
138
 
is($urls[0]->get_provider_url, 'http://salilab.org/modbase');
139
 
is($urls[0]->get_provider_icon_url, 'http://salilab.org/modbase/img/modbase.jpg');
140
 
 
141
 
# another LinkSet
142
 
is(join(',',$ls[1]->get_ids), '68536103');
143
 
is(join(',',$ls[1]->get_databases), '');
144
 
is(join(',',$ls[1]->get_submitted_ids), '68536103');
145
 
is($ls[1]->get_dbfrom, 'protein');
146
 
is(join(',',$ls[1]->get_link_names), '');
147
 
is($ls[1]->has_scores, 0);
148
 
is($ls[1]->has_linkout, 0);
149
 
is($ls[1]->has_neighbor, 0);
150
 
 
151
 
# no LinkInfo
152
 
@info = $ls[1]->get_LinkInfo;
153
 
is(scalar(@info), 0);
154
 
 
155
 
# no UrlLink
156
 
@urls = $ls[1]->get_UrlLinks;
157
 
is(scalar(@urls), 0);
158
 
 
159
 
# HistoryI
160
 
is($ls[1]->get_webenv, undef);
161
 
is($ls[1]->get_query_key, undef);
 
 
b'\\ No newline at end of file'