[Bioperl-guts-l] bioperl-run/t Kalign.t,NONE,1.1

Albert Vilella avilella at dev.open-bio.org
Sat Sep 2 08:31:57 EDT 2006


Update of /home/repository/bioperl/bioperl-run/t
In directory dev.open-bio.org:/tmp/cvs-serv14587

Added Files:
	Kalign.t 
Log Message:
simple test taken from Amap.t -- avg 42


--- NEW FILE: Kalign.t ---
# -*-Perl-*-
## Bioperl Test Harness Script for Modules

use strict;
use vars qw($NUMTESTS);
BEGIN { 
    eval { require Test; };
    if( $@ ) {
	use lib 't';
    }
    use Test;

    $NUMTESTS = 6; 
    plan tests => $NUMTESTS; 
}

END { unlink qw(cysprot.dnd cysprot1a.dnd) }

use Bio::Tools::Run::Alignment::Kalign;
use Bio::AlignIO;
use Bio::SeqIO;
use Bio::Root::IO;

END {     
    for ( $Test::ntest..$NUMTESTS ) {
	skip("Kalign program not found. Skipping.\n",1);
    }
}

ok(1);

my @params = ();
my $factory = Bio::Tools::Run::Alignment::Kalign->new(@params);
my $inputfilename = Bio::Root::IO->catfile("t","data","cysprot.fa");
my $aln;

my $present = $factory->executable();
unless ($present && -e $present	) {
    warn "amap program not found. Skipping tests $Test::ntest to $NUMTESTS.\n";
    exit(0);
}
my $version = $factory->version;
ok ($version >= 2, 1, "Code tested only on kalign versions >= 2" );
$aln = $factory->align($inputfilename);
ok($aln);
ok( $aln->no_sequences, 7);

my $str = Bio::SeqIO->new('-file' => 
			  Bio::Root::IO->catfile("t","data","cysprot.fa"), 
			  '-format' => 'Fasta');
my @seq_array =();

while ( my $seq = $str->next_seq() ) {
    push (@seq_array, $seq) ;
}

my $seq_array_ref = \@seq_array;

$aln = $factory->align($seq_array_ref);
ok $aln->no_sequences, 7;
my $s1_perid = $aln->average_percentage_identity;
ok(int($s1_perid), 42);



More information about the Bioperl-guts-l mailing list