1
# $Id: prototype.pm 14572 2008-02-29 05:52:03Z cjfields $
3
# BioPerl module for Bio::Restriction::IO::prototype
5
# Cared for by Chris Fields
7
# Copyright Chris Fields
9
# You may distribute this module under the same terms as perl itself
11
# POD documentation - main docs before the code
15
Bio::Restriction::IO::prototype - prototype enzyme set
19
Do not use this module directly. Use it via the Bio::Restriction::IO class.
23
This is a parser for the proto/neo file REBASE format, which contains
24
prototype information as well as (in the neo file) neoschizomer data.
30
User feedback is an integral part of the evolution of this and other
31
Bioperl modules. Send your comments and suggestions preferably to the
32
Bioperl mailing lists Your participation is much appreciated.
34
bioperl-l@bioperl.org - General discussion
35
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39
Report bugs to the Bioperl bug tracking system to help us keep track
40
the bugs and their resolution. Bug reports can be submitted via the
43
http://bugzilla.open-bio.org/
47
Rob Edwards, redwards@utmem.edu
51
Heikki Lehvaslaiho, heikki-at-bioperl-dot-org
55
The rest of the documentation details each of the object
56
methods. Internal methods are usually preceded with a _
60
# Let the code begin...
62
package Bio::Restriction::IO::prototype;
64
use vars qw(%WITH_REFM_FIELD);
67
#use Bio::Restriction::IO;
68
use Bio::Restriction::Enzyme;
69
use Bio::Restriction::EnzymeCollection;
73
use base qw(Bio::Restriction::IO::base);
78
Usage : $renzs = $stream->read
79
Function: reads all the restrction enzymes from the stream
80
Returns : a Bio::Restriction::Restriction object
87
my $coll = Bio::Restriction::EnzymeCollection->new(-empty => 1);
88
my ($seentop, $last_type);
89
while (defined (my $line = $self->_readline)) {
92
if ($line =~ /TYPE\s+(I)+/) {
98
my @data = split /\s+/,$line,2;
99
next if $data[0] =~ /^[-\s]*$/;
101
my ($enzyme, $is_neo, $is_proto, $site);
102
if ($data[0] =~ /^\s+(\S+)\s+(\S+)/) {
103
($enzyme, $site, $is_proto, $is_neo) = ($1, $2, 0, 1);
105
($enzyme, $site, $is_proto, $is_neo) = ($data[0], $data[1], 1, 0);
110
if ($site =~ m/^\((\d+\/\d+)\)[RYATGCN]+/) {
112
$site =~ s/\($precut\)//;
115
my ($cut, $comp_cut);
116
($site, $cut, $comp_cut) = $self->_cuts_from_site($site);
118
my $re = Bio::Restriction::Enzyme->new(
122
-is_prototype => $is_proto,
123
-is_neoschizomer => $is_neo);
126
$re->cut($self->_coordinate_shift_to_cut(length($site), $cut));
127
$re->complementary_cut($self->_coordinate_shift_to_cut(length($site), $comp_cut));
131
return $coll->enzymes;
137
Usage : $stream->write($renzs)
138
Function: writes restriction enzymes into the stream
139
Returns : 1 for success and 0 for error
140
Args : a Bio::Restriction::Enzyme
141
or a Bio::Restriction::EnzymeCollection object
147
$self->throw_not_implemented;