Do not use this module directly. Use it via the Bio::Restriction::IO class.
sub read
{ my $self = shift;
my $coll = Bio::Restriction::EnzymeCollection->new(-empty => 1);
my ($seentop, $last_type);
while (defined (my $line = $self->_readline)) {
chomp $line;
next unless $line;
if ($line =~ /TYPE\s+(I)+/) {
$last_type = $1;
$seentop ||= 1;
next;
}
next unless $seentop;
my @data = split /\s+/,$line,2;
next if $data[0] =~ /^[-\s]*$/;
my ($enzyme, $is_neo, $is_proto, $site);
if ($data[0] =~ /^\s+(\S+)\s+(\S+)/) {
($enzyme, $site, $is_proto, $is_neo) = ($1, $2, 0, 1);
} else {
($enzyme, $site, $is_proto, $is_neo) = ($data[0], $data[1], 1, 0);
}
$site =~ s/\s+//g;
my $precut;
if ($site =~ m/^\((\d+\/\d+)\)[RYATGCN]+/) { $precut=$1; $site =~ s/\($precut\)//;
}
my ($cut, $comp_cut);
($site, $cut, $comp_cut) = $self->_cuts_from_site($site);
my $re = Bio::Restriction::Enzyme->new(
-type => $last_type,
-site => $site,
-name => $enzyme,
-is_prototype => $is_proto,
-is_neoschizomer => $is_neo);
if ($cut) {
$re->cut($self->_coordinate_shift_to_cut(length($site), $cut));
$re->complementary_cut($self->_coordinate_shift_to_cut(length($site), $comp_cut));
}
$coll->enzymes($re);
}
return $coll->enzymes;} |
sub write
{ my ($self,@h) = @_;
$self->throw_not_implemented;
}
1;} |
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to the
Bioperl mailing lists Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via the
web:
https://redmine.open-bio.org/projects/bioperl/