protdist works for me on phylip 3.61
[bioperl-run.git] / t / Promoterwise.t
blobc6ba28345c5f92b99ea34cf2960a229ac07798f4
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 = 8;
14 plan tests => $NTESTS;
16 use Bio::Tools::Run::Promoterwise;
17 use Bio::Root::IO;
18 use Bio::Seq;
20 END {
21 for ( $Test::ntest..$NTESTS ) {
22 skip("promoterwise 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::Promoterwise->new(@params);
30 ok $factory->isa('Bio::Tools::Run::Promoterwise');
31 unless ($factory->executable) {
32 warn("Promoterwise 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 sim4_cdna.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 sim4_genomic.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 @fp = $factory->run($seq1, $seq2);
53 my $first = $fp[0]->feature1;
54 my $second = $fp[0]->feature2;
56 my @sub = $first->sub_SeqFeature;
57 my @sub2 = $second->sub_SeqFeature;
59 ok $sub[0]->start,4;
60 ok $sub2[0]->start,29;
61 ok $sub[0]->end,18;
62 ok $sub2[0]->end,43;
63 ok $sub[0]->seq->seq,'GTTGTGCTGGGGGGG';
64 ok $sub[0]->score,1596.49;