protdist works for me on phylip 3.61
[bioperl-run.git] / t / Genewise.t
blobdd04901e171c131c940cbaeed77c08123931ff16
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 = 18;
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 = $ENV{BIOPERLDEBUG} ? 1 : -1;
28 my @params = ('-verbose' => $verbose,
29 'silent' => 1,
30 'quiet' => 1);
32 my $factory = Bio::Tools::Run::Genewise->new(@params);
33 my $version = $factory->version;
34 warn("version is $version\n") if $verbose > 0;
35 ok $factory->isa('Bio::Tools::Run::Genewise');
36 unless ($factory->executable) {
37 warn("Genewise program not found. Skipping tests $Test::ntest to $NTESTS.\n");
38 exit 0;
41 my $bequiet = 1;
42 $factory->quiet($bequiet); # Suppress pseudowise messages to terminal
44 #test with one file with 2 sequences
45 my $inputfilename = Bio::Root::IO->catfile(qw(t data road.pep));
46 my $seqstream1 = Bio::SeqIO->new(-file => $inputfilename,
47 -format => 'fasta');
48 my $seq1 = Bio::Seq->new();
49 $seq1 = $seqstream1->next_seq();
51 $inputfilename = Bio::Root::IO->catfile(qw(t data human.genomic));
52 my $seqstream2 = Bio::SeqIO->new(-file => $inputfilename,
53 -format => 'fasta');
54 my $seq2 = Bio::Seq->new();
55 $seq2 = $seqstream2->next_seq();
57 my ($genes) = $factory->predict_genes($seq1, $seq2);
59 my @transcripts = $genes->transcripts;
60 my @feat = $transcripts[0]->exons;
61 my $seqid = $feat[0]->seq_id;
62 ok($seqid, 'HSHNRNPA');
63 my ($featpair)= $feat[0]->each_tag_value('supporting_feature');
64 ok($featpair->feature2->seq_id,'roa1_drome');
65 ok($featpair->feature1->seq_id,'HSHNRNPA');
66 if( defined $version && $version eq 'wise2-2-0' ) {
67 ok($transcripts[0]->start, 1386);
68 ok($transcripts[0]->end, 3963);
69 ok($feat[0]->start, 1386);
70 ok($feat[0]->end, 1493);
71 ok($feat[0]->strand,1);
72 ok($featpair->feature2->start,26);
73 ok($featpair->feature2->end,61);
74 ok($featpair->feature2->strand,1);
75 ok($featpair->feature2->score,'253.10');
76 ok($featpair->feature1->start,1386);
77 ok($featpair->feature1->end,1493);
78 ok($featpair->feature1->strand,1);
79 ok($featpair->feature1->score,'253.10');
80 } else {
81 warn("These tests may fail because I'm not sure about your genewise version -- using wise 2.2.3-rc7 values\n");
82 ok($transcripts[0]->start, 1386);
83 ok($transcripts[0]->end, 4304);
85 ok($feat[0]->start, 1386);
86 ok($feat[0]->end, 1493);
87 ok($feat[0]->strand,1);
88 ok($featpair->feature2->start,26);
89 ok($featpair->feature2->end,61);
90 ok($featpair->feature2->strand,1);
91 ok($featpair->feature2->score,'319.10');
92 ok($featpair->feature1->start,1386);
93 ok($featpair->feature1->end,1493);
94 ok($featpair->feature1->strand,1);
95 ok($featpair->feature1->score,'319.10');