1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: Genewise.t 11733 2007-10-26 18:22:10Z jason $
10 test_begin(-tests => 33);
12 use_ok('Bio::Tools::Genewise');
15 my $inputfilename= test_input_file('genewise.out');
16 my $parser = Bio::Tools::Genewise->new(-file => $inputfilename);
18 while (my $gene= $parser->next_prediction){
21 my @t = $gene[0]->transcripts;
24 is ($t[0]->seq_id, 'Scaffold_2042.1');
25 is ($e[0]->seq_id, 'Scaffold_2042.1');
26 is ($t[0]->source_tag, 'genewise');
27 is ($e[0]->source_tag, 'genewise');
28 is ($t[0]->primary_tag, 'transcript');
29 is ($e[0]->primary_tag, 'exon');
31 is (scalar($t[0]->exons), 18);
32 is ($t[0]->start, 22265);
33 is ($t[0]->end, 37062);
34 is ($e[0]->start,22265);
35 is ($e[0]->end, 22396);
36 my ($phase) = $e[0]->get_tag_values('phase');
38 my ($sf)= $e[0]->get_tag_values('supporting_feature');
39 is ($sf->feature1->seq_id,'Scaffold_2042.1');
40 is ($sf->feature1->start,22265);
41 is ($sf->feature1->end,22396);
42 is ($sf->feature2->seq_id,'SINFRUP00000067802');
43 is ($sf->feature2->start,1);
44 is ($sf->feature2->end,44);
45 is ($sf->feature1->end,22396);
47 open my $FH, '<', $inputfilename or die "Could not read file '$inputfilename': $!\n";
48 $parser = Bio::Tools::Genewise->new(-fh => $FH);
49 while (my $gene = $parser->next_prediction){
52 @t = $gene[0]->transcripts;
55 is (scalar($t[0]->exons), 18);
56 is ($t[0]->start, 22265);
57 is ($t[0]->end, 37062);
58 is ($e[0]->start,22265);
59 is ($e[0]->end, 22396);
60 ($phase) = $e[0]->get_tag_values('phase');
62 ($sf)= $e[0]->get_tag_values('supporting_feature');
63 is ($sf->feature1->seq_id,'Scaffold_2042.1');
64 is ($sf->feature1->start,22265);
65 is ($sf->feature1->end,22396);
66 is ($sf->feature2->seq_id,'SINFRUP00000067802');
67 is ($sf->feature2->start,1);
68 is ($sf->feature2->end,44);
69 is ($sf->feature1->end,22396);