small fix: RNAMotif can have empty files (will add a better workaround later)
[bioperl-run.git] / t / Phrap.t
blobf19338c0995608ad4cb27e62ab96b3b5281e1adf
1 #!/usr/local/bin/perl
2 #-*-Perl-*-
3 # ## Bioperl Test Harness Script for Modules
4 # #
5 use strict;
6 my $DBEUG = $ENV{'BIOPERLDEBUG'} || 0;
7 BEGIN {
8 eval { require Test; };
9 if( $@ ) {
10 use lib 't';
12 use Test;
13 use vars qw($NTESTS);
14 $NTESTS = 5;
15 plan tests => $NTESTS;
18 END {
19 foreach ( $Test::ntest..$NTESTS ) {
20 skip('Unable to run Phrap tests, exe may not be installed',1);
23 ok(1);
24 use Bio::Tools::Run::Phrap;
25 use Bio::Root::IO;
26 use Bio::SeqIO;
27 use Bio::AlignIO;
28 use Bio::Seq;
30 my $input = Bio::Root::IO->catfile("t","data","Phrap.fa");
31 my @params = (-verbose => $DBEUG,
32 arguments=>'-penalty -3 -minmatch 15');
34 my $factory = Bio::Tools::Run::Phrap->new(@params);
35 ok $factory->isa('Bio::Tools::Run::Phrap');
36 ok $factory->arguments, '-penalty -3 -minmatch 15';
38 my $phrap_present = $factory->executable();
40 unless ($phrap_present) {
41 warn("Phrap program not found. Skipping tests $Test::ntest to $NTESTS.\n");
42 exit 0;
45 my $assembly = $factory->run($input);
47 foreach my $contig($assembly->all_contigs){
48 my $collection = $contig->get_features_collection;
49 my @sf = $collection->get_all_features;
51 ok $sf[1]->start, 601;
52 ok $sf[1]->end, 963;
56 1;