Removing from HEAD (deprecated for 1.6)
[bioperl-live.git] / t / Restriction / IO.t
blobdb6f5bc91d7ae0e93ed4291f712ccb8717d5b281
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
5 use strict;
7 BEGIN {
8     use lib '.';
9     use Bio::Root::Test;
10     
11     test_begin(-tests => 18);
12         
13     use_ok('Bio::Restriction::IO');
17 # default enz set
19 ok my $in  = Bio::Restriction::IO->new();
20 ok my $renzs = $in->read;
21 is $renzs->each_enzyme, 532;
23 ok my $e = $renzs->get_enzyme('AccI');
24 is $e->name, 'AccI';
26 my $outfile = test_output_file();
27 ok my $out = Bio::Restriction::IO->new(-format => 'base', -file => ">$outfile");
28 TODO: {
29     local $TODO = "writing to a file doesn't seem to work? prints to STDOUT!";
30     #$out->write($renzs);
31     ok -s $outfile;
32     #map {print $_->name, "\t", $_->site, "\t", $_->overhang, "\n"} $renzs->each_enzyme;
36 # withrefm, 31
39 ok $in  = Bio::Restriction::IO->new
40   (-format=> 'withrefm',
41         -verbose => 0,
42         -file => test_input_file('rebase.withrefm'));
43 ok $renzs = $in->read;
44 is $renzs->each_enzyme, 11;
47 # itype2, 8
49 #enzyme name [tab] prototype [tab] recognition sequence with cleavage site
50 #  [tab] methylation site and type [tab] commercial source [tab] references
52 ok $in  = Bio::Restriction::IO->new
53     (-format=> 'itype2', -verbose => 0,
54      -file => test_input_file('rebase.itype2'));
56 ok $renzs = $in->read;
57 is $renzs->each_enzyme, 16;
59 ok  $out  = Bio::Restriction::IO->new(-format=>'base');
61 SKIP: {
62    test_skip(-tests => 3, -requires_networking => 1);
63    #test_skip(-tests => 2, -requires_module => 'LWP::UserAgent');
64     
65     ok  $in  = Bio::Restriction::IO->new(-format=>'prototype',
66                                           -current => 1);
67     
68     ok my $coll = $in->read;
69     cmp_ok $coll->each_enzyme, '>=', 307;