more, better tests for the new implementation for tree/bootstrap -- still some things...
[bioperl-run.git] / t / Genewise.t
blob7e901d0ee0c00c10fe352b005622623d92f27b1a
1 #!/usr/local/bin/perl
2 # -*-Perl-*-
3 ## Bioperl Test Harness Script for Modules
5 use strict;
6 BEGIN {
7 eval { require Test; };
8 if( $@ ) {
9 use lib 't';
11 use Test;
12 use vars qw($NTESTS);
13 $NTESTS = 13;
14 plan tests => $NTESTS;
16 use Bio::Tools::Run::Genewise;
17 use Bio::Root::IO;
18 use Bio::Seq;
20 END {
21 for ( $Test::ntest..$NTESTS ) {
22 skip("genewise program not found. Skipping. (Be sure you have the wise package > 2.2.0)",1);
26 ok(1);
27 my $verbose = -1;
28 my @params = ('-verbose' => $verbose, 'silent' => 1, 'quiet' => 1);
29 my $factory = Bio::Tools::Run::Genewise->new(@params);
30 ok $factory->isa('Bio::Tools::Run::Genewise');
31 unless ($factory->executable) {
32 warn("Genewise program not found. Skipping tests $Test::ntest to $NTESTS.\n");
33 exit 0;
36 my $bequiet = 1;
37 $factory->quiet($bequiet); # Suppress pseudowise messages to terminal
39 #test with one file with 2 sequences
40 my $inputfilename = Bio::Root::IO->catfile(qw(t data new_pep.fa));
41 my $seqstream1 = Bio::SeqIO->new(-file => $inputfilename,
42 -format => 'fasta');
43 my $seq1 = Bio::Seq->new();
44 $seq1 = $seqstream1->next_seq();
46 $inputfilename = Bio::Root::IO->catfile(qw(t data new_dna.fa));
47 my $seqstream2 = Bio::SeqIO->new(-file => $inputfilename,
48 -format => 'fasta');
49 my $seq2 = Bio::Seq->new();
50 $seq2 = $seqstream2->next_seq();
52 my ($genes) = $factory->predict_genes($seq1, $seq2);
54 my @transcripts = $genes->transcripts;
55 my @feat = $transcripts[0]->exons;
56 my $seqid = $feat[0]->seq_id;
57 my $start = $feat[0]->start;
58 ok($start, 865);#ok3
59 my $end = $feat[0]->end;
60 ok($end, 897);#ok4
61 my $strand = $feat[0]->strand;
62 ok($strand, 1);#ok5
64 my ($featpair)= $feat[0]->each_tag_value('supporting_feature');
65 ok($featpair->feature1->start,865);
66 ok($featpair->feature1->end,897);
67 ok($featpair->feature1->strand,1);
68 ok($featpair->feature1->score,17.01);
69 ok($featpair->feature2->start,120);
70 ok($featpair->feature2->end,130);
71 ok($featpair->feature2->strand,1);
72 ok($featpair->feature2->score,17.01);