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);
76 my($class, @args) = @_;
77 my $self = bless {}, $class;
78 $self->_initialize(@args);
85 $self->_rearrange([qw(
89 $self->verbose($verbose);
90 return unless $self->SUPER::_initialize
(@args);
96 Usage : $renzs = $stream->read
97 Function: reads all the restrction enzymes from the stream
98 Returns : a Bio::Restriction::Restriction object
105 my $coll = Bio
::Restriction
::EnzymeCollection
->new(-empty
=> 1);
106 my ($seentop, $last_type);
107 while (defined (my $line = $self->_readline)) {
110 if ($line =~ /TYPE\s+(I)+/) {
115 next unless $seentop;
116 my @data = split /\s+/,$line,2;
117 next if $data[0] =~ /^[-\s]*$/;
119 my ($enzyme, $is_neo, $is_proto, $site);
120 if ($data[0] =~ /^\s+(\S+)\s+(\S+)/) {
121 ($enzyme, $site, $is_proto, $is_neo) = ($1, $2, 0, 1);
123 ($enzyme, $site, $is_proto, $is_neo) = ($data[0], $data[1], 1, 0);
128 if ($site =~ m/^\((\d+\/\d
+)\
)[RYATGCN
]+/) {
130 $site =~ s/\($precut\)//;
133 my ($cut, $comp_cut);
134 ($site, $cut, $comp_cut) = $self->_cuts_from_site($site);
136 my $re = Bio
::Restriction
::Enzyme
->new(
140 -is_prototype
=> $is_proto,
141 -is_neoschizomer
=> $is_neo);
144 $re->cut($self->_coordinate_shift_to_cut(length($site), $cut));
145 $re->complementary_cut($self->_coordinate_shift_to_cut(length($site), $comp_cut));
150 return $coll->enzymes;
156 Usage : $stream->write($renzs)
157 Function: writes restriction enzymes into the stream
158 Returns : 1 for success and 0 for error
159 Args : a Bio::Restriction::Enzyme
160 or a Bio::Restriction::EnzymeCollection object
166 $self->throw_not_implemented;