1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
##
# $Id: Tools.t,v 1.7 2001/04/30 15:12:33 jason Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'
use strict;
BEGIN {
# to handle systems with no installed Test module
# we include the t dir (where a copy of Test.pm is located)
# as a fallback
eval { require Test; };
if( $@ ) {
use lib 't';
}
use Test;
plan tests => 8;
}
use Bio::SeqIO;
use Bio::Tools::SeqWords;
use Bio::Tools::SeqStats;
use Bio::Root::IO;
ok(1);
my $str = Bio::SeqIO->new(-file=> Bio::Root::IO->catfile("t","data","multifa.seq"), '-format' => 'Fasta');
my $seqobj= $str->next_seq();
ok $seqobj;
my $words = Bio::Tools::SeqWords->new('-seq' => $seqobj);
my $hash = $words->count_words(6);
ok ($words);
ok ($hash);
my $seq_stats = Bio::Tools::SeqStats->new('-seq' => $seqobj);
ok $seq_stats;
my $hash_ref = $seq_stats->count_monomers(); # eg for DNA sequence
ok ( $hash_ref->{'A'}, 80 );
$hash_ref = $seq_stats-> count_codons();
ok $hash_ref;
my $weight = $seq_stats->get_mol_wt();
ok $weight;
|