~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/Tools/SiRNA.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-*- Test Harness script for Bioperl
 
2
# $Id: SiRNA.t 15112 2008-12-08 18:12:38Z sendu $
 
3
 
 
4
use strict;
 
5
 
 
6
BEGIN {
 
7
    use lib '.';
 
8
    use Bio::Root::Test;
 
9
    
 
10
    test_begin(-tests => 11);
 
11
        
 
12
        use_ok('Bio::Tools::SiRNA');
 
13
        use_ok('Bio::Seq');
 
14
        use_ok('Bio::SeqIO');
 
15
}
 
16
 
 
17
my $DEBUG = test_debug();
 
18
 
 
19
my $input = Bio::SeqIO->new( -file      => test_input_file('NM_002254.gb'),
 
20
                             -format    => 'Genbank' );
 
21
my $seq = $input->next_seq;
 
22
 
 
23
isa_ok( $input, 'Bio::SeqIO' ) ;
 
24
 
 
25
 
 
26
#object creation
 
27
my $sirna = Bio::Tools::SiRNA->new( -target     => $seq,
 
28
                                     );
 
29
isa_ok( $sirna, 'Bio::Tools::SiRNA' ) ;
 
30
 
 
31
# first test - cds only
 
32
my @pairs = $sirna->design;
 
33
is ( scalar(@pairs), 65, "CDS only: got ". scalar(@pairs) );
 
34
 
 
35
 
 
36
# next test - include 3prime utr
 
37
my @feats = $seq->remove_SeqFeatures;
 
38
foreach my $feat (@feats) {
 
39
    $seq->add_SeqFeature($feat) unless
 
40
        ($feat->primary_tag eq 'Target' or $feat->isa('Bio::SeqFeature::SiRNA::Pair'));
 
41
}
 
42
ok( $sirna->include_3pr(1) ) ;
 
43
@pairs = $sirna->design;
 
44
print "With 3p UTR: got ",scalar(@pairs),"\n" if $DEBUG;
 
45
is( scalar(@pairs), 140 );
 
46
 
 
47
 
 
48
#third test - naked sequence
 
49
my $newseq = Bio::Seq->new( -seq => $seq->seq);
 
50
isa_ok($newseq, 'Bio::Seq') ;
 
51
 
 
52
ok( $sirna->target($newseq) );
 
53
@pairs = $sirna->design;
 
54
print "Bare sequence: got ",scalar(@pairs),"\n" if $DEBUG;
 
55
is ( scalar(@pairs),  142 ) ;