File: Genewise.t

package info (click to toggle)
bioperl 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 40,768 kB
  • ctags: 12,005
  • sloc: perl: 174,299; xml: 13,923; sh: 1,941; lisp: 1,803; asm: 109; makefile: 53
file content (70 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# -*-Perl-*- Test Harness script for Bioperl
# $Id: Genewise.t 11733 2007-10-26 18:22:10Z jason $

use strict;

BEGIN {
    use lib '.';
	use Bio::Root::Test;
	
	test_begin(-tests => 33);
	
    use_ok('Bio::Tools::Genewise');
}

my $inputfilename= test_input_file('genewise.out');
my $parser = Bio::Tools::Genewise->new(-file => $inputfilename);
my @gene;
while (my $gene= $parser->next_prediction){
    push @gene, $gene;
}
my @t = $gene[0]->transcripts;
my @e = $t[0]->exons;

is ($t[0]->seq_id, 'Scaffold_2042.1');
is ($e[0]->seq_id, 'Scaffold_2042.1');
is ($t[0]->source_tag, 'genewise');
is ($e[0]->source_tag, 'genewise');
is ($t[0]->primary_tag, 'transcript');
is ($e[0]->primary_tag, 'exon');

is (scalar($t[0]->exons), 18);
is ($t[0]->start, 22265);
is ($t[0]->end, 37062);
is ($e[0]->start,22265);
is ($e[0]->end, 22396);
my ($phase) = $e[0]->each_tag_value('phase');
is ($phase,0);
my ($sf)= $e[0]->each_tag_value('supporting_feature');
is ($sf->feature1->seq_id,'Scaffold_2042.1');
is ($sf->feature1->start,22265);
is ($sf->feature1->end,22396);
is ($sf->feature2->seq_id,'SINFRUP00000067802');
is ($sf->feature2->start,1);
is ($sf->feature2->end,44);
is ($sf->feature1->end,22396);

open(FH,$inputfilename);
$parser = Bio::Tools::Genewise->new(-fh=>\*FH);
while (my $gene= $parser->next_prediction){
    push @gene, $gene;
}
@t = $gene[0]->transcripts;
@e = $t[0]->exons;

is (scalar($t[0]->exons), 18);
is ($t[0]->start, 22265);
is ($t[0]->end, 37062);
is ($e[0]->start,22265);
is ($e[0]->end, 22396);
($phase) = $e[0]->each_tag_value('phase');
is ($phase,0);
($sf)= $e[0]->each_tag_value('supporting_feature');
is ($sf->feature1->seq_id,'Scaffold_2042.1');
is ($sf->feature1->start,22265);
is ($sf->feature1->end,22396);
is ($sf->feature2->seq_id,'SINFRUP00000067802');
is ($sf->feature2->start,1);
is ($sf->feature2->end,44);
is ($sf->feature1->end,22396);