~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/SeqWords.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*-Perl-*-
2
 
## Bioperl Test Harness Script for Modules
3
 
## $Id: SeqWords.t,v 1.1 2003/11/12 17:14:09 heikki Exp $
4
 
 
5
 
## SeqWords.t, based on SeqStats.t
6
 
# Derek Gatherer, 11th November 2003
7
 
 
8
 
use strict;
9
 
BEGIN {
10
 
    # to handle systems with no installed Test module
11
 
    # we include the t dir (where a copy of Test.pm is located)
12
 
    # as a fallback
13
 
    eval { require Test; };
14
 
    if( $@ ) { use lib 't'; }
15
 
    use Test;
16
 
    plan tests => 16;
17
 
}
18
 
 
19
 
use Bio::PrimarySeq;
20
 
use Bio::Tools::SeqWords;
21
 
use vars ('$DEBUG');
22
 
 
23
 
ok 1;
24
 
 
25
 
my ($seqobj, $count, $seqobj_stats, $wt);
26
 
 
27
 
$seqobj = Bio::PrimarySeq->new(-seq=>'ACTGTGGCGTCAACTGACTGGC',
28
 
                               -alphabet=>'dna', -id=>'test');
29
 
$seqobj_stats  =  Bio::Tools::SeqWords->new(-seq=>$seqobj);
30
 
 
31
 
ok defined($seqobj_stats) && ref($seqobj_stats) &&
32
 
    $seqobj_stats->isa('Bio::Tools::SeqWords');
33
 
 
34
 
$count = $seqobj_stats->count_words(4);
35
 
ok $count->{'ACTG'}, 3;
36
 
ok $count->{'TGGC'}, 1;
37
 
ok $count->{'GTCA'}, 1;
38
 
 
39
 
$count = $seqobj_stats->count_overlap_words(4);
40
 
ok $count->{'ACTG'}, 3;
41
 
ok $count->{'TGGC'}, 2;
42
 
ok $count->{'GTCA'}, 1;
43
 
ok $count->{'GTGG'}, 1;
44
 
 
45
 
# now test a protein
46
 
$seqobj = Bio::PrimarySeq->new(-seq=>'MQSERGITIDISLWKFETSKYYVTIDISSLWKF',
47
 
                               -alphabet=>'protein', -id=>'test');
48
 
$seqobj_stats  =  Bio::Tools::SeqWords->new('-seq' => $seqobj);
49
 
ok defined($seqobj_stats) && ref($seqobj_stats) &&
50
 
    $seqobj_stats->isa('Bio::Tools::SeqWords');
51
 
 
52
 
$count = $seqobj_stats->count_words(4);
53
 
ok $count->{'MQSE'}, 1;
54
 
ok $count->{'LWKF'}, 1;
55
 
ok $count->{'IDIS'}, 2;
56
 
 
57
 
$count = $seqobj_stats->count_overlap_words(4);
58
 
ok $count->{'MQSE'}, 1;
59
 
ok $count->{'LWKF'}, 2;
60
 
ok $count->{'IDIS'}, 2;