1
# -*-Perl-*- Test Harness script for Bioperl
2
# $Id: epost.t 15112 2008-12-08 18:12:38Z sendu $
11
test_begin(-tests => 58,
12
-requires_module => 'XML::Simple');
14
use_ok('Bio::Tools::EUtilities');
15
use_ok('Bio::Tools::EUtilities::EUtilParameters');
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(
22
-file => test_input_file('eutils','elink_scores.xml'));
24
isa_ok($eutil, 'Bio::Tools::EUtilities::Link');
25
is(join(',',$eutil->get_databases), 'protein');
27
# for elinks, IDs are globbed together when called from the parser unless a database is specified
28
is(join(',',$eutil->get_ids), '15622530,15921743,70607303,68567951,145702933,'.
29
'146304683,6015889,13813749,15897502,15622530,74573864,15921743', 'get_ids');
30
my @ls = $eutil->get_LinkSets;
31
is(scalar(@ls), 2, 'uncorrelated LinkSets lump everything together');
32
is(join(',',$ls[1]->get_databases), 'protein');
33
isa_ok($ls[0], 'Bio::Tools::EUtilities::EUtilDataI');
34
isa_ok($ls[0], 'Bio::Tools::EUtilities::Link::LinkSet');
36
# check data in LinkSets
37
is(join(',',$ls[0]->get_ids), '15622530,15921743,70607303,68567951,145702933,'.
38
'146304683,6015889,13813749,15897502');
39
is(join(',',$ls[0]->get_databases), 'protein');
40
is(join(',',$ls[0]->get_submitted_ids), '15622530');
41
is($ls[0]->get_dbfrom, 'protein');
42
is(join(',',$ls[0]->get_link_names), 'protein_protein');
43
is($ls[0]->has_linkout, 0);
44
is($ls[0]->has_neighbor, 0);
46
# has relatedness scores!
47
is($ls[0]->has_scores, 1);
50
15622530 => 2147483647,
60
my %sc = $ls[0]->get_scores;
61
for my $id ($ls[0]->get_ids) {
63
is($sc{$id}, $sd{$id});
69
my @info = $ls[0]->get_LinkInfo;
73
my @urls = $ls[0]->get_UrlLinks;
76
is(join(',',$ls[1]->get_ids), '15622530,74573864,15921743');
77
is(join(',',$ls[1]->get_databases), 'protein');
78
is(join(',',$ls[1]->get_submitted_ids), '15622530');
79
is(join(',',$ls[1]->get_link_names), 'protein_protein_identical');
80
is($ls[1]->get_webenv, undef);
81
is($ls[1]->get_dbfrom, 'protein');
82
is($ls[1]->has_linkout, 0);
83
is($ls[1]->has_neighbor, 0);
85
# has relatedness scores!
86
is($ls[1]->has_scores, 1);
89
15622530 => 2147483647,
94
%sc = $ls[1]->get_scores;
95
for my $id ($ls[1]->get_ids) {
97
is($sc{$id}, $sd{$id});
104
is($ls[1]->get_webenv, undef);
105
is($ls[1]->get_query_key, undef);
108
@info = $ls[1]->get_LinkInfo;
109
is(scalar(@info), 0);
112
@urls = $ls[1]->get_UrlLinks;
113
is(scalar(@urls), 0);