more, better tests for the new implementation for tree/bootstrap -- still some things...
[bioperl-run.git] / t / Hmmpfam.t
blobe145901a04a14fe5d631030ecfbdecfb29de029e
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 = 8;
14 plan tests => $NTESTS;
17 END {
18 foreach ( $Test::ntest..$NTESTS ) {
19 skip('Unable to run Prints tests, exe may not be installed',1);
22 ok(1);
23 use Bio::Tools::Run::Hmmpfam;
24 use Bio::Root::IO;
25 use Bio::SeqIO;
26 use Bio::Seq;
28 my $db = Bio::Root::IO->catfile("t","data","pfam_sample_R11");
29 my @params = ('DB'=>$db,'E'=>5);
32 my $factory = Bio::Tools::Run::Hmmpfam->new(@params);
33 ok $factory->isa('Bio::Tools::Run::Hmmpfam');
34 ok $factory->E, 5;
35 my $prot_file= Bio::Root::IO->catfile("t","data","hmmpfam_protein_input");
37 my $seq1 = Bio::Seq->new();
38 my $seqstream = Bio::SeqIO->new(-file => $prot_file, -fmt => 'Fasta');
39 $seq1 = $seqstream->next_seq();
41 my $hmmpfam_present = $factory->executable();
43 unless ($hmmpfam_present) {
44 warn("hmmpfam program not found. Skipping tests $Test::ntest to $NTESTS.\n");
45 exit 0;
48 my $searchio = $factory->predict_protein_features($seq1);
50 my @feat;
51 while (my $result = $searchio->next_result){
52 while(my $hit = $result->next_hit){
53 while (my $hsp = $hit->next_hsp){
54 push @feat, $hsp;
59 ok $feat[0]->isa('Bio::SeqFeatureI');
60 ok ($feat[0]->feature1->start,25);
61 ok ($feat[0]->feature1->end,92);
62 ok ($feat[0]->feature2->start,1);
63 ok ($feat[0]->feature2->end,124);
65 1;