~ubuntu-branches/ubuntu/wily/bioperl-run/wily-proposed

« back to all changes in this revision

Viewing changes to t/Genewise.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-09-03 11:00:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090903110003-11of27rxner5vnl9
Tags: 1.6.1-1
* New upstream release.
* debian/patches/10-wrong-path-for-interpreter.patch: removed
  (fixed upstream).
* debian/watch updated (bioperl -> BioPerl).
* debian/rules refreshed with dh-make-perl 0.53.
  - Disabled installation of examples (removed upstream).
  - Removed the correction of file permission of Pise documentation
    (removed upstream).
  - Removed patching facilities (no patches anymore).
  - Disabled tests as I experience failures with t/Eponine.t despite
    this program is not installed.
* debian/copyright:
  - Removed vanity lines about debianization and debian copyright.
  - Incremented years to 2009.
  - Updated to latest experimentation of the machine-readable license summary.
* debian/control:
  - Incremented Standards-Version to reflect conformance on new Policy
    (dropped versionned build-dependancy on Perl).
  - Removed build-dependancy on quilt (no patches anymore).
  - Depend and Build-Depend on bioperl versions superior or equal to 1.6.0.
  - Build-depends on, and Recommdnes libalgorithm-diff-perl, libipc-run-perl,
    libio-string-perl and libxml-twig-perl, that are listed in DEPENDANCIES.
  - Build-depends on libarray-compare-perl and libtree-dagnode-perl
    (otherwise tests fail). 
  - Depend on amap-align instead of amap (Closes: #541274).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
use strict;
6
6
BEGIN {
7
 
    eval { require Test; };
8
 
    if( $@ ) {
9
 
        use lib 't';
10
 
    }
11
 
    use Test;
12
 
    use vars qw($NTESTS);
13
 
    $NTESTS = 18;
14
 
    plan tests => $NTESTS;
15
 
}
16
 
use Bio::Tools::Run::Genewise;
17
 
use Bio::Root::IO;
18
 
use Bio::Seq;
19
 
 
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);
23
 
    }
24
 
}
25
 
 
26
 
ok(1);
27
 
my $verbose = $ENV{BIOPERLDEBUG} ? 1 : -1;
 
7
    use Bio::Root::Test;
 
8
    test_begin(-tests => 20);
 
9
        use_ok('Bio::Tools::Run::Genewise');
 
10
        use_ok('Bio::Root::IO');
 
11
        use_ok('Bio::Seq');
 
12
}
 
13
 
 
14
my $verbose = test_debug() || -1;
28
15
my @params = ('-verbose' => $verbose, 
29
16
              'silent' => 1, 
30
17
              'quiet' => 1);
31
18
 
32
19
my $factory = Bio::Tools::Run::Genewise->new(@params);
33
20
 
34
 
unless ($factory->executable) {
35
 
   warn("Genewise program not found. Skipping tests $Test::ntest to $NTESTS.\n");
36
 
   exit 0;
37
 
}
38
 
 
39
 
my $version = $factory->version;
40
 
warn("version is $version\n") if $verbose > 0;
41
 
ok $factory->isa('Bio::Tools::Run::Genewise');
42
 
 
43
 
my $bequiet = 1;
44
 
$factory->quiet($bequiet);  # Suppress pseudowise messages to terminal
45
 
 
46
 
#test with one file with 2 sequences
47
 
my $inputfilename = Bio::Root::IO->catfile(qw(t data road.pep));
48
 
my $seqstream1 = Bio::SeqIO->new(-file => $inputfilename, 
49
 
                                 -format => 'fasta');
50
 
my $seq1 = Bio::Seq->new();
51
 
$seq1 = $seqstream1->next_seq();
52
 
 
53
 
$inputfilename = Bio::Root::IO->catfile(qw(t data human.genomic));
54
 
my $seqstream2 = Bio::SeqIO->new(-file => $inputfilename, 
55
 
                                 -format => 'fasta');
56
 
my $seq2 = Bio::Seq->new();
57
 
$seq2 = $seqstream2->next_seq();
58
 
 
59
 
my ($genes) = $factory->predict_genes($seq1, $seq2);
60
 
 
61
 
my @transcripts = $genes->transcripts;
62
 
my @feat = $transcripts[0]->exons;
63
 
my $seqid = $feat[0]->seq_id;
64
 
ok($seqid, 'HSHNRNPA');
65
 
my ($featpair)= $feat[0]->each_tag_value('supporting_feature');
66
 
ok($featpair->feature2->seq_id,'roa1_drome');
67
 
ok($featpair->feature1->seq_id,'HSHNRNPA');
68
 
if( defined $version && $version eq 'wise2-2-0' ) {
69
 
    ok($transcripts[0]->start, 1386);
70
 
    ok($transcripts[0]->end, 3963);
71
 
    ok($feat[0]->start, 1386);
72
 
    ok($feat[0]->end, 1493);
73
 
    ok($feat[0]->strand,1);
74
 
    ok($featpair->feature2->start,26);
75
 
    ok($featpair->feature2->end,61);
76
 
    ok($featpair->feature2->strand,1);
77
 
    ok($featpair->feature2->score,'253.10');
78
 
    ok($featpair->feature1->start,1386);
79
 
    ok($featpair->feature1->end,1493);
80
 
    ok($featpair->feature1->strand,1);
81
 
    ok($featpair->feature1->score,'253.10');
82
 
} else {
83
 
    warn("These tests may fail because I'm not sure about your genewise version -- using wise 2.2.3-rc7 values\n");
84
 
    ok($transcripts[0]->start, 1386);
85
 
    ok($transcripts[0]->end, 4304);
86
 
 
87
 
    ok($feat[0]->start, 1386);
88
 
    ok($feat[0]->end, 1493);
89
 
    ok($feat[0]->strand,1);
90
 
    ok($featpair->feature2->start,26);
91
 
    ok($featpair->feature2->end,61);
92
 
    ok($featpair->feature2->strand,1);
93
 
    ok($featpair->feature2->score,'319.10');
94
 
    ok($featpair->feature1->start,1386);
95
 
    ok($featpair->feature1->end,1493);
96
 
    ok($featpair->feature1->strand,1);
97
 
    ok($featpair->feature1->score,'319.10');
98
 
 
99
 
}
100
 
 
101
 
 
102
 
 
103
 
 
104
 
 
105
 
 
 
21
SKIP:{
 
22
        test_skip(-requires_executable => $factory, -tests => 17);
 
23
 
 
24
        my $version = $factory->version;
 
25
        warn("version is $version\n") if $verbose > 0;
 
26
        isa_ok $factory,'Bio::Tools::Run::Genewise';
 
27
        
 
28
        my $bequiet = 1;
 
29
        $factory->quiet($bequiet);  # Suppress pseudowise messages to terminal
 
30
        
 
31
        #test with one file with 2 sequences
 
32
        my $inputfilename = test_input_file('road.pep');
 
33
        my $seqstream1 = Bio::SeqIO->new(-file => $inputfilename, 
 
34
                                         -format => 'fasta');
 
35
        my $seq1 = Bio::Seq->new();
 
36
        $seq1 = $seqstream1->next_seq();
 
37
        
 
38
        $inputfilename = test_input_file('human.genomic');
 
39
        my $seqstream2 = Bio::SeqIO->new(-file => $inputfilename, 
 
40
                                         -format => 'fasta');
 
41
        my $seq2 = Bio::Seq->new();
 
42
        $seq2 = $seqstream2->next_seq();
 
43
        
 
44
        my ($genes) = $factory->predict_genes($seq1, $seq2);
 
45
        
 
46
        my @transcripts = $genes->transcripts;
 
47
        my @feat = $transcripts[0]->exons;
 
48
        my $seqid = $feat[0]->seq_id;
 
49
        is($seqid, 'HSHNRNPA');
 
50
        my ($featpair)= $feat[0]->each_tag_value('supporting_feature');
 
51
        is($featpair->feature2->seq_id,'roa1_drome');
 
52
        is($featpair->feature1->seq_id,'HSHNRNPA');
 
53
        if( defined $version && $version eq 'wise2-2-0' ) {
 
54
                is($transcripts[0]->start, 1386);
 
55
                is($transcripts[0]->end, 3963);
 
56
                is($feat[0]->start, 1386);
 
57
                is($feat[0]->end, 1493);
 
58
                is($feat[0]->strand,1);
 
59
                is($featpair->feature2->start,26);
 
60
                is($featpair->feature2->end,61);
 
61
                is($featpair->feature2->strand,1);
 
62
                is($featpair->feature2->score,'253.10');
 
63
                is($featpair->feature1->start,1386);
 
64
                is($featpair->feature1->end,1493);
 
65
                is($featpair->feature1->strand,1);
 
66
                is($featpair->feature1->score,'253.10');
 
67
        } else {
 
68
                warn("These tests may fail because I'm not sure about your genewise version -- using wise 2.2.3-rc7 values\n");
 
69
                is($transcripts[0]->start, 1386);
 
70
                is($transcripts[0]->end, 4304);
 
71
        
 
72
                is($feat[0]->start, 1386);
 
73
                is($feat[0]->end, 1493);
 
74
                is($feat[0]->strand,1);
 
75
                is($featpair->feature2->start,26);
 
76
                is($featpair->feature2->end,61);
 
77
                is($featpair->feature2->strand,1);
 
78
                is($featpair->feature2->score,'319.10');
 
79
                is($featpair->feature1->start,1386);
 
80
                is($featpair->feature1->end,1493);
 
81
                is($featpair->feature1->strand,1);
 
82
                is($featpair->feature1->score,'319.10');
 
83
        
 
84
        }
 
85
 
 
86
}
 
 
b'\\ No newline at end of file'