tests pass, find the right nodes more explicitly
[bioperl-run.git] / t / Phrap.t
blobd46a6bf2f199a6ef7d51727ae069b52ddebdeb22
1 #!/usr/local/bin/perl
2 #-*-Perl-*-
3 # ## Bioperl Test Harness Script for Modules
4 # #
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 = 5;
14 plan tests => $NTESTS;
17 END {
18 foreach ( $Test::ntest..$NTESTS ) {
19 skip('Unable to run Phrap tests, exe may not be installed',1);
22 ok(1);
23 use Bio::Tools::Run::Phrap;
24 use Bio::Root::IO;
25 use Bio::SeqIO;
26 use Bio::AlignIO;
27 use Bio::Seq;
29 my $input = Bio::Root::IO->catfile("t","data","Phrap.fa");
30 my @params = (arguments=>'-penalty -3 -minmatch 15');
32 my $factory = Bio::Tools::Run::Phrap->new(@params);
33 ok $factory->isa('Bio::Tools::Run::Phrap');
34 ok $factory->arguments, '-penalty -3 -minmatch 15';
36 my $phrap_present = $factory->executable();
38 unless ($phrap_present) {
39 warn("Phrap program not found. Skipping tests $Test::ntest to $NTESTS.\n");
40 exit 0;
43 my $assembly = $factory->run($input);
45 foreach my $contig($assembly->all_contigs){
46 my $collection = $contig->get_features_collection;
47 my @sf = $collection->get_all_features;
48 ok $sf[0]->start,601;
49 ok $sf[0]->end,963;
53 1;