2 # BioPerl module for Bio::Restriction::IO::prototype
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Chris Fields
8 # Copyright Chris Fields
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Restriction::IO::prototype - prototype enzyme set
20 Do not use this module directly. Use it via the Bio::Restriction::IO class.
24 This is a parser for the proto/neo file REBASE format, which contains
25 prototype information as well as (in the neo file) neoschizomer data.
31 User feedback is an integral part of the evolution of this and other
32 Bioperl modules. Send your comments and suggestions preferably to the
33 Bioperl mailing lists Your participation is much appreciated.
35 bioperl-l@bioperl.org - General discussion
36 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
40 Please direct usage questions or support issues to the mailing list:
42 I<bioperl-l@bioperl.org>
44 rather than to the module maintainer directly. Many experienced and
45 reponsive experts will be able look at the problem and quickly
46 address it. Please include a thorough description of the problem
47 with code and data examples if at all possible.
51 Report bugs to the Bioperl bug tracking system to help us keep track
52 the bugs and their resolution. Bug reports can be submitted via the
55 https://github.com/bioperl/bioperl-live/issues
59 Rob Edwards, redwards@utmem.edu
63 Heikki Lehvaslaiho, heikki-at-bioperl-dot-org
67 The rest of the documentation details each of the object
68 methods. Internal methods are usually preceded with a _
72 # Let the code begin...
74 package Bio
::Restriction
::IO
::prototype;
76 use vars
qw(%WITH_REFM_FIELD);
79 use Bio::Restriction::Enzyme;
80 use Bio::Restriction::EnzymeCollection;
84 use base qw(Bio::Restriction::IO::base);
89 Usage : $renzs = $stream->read
90 Function: reads all the restrction enzymes from the stream
91 Returns : a Bio::Restriction::Restriction object
98 my $coll = Bio
::Restriction
::EnzymeCollection
->new(-empty
=> 1);
99 my ($seentop, $last_type);
100 while (defined (my $line = $self->_readline)) {
103 if ($line =~ /TYPE\s+(I)+/) {
108 next unless $seentop;
109 my @data = split /\s+/,$line,2;
110 next if $data[0] =~ /^[-\s]*$/;
112 my ($enzyme, $is_neo, $is_proto, $site);
113 if ($data[0] =~ /^\s+(\S+)\s+(\S+)/) {
114 ($enzyme, $site, $is_proto, $is_neo) = ($1, $2, 0, 1);
116 ($enzyme, $site, $is_proto, $is_neo) = ($data[0], $data[1], 1, 0);
121 if ($site =~ m/^\((\d+\/\d
+)\
)[RYATGCN
]+/) {
123 $site =~ s/\($precut\)//;
126 my ($cut, $comp_cut);
127 ($site, $cut, $comp_cut) = $self->_cuts_from_site($site);
129 my $re = Bio
::Restriction
::Enzyme
->new(
133 -is_prototype
=> $is_proto,
134 -is_neoschizomer
=> $is_neo);
137 $re->cut($self->_coordinate_shift_to_cut(length($site), $cut));
138 $re->complementary_cut($self->_coordinate_shift_to_cut(length($site), $comp_cut));
142 return $coll->enzymes;
148 Usage : $stream->write($renzs)
149 Function: writes restriction enzymes into the stream
150 Returns : 1 for success and 0 for error
151 Args : a Bio::Restriction::Enzyme
152 or a Bio::Restriction::EnzymeCollection object
158 $self->throw_not_implemented;