Sync'ed RichSeqI with the implementation. RichSeq provides backward
[bioperl-live.git] / t / StructIO.t
blobbdc38a16610695e3817dd8a932d2b05f631cf8c8
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 ## $Id$
5 # Before `make install' is performed this script should be runnable with
6 # `make test'. After `make install' it should work as `perl test.t'
8 use strict;
10 BEGIN { 
11     # to handle systems with no installed Test module
12     # we include the t dir (where a copy of Test.pm is located)
13     # as a fallback
14     eval { require Test; };
15     if( $@ ) { 
16         use lib 't';
17     }
18     use Test;
19     plan tests => 9;
21 use Bio::Structure::Entry;
22 use Bio::Structure::IO;
23 use Bio::Root::IO;
24 ok(1);
26 # testing PDB format
28 my $pdb_file = Bio::Root::IO->catfile("t","data","pdb1bpt.ent"); # BPTI
29 my $structio = Bio::Structure::IO->new(-file => $pdb_file, -format => 'PDB');
30 ok(1);
31 my $struc = $structio->next_structure;
32 ok(1);
33 ok(ref($struc), "Bio::Structure::Entry");
35 # some basic checks, Structure objects are tested in Structure.t
36 my ($chain) = $struc->chain;
37 ok($struc->residue, 97);
38 my ($atom) = $struc->get_atom_by_serial(367);
39 ok($atom->id, "NZ");
40 ok($struc->parent($atom)->id, "LYS-46");
41 my ($ann) = $struc->annotation->get_Annotations("author");
42 ok($ann->as_text, "Value: D.HOUSSET,A.WLODAWER,F.TAO,J.FUCHS,C.WOODWARD              ");
44 my $pseq = $struc->seqres;
45 ok($pseq->subseq(1,20), "RPDFCLEPPYTGPCKARIIR");