1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 49,
10 -requires_modules => [qw(XML::SAX XML::SAX::Writer)]);
12 use_ok('Bio::SeqIO::tigrxml');
15 my $verbose = test_debug();
17 my $ast = Bio::SeqIO->new(-format => 'tigrxml' ,
19 -file => test_input_file('test.tigrxml'));
20 isa_ok($ast, 'Bio::SeqIO');
21 $ast->verbose($verbose);
22 ok my $as = $ast->next_seq();
23 is($as->display_id, 'chr9');
26 for my $f ( sort { $a->start * $a->strand <=> $b->start * $b->strand } $as->get_SeqFeatures ) {
30 for my $tag ( qw(Parent ID) ) {
31 if( $f->has_tag($tag) ) {
32 ($name) = $f->get_tag_values($tag);
36 if( $name eq '162.t00500' || $name eq '162.m02638' ) {
37 if( $f->primary_tag eq 'gene' ) {
38 is($f->start, 185408);
40 # warn($f->gff_string, "\n");
41 } elsif( $f->primary_tag eq 'mRNA' ) {
42 is($f->start, 185408); # the values list for COORD are start/end of CDS not whole transcript
45 } elsif( $f->primary_tag eq "five_prime_UTR" ) {
46 my ($id) = $f->get_tag_values('ID');
47 if( $id =~ /UTR1$/ ) {
48 is($f->start, 185408);
50 } elsif( $id =~ /UTR2$/ ) {
51 is($f->start, 185487);
54 ok(0, 'expected only two UTRS');
56 } elsif( $f->primary_tag eq "three_prime_UTR" ) {
57 is($f->start, 187042);
59 } elsif( $f->primary_tag eq 'CDS' ) {
60 is($f->start, 185794);
63 } elsif ( $name eq '162.t00448' || $name eq '162.m02967' ) {
64 if( $f->primary_tag eq 'gene' ) {
67 } elsif( $f->primary_tag eq 'mRNA' ) {
68 is($f->start, 59343); # the values list for COORD are start/end of CDS not whole transcript
71 } elsif( $f->primary_tag eq "five_prime_UTR" ) {
72 my ($id) = $f->get_tag_values('ID');
76 } elsif( $f->primary_tag eq "three_prime_UTR" ) {
80 } elsif( $f->primary_tag eq 'CDS' ) {
89 ok(0, "unexpected name '$name'\n");