1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 49,
11 -requires_modules => [qw(XML::SAX XML::SAX::Writer)]);
13 use_ok('Bio::SeqIO::tigrxml');
16 my $verbose = test_debug();
18 my $ast = Bio::SeqIO->new(-format => 'tigrxml' ,
20 -file => test_input_file('test.tigrxml'));
21 isa_ok($ast, 'Bio::SeqIO');
22 $ast->verbose($verbose);
23 ok my $as = $ast->next_seq();
24 is($as->display_id, 'chr9');
27 for my $f ( sort { $a->start * $a->strand <=> $b->start * $b->strand } $as->get_SeqFeatures ) {
31 for my $tag ( qw(Parent ID) ) {
32 if( $f->has_tag($tag) ) {
33 ($name) = $f->get_tag_values($tag);
37 if( $name eq '162.t00500' || $name eq '162.m02638' ) {
38 if( $f->primary_tag eq 'gene' ) {
39 is($f->start, 185408);
41 # warn($f->gff_string, "\n");
42 } elsif( $f->primary_tag eq 'mRNA' ) {
43 is($f->start, 185408); # the values list for COORD are start/end of CDS not whole transcript
46 } elsif( $f->primary_tag eq "five_prime_UTR" ) {
47 my ($id) = $f->get_tag_values('ID');
48 if( $id =~ /UTR1$/ ) {
49 is($f->start, 185408);
51 } elsif( $id =~ /UTR2$/ ) {
52 is($f->start, 185487);
55 ok(0, 'expected only two UTRS');
57 } elsif( $f->primary_tag eq "three_prime_UTR" ) {
58 is($f->start, 187042);
60 } elsif( $f->primary_tag eq 'CDS' ) {
61 is($f->start, 185794);
64 } elsif ( $name eq '162.t00448' || $name eq '162.m02967' ) {
65 if( $f->primary_tag eq 'gene' ) {
68 } elsif( $f->primary_tag eq 'mRNA' ) {
69 is($f->start, 59343); # the values list for COORD are start/end of CDS not whole transcript
72 } elsif( $f->primary_tag eq "five_prime_UTR" ) {
73 my ($id) = $f->get_tag_values('ID');
77 } elsif( $f->primary_tag eq "three_prime_UTR" ) {
81 } elsif( $f->primary_tag eq 'CDS' ) {
90 ok(0, "unexpected name '$name'\n");