File: RestrictionEnzyme.t

package info (click to toggle)
bioperl 1.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 20,336 kB
  • ctags: 8,476
  • sloc: perl: 119,890; xml: 6,001; lisp: 121; makefile: 57
file content (50 lines) | stat: -rw-r--r-- 1,229 bytes parent folder | download
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
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: RestrictionEnzyme.t,v 1.7 2002/08/31 06:15:04 sac Exp $

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 test => 14 }

use Bio::Tools::RestrictionEnzyme;
use Bio::Seq;

ok(1);

# pre declare 6cutters to prevent warnings

my (@sixcutters,$seq,$dna,$l1,$l2,@fragments,$re);

$dna = 'CCTCCGGGGACTGCCGTGCCGGGCGGGAATTCGCCATGGCGACCCTGGAAAAGCTGATGAAGGCCTTCGA';

# Build sequence and restriction enzyme objects.
ok defined( $seq = new Bio::Seq(-ID  =>'test_seq',
			     -SEQ =>$dna)); 

ok $seq->id();
ok $re  = new Bio::Tools::RestrictionEnzyme(-NAME=>'EcoRI');
ok $re->seq->id;
ok $re->site;
ok $re->palindromic;
ok scalar(@fragments = $re->cut_seq($seq)), 2, "can't cut sequence";
ok scalar @fragments, 2;

ok $l1 = length $fragments[0], 27;
ok $l2 = length $fragments[1], 43;
ok $l1 + $l2, $seq->length, "sum of frag lengths != length of original seq\n";

ok @sixcutters = $re->available_list(6), 304, "can't get list of 6-cutters";
ok $re->is_available('HindIII');