[bug 2262]
[bioperl-live.git] / t / Tools_sim4.t
blobdbdc319b871ba5b24742e857fbc8a117fea94d67
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: Tools_sim4.t 11525 2007-06-27 10:16:38Z sendu $
4 use strict;
5 BEGIN {     
6     use lib 't/lib';
7     use BioperlTest;
8     
9     test_begin(-tests => 27);
10         
11         use_ok('Bio::Tools::Sim4::Results');
14 my $sim4 = Bio::Tools::Sim4::Results->new(-file=> test_input_file('sim4.rev'), -estisfirst=>0);
15 ok ( $sim4, 'new Sim4 results instance') ;
18 my $exonset = $sim4->next_exonset;
19 my @exons = $exonset->sub_SeqFeature(); 
21 is (scalar(@exons), 10);
23 my $exon = 1;
24 is $exons[$exon]->est_hit()->seq_id(), 'HSHNCPA1';
25 like($exons[$exon]->seq_id(), qr/human/);
26 is $exons[$exon]->strand(), -1;
27 is $exons[$exon]->start(), 1048;
28 is $exons[$exon]->end(), 1117;
29 is $exons[$exon]->score, 93;
30 is $exons[$exon]->est_hit()->seqlength(), 1198;
33 $sim4 = Bio::Tools::Sim4::Results->new(-file=> test_input_file('sim4.for.for'), -estisfirst=>0);
34 ok ( $sim4, 'new Sim4 results instance') ;
36 $exonset = $sim4->next_exonset;
37 @exons = $exonset->sub_SeqFeature(); 
39 is (scalar(@exons), 4);
41 $exon = 1;
42 is $exons[$exon]->est_hit()->seq_id(), 'hs_est';
43 is $exons[$exon]->seq_id(), 'human';
44 is $exons[$exon]->strand(), 1;
45 is $exons[$exon]->start(), 1377;
46 is $exons[$exon]->end(), 1500;
47 is $exons[$exon]->score, 99;
48 is $exons[$exon]->est_hit()->seqlength(), 479;
50 ok($sim4->next_exonset);
51 @exons = $exonset->sub_SeqFeature();
53 is $exons[$exon]->est_hit()->seq_id(), 'hs_est';
54 is $exons[$exon]->seq_id(), 'human';
55 is $exons[$exon]->strand(), 1;
56 is $exons[$exon]->est_hit->start(), 120;
57 is $exons[$exon]->est_hit->end(), 243;
58 is $exons[$exon]->score, 99;
59 is $exons[$exon]->est_hit()->seqlength(), 479;