File: IO.t

package info (click to toggle)
bioperl 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 40,768 kB
  • ctags: 12,005
  • sloc: perl: 174,299; xml: 13,923; sh: 1,941; lisp: 1,803; asm: 109; makefile: 53
file content (71 lines) | stat: -rw-r--r-- 1,686 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*-Perl-*- Test Harness script for Bioperl
# $Id: IO.t 15112 2008-12-08 18:12:38Z sendu $


use strict;

BEGIN {
    use lib '.';
    use Bio::Root::Test;
    
    test_begin(-tests => 18);
	
    use_ok('Bio::Restriction::IO');
}

#
# default enz set
#
ok my $in  = Bio::Restriction::IO->new();
ok my $renzs = $in->read;
is $renzs->each_enzyme, 532;

ok my $e = $renzs->get_enzyme('AccI');
is $e->name, 'AccI';

my $outfile = test_output_file();
ok my $out = Bio::Restriction::IO->new(-format => 'base', -file => ">$outfile");
TODO: {
    local $TODO = "writing to a file doesn't seem to work? prints to STDOUT!";
    #$out->write($renzs);
    ok -s $outfile;
    #map {print $_->name, "\t", $_->site, "\t", $_->overhang, "\n"} $renzs->each_enzyme;
}

#
# withrefm, 31
#

ok $in  = Bio::Restriction::IO->new
  (-format=> 'withrefm',
	-verbose => 0,
	-file => test_input_file('rebase.withrefm'));
ok $renzs = $in->read;
is $renzs->each_enzyme, 11;

#
# itype2, 8
#
#enzyme name [tab] prototype [tab] recognition sequence with cleavage site
#  [tab] methylation site and type [tab] commercial source [tab] references

ok $in  = Bio::Restriction::IO->new
    (-format=> 'itype2', -verbose => 0,
     -file => test_input_file('rebase.itype2'));

ok $renzs = $in->read;
is $renzs->each_enzyme, 16;

ok  $out  = Bio::Restriction::IO->new(-format=>'base');

SKIP: {
   test_skip(-tests => 3, -requires_networking => 1);
   #test_skip(-tests => 2, -requires_module => 'LWP::UserAgent');
    
    ok  $in  = Bio::Restriction::IO->new(-format=>'prototype',
                                          -current => 1);
    
    ok my $coll = $in->read;
    cmp_ok $coll->each_enzyme, '>=', 307;
}