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

« back to all changes in this revision

Viewing changes to t/largepseq.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: largepseq.t,v 1.9 2001/11/02 18:48:09 jason Exp $
4
 
 
5
 
# Before `make install' is performed this script should be runnable with
6
 
# `make test'. After `make install' it should work as `perl test.t'
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( $@ ) {
15
 
        use lib 't';
16
 
    }
17
 
    use Test;
18
 
    plan tests => 22;
19
 
}
20
 
use Bio::Seq::LargePrimarySeq;
21
 
use Bio::Seq::LargeSeq;
22
 
use Bio::Location::Simple;
23
 
use Bio::Location::Fuzzy;
24
 
use Bio::Location::Split;
25
 
 
26
 
my $pseq = Bio::Seq::LargePrimarySeq->new();
27
 
ok $pseq;
28
 
$pseq->add_sequence_as_string('ATGGGGTGGGGTGAAACCCTTTGGGGGTGGGGTAAAT');
29
 
$pseq->add_sequence_as_string('GTTTGGGGTTAAACCCCTTTGGGGGGT');
30
 
 
31
 
ok $pseq->display_id('hello'), 'hello';
32
 
 
33
 
ok $pseq->seq, 'ATGGGGTGGGGTGAAACCCTTTGGGGGTGGGGTAAATGTTTGGGGTTAAACCCCTTTGGGGGGT' , "Sequence is " . $pseq->seq;
34
 
 
35
 
ok $pseq->subseq(3,7), 'GGGGT', "Subseq is ".$pseq->subseq(3,7);
36
 
my $location = new Bio::Location::Simple(-start => 4, -end => 8,
37
 
                                         -strand => 1);
38
 
ok($pseq->subseq($location), 'GGGTG');
39
 
 
40
 
my $splitlocation = new Bio::Location::Split;
41
 
 
42
 
$splitlocation->add_sub_Location( new Bio::Location::Simple('-start' => 1,
43
 
                                                            '-end'   => 15,
44
 
                                                            '-strand' => 1));
45
 
 
46
 
$splitlocation->add_sub_Location( new Bio::Location::Simple('-start' => 21,
47
 
                                                            '-end'   => 27,
48
 
                                                            '-strand' => -1));
49
 
 
50
 
ok( $pseq->subseq($splitlocation), 'ATGGGGTGGGGTGAACCCCCAA');
51
 
 
52
 
my $fuzzy = new Bio::Location::Fuzzy(-start => '<10',
53
 
                                     -end   => '18',
54
 
                                     -strand => 1);
55
 
 
56
 
ok( $pseq->subseq($fuzzy), 'GGTGAAACC');
57
 
 
58
 
 
59
 
ok($pseq->trunc(8,15)->seq, 'GGGGTGAA', 
60
 
    'trunc seq was ' . $pseq->trunc(8,15)->seq);
61
 
 
62
 
 
63
 
ok $pseq->alphabet('dna'), 'dna'; # so translate will not complain
64
 
ok $pseq->translate()->seq, 'MGWGETLWGWGKCLGLNPFGG';
65
 
 
66
 
 
67
 
my $seq = new Bio::Seq::LargeSeq(-primaryseq => $pseq );
68
 
 
69
 
ok $seq->display_id('hello'), 'hello';
70
 
 
71
 
ok $seq->seq, 'ATGGGGTGGGGTGAAACCCTTTGGGGGTGGGGTAAATGTTTGGGGTTAAACCCCTTTGGGGGGT' , "Sequence is " . $seq->seq;
72
 
 
73
 
ok $seq->subseq(3,7), 'GGGGT', "Subseq is ".$seq->subseq(3,7);
74
 
ok ($seq->trunc(8,15)->seq, 'GGGGTGAA', 
75
 
    'trunc seq was ' . $seq->trunc(8,15)->seq);
76
 
 
77
 
ok $seq->alphabet('dna'), 'dna'; # so translate will not complain
78
 
ok $seq->translate()->seq, 'MGWGETLWGWGKCLGLNPFGG';
79
 
 
80
 
$seq = new Bio::Seq::LargeSeq( -display_id => 'hello');
81
 
$seq->seq('ATGGGGTGGGGT');
82
 
ok $seq->display_id, 'hello';
83
 
 
84
 
ok $seq->seq, 'ATGGGGTGGGGT' , "Sequence is " . $seq->seq;
85
 
 
86
 
ok $seq->subseq(3,7), 'GGGGT', "Subseq is ".$seq->subseq(3,7);
87
 
ok ($seq->trunc(8,12)->seq, 'GGGGT', 
88
 
    'trunc seq was ' . $seq->trunc(8,12)->seq);
89
 
 
90
 
ok $seq->alphabet('dna'), 'dna'; # so translate will not complain
91
 
ok $seq->translate()->seq, 'MGWG';