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

« back to all changes in this revision

Viewing changes to t/SeqIO/interpro.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*- Test Harness script for Bioperl
 
2
# $Id: interpro.t 15112 2008-12-08 18:12:38Z sendu $
 
3
 
 
4
use strict;
 
5
 
 
6
BEGIN {
 
7
  use lib '.';
 
8
  use Bio::Root::Test;
 
9
  
 
10
  test_begin(-tests => 20,
 
11
                         -requires_module => 'XML::DOM::XPath');
 
12
  
 
13
  use_ok('Bio::SeqIO::interpro');
 
14
}
 
15
 
 
16
my $verbose = test_debug();
 
17
 
 
18
my $t_file = test_input_file('test.interpro');
 
19
my $a_in = Bio::SeqIO->new( -file => $t_file,
 
20
                                                        -verbose => $verbose,
 
21
                                                        -format => 'interpro');
 
22
isa_ok($a_in, 'Bio::SeqIO');
 
23
 
 
24
my $seq = $a_in->next_seq();
 
25
ok($seq, 'seq obj is defined');
 
26
isa_ok($seq, 'Bio::Seq::RichSeq');
 
27
is(scalar( $seq->get_SeqFeatures() ), 6, 'right number of SeqFeatures');
 
28
 
 
29
my($feat) = $seq->get_SeqFeatures();
 
30
isa_ok($feat,'Bio::SeqFeature::Generic');
 
31
 
 
32
is($feat->display_name,'Retinoblastoma-associated protein, B-box', 'display_name()');
 
33
 
 
34
ok($seq = $a_in->next_seq(), 'seq object is defined');
 
35
is(scalar( $seq->get_SeqFeatures() ),40, 'right number of SeqFeatures');
 
36
 
 
37
ok(!($seq = $a_in->next_seq()), 'there is no next_seq (correctly)');
 
38
 
 
39
# Bug 1908 (enhancement)
 
40
$t_file = test_input_file('interpro_ebi.xml');
 
41
my $b_in = Bio::SeqIO->new( -file => $t_file,
 
42
                                                                         -verbose => $verbose,
 
43
                                                                         -format => 'interpro');
 
44
$seq = $b_in->next_seq();
 
45
ok($seq, 'bug 1908');
 
46
 
 
47
my @features = $seq->get_SeqFeatures;
 
48
is(scalar @features, 2, 'right number of SeqFeatures');
 
49
is($features[0]->primary_tag, 'region', 'primary_tag()');
 
50
is($features[0]->display_name, 'Protein of unknown function DUF1021', 'display_name()');
 
51
is($features[0]->location->end, 78, 'location->end()');
 
52
 
 
53
my @dblinks = $features[0]->annotation->get_Annotations('dblink');
 
54
is(scalar @dblinks, 3, 'right number of dblinks');
 
55
is($dblinks[1]->primary_id, 'IPR009366', 'first primary_id');
 
56
is($dblinks[2]->primary_id, 'PF06257.1', 'second primary_id');
 
57
 
 
58
my $other_t_file = test_input_file('test.interpro-go.xml');
 
59
my $ipr_in = Bio::SeqIO->new( -file => $other_t_file,
 
60
                              -verbose => $verbose,
 
61
                              -format => 'interpro');
 
62
 
 
63
$seq = $ipr_in->next_seq();
 
64
@features = $seq->get_SeqFeatures;
 
65
@dblinks = $features[0]->annotation->get_Annotations('dblink');
 
66
is(scalar @dblinks, 4, 'right number of dblinks');
 
67
is($dblinks[3]->primary_id, 'GO:0003677', 'primary_id via dblinks');
 
68