Do not use this module directly. Use it via the Bio::Restriction::IO class.
This is tab delimited, entry per line format which is fast to process.
sub read
{ my $self = shift;
my $renzs = Bio::Restriction::EnzymeCollection->new(-empty => 1);
while (defined( my $line = $self->_readline()) ) {
next if $line =~ /^[ R]/;
$self->_pushback($line);
last;
}
while (defined(my $line = $self->_readline()) ) {
$self->debug($line);
chomp $line;
my ($name, $prototype, $site, $meth, $vendor, $refs) = split /\t/, $line;
unless ($site) {
$self->warn("Can not parse line with name [$name]") if $self->verbose > 0;
next;
}
next unless $name;
my ($precut, $recog, $postcut) = ( $site =~ m/^(?:\((\w+\/\w+)\))?([\w^]+)(?:\((\w+\/\w+)\))?/ );
my @sequences;
if ($site =~ /\,/) {
@sequences = split( /\,/, $site);
$site=shift @sequences;
}
my $is_prototype = ($prototype ? 1 : 0);
my @vendors;
@vendors = ( split / */, $vendor) if $vendor;
my @refs;
@refs = map {split /\n+/} $refs if $refs;
my $re = Bio::Restriction::Enzyme->new(
-name => $name,
-site => $recog,
-recog => $recog,
-precut => $precut,
-postcut => $postcut,
-is_prototype => $is_prototype,
-prototype => $prototype,
-vendors => [@vendors],
-references => [@refs],
-xln_sub =>\& _xln_sub
);
my @meths;
if ($meth) {
if ( $meth =~ /(\S+)\((\d+)\),(\S+)\((\d+)\)/ ) { $re->methylation_sites($self->_meth($re,$1, $2),
$self->_meth($re,$3,$4));
}
elsif ($meth =~ /(\S+)\((\d+)\)/ ) { $re->methylation_sites( $self->_meth($re,$1,$2) );
@meths = split (/, /, $meth);
$meth=shift @meths;
} else {
$self->warn("Unknown methylation format [$meth]") if $self->verbose >0;
}
}
$self->_make_multisites( $re,\@ sequences,\@ meths) if @sequences;
$renzs->enzymes($re);
}
return $renzs;} |
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/