Supply TEMPLATE and SUFFIX for temporary query sequence files.
[bioperl-run.git] / t / Pseudowise.t
blobc6e154f954536852c88d7bc2fcb4ec95080f34e8
1 # $Id$
2 # -*-Perl-*-
3 ## Bioperl Test Harness Script for Modules
5 use strict;
6 BEGIN {
7     use Bio::Root::Test;
8     test_begin(-tests => 18);
9         use_ok('Bio::Tools::Run::Pseudowise');
10         use_ok('Bio::Root::IO');
11         use_ok('Bio::Seq');
13 my $DEBUG = test_debug();
15 #my @params = ('dymem', 'linear', 'kbyte', '5000','erroroffstd'=>1);
16 my @params = ('erroroffstd'=>1,'-verbose' => $DEBUG, 
17               quiet => $DEBUG);
18 my  $factory = Bio::Tools::Run::Pseudowise->new(@params);
19 ok($factory);
21 SKIP:{
22         test_skip(-requires_executable => $factory,
23                           -tests => 14);
25         warn($factory->executable."\n") if $DEBUG; 
26         isa_ok $factory, 'Bio::Tools::Run::Pseudowise';
27         
28         #test with one file with 3 sequences
29         my $inputfilename = test_input_file("ps1.fa");
30         my $seqstream = Bio::SeqIO->new(-file   => $inputfilename, 
31                                         -format => 'fasta');
32         my $seq1 = $seqstream->next_seq();
33         my $seq2 = $seqstream->next_seq();
34         my $seq3 = $seqstream->next_seq();
36         my @feat = $factory->predict_genes($seq1, $seq2, $seq3);
37         my $geneno = scalar(@feat);
38         ok($geneno,1);
39         my @subfeat = $feat[0]->sub_SeqFeature;
40         my $exonno = scalar(@subfeat);
42         is($geneno, 1);
43         is($exonno, 2);
44         isa_ok($feat[0],"Bio::SeqFeatureI");
45         isa_ok($subfeat[0],"Bio::SeqFeatureI");
46         is($feat[0]->primary_tag, 'pseudogene');
47         is($subfeat[0]->primary_tag, 'exon');
48         is($feat[0]->start, 163);
49         is($subfeat[0]->start, 163);
50         is($feat[0]->end, 626);
51         is($subfeat[0]->end, 213);
52         is($subfeat[1]->start,585);
53         is($subfeat[1]->end, 626);