[Bioperl-l] "feature" in Bio::Restriction::Analysis

James Thompson tex at biocompute.net
Wed Dec 22 00:49:21 EST 2004


I just fixed this in CVS, do a cvs up to get it and verify that it works as it
should. The 1.5 release is right around the corner, and this will probably be

If you find any more bugs, feel free to report them either to the mailing
list and our bug tracking software (http://bugzilla.bioperl.org). Using
bugzilla provides a good amount of documentation for problems like this.

Thanks for the fix. :)


James Thompson

On Wed, 22 Dec 2004, Andrew Nunberg wrote:

> Sorry if this has been posted before.
> I am using Bioperl 1.4 from cvs
> If Bio::Restriction::Analysis->cutters returns the entire enzyme collection
> if does not find any enzymes that cut.
> I tried the following code:
> my $seq = Bio::PrimarySeq->new(-seq=>'ggacgaggttttcctcctgtt');
> my $ra = Bio::Restriction::Analysis->new(-seq=>$seq);
> print "max cutter is ",$ra->max_cuts,"\n";
> my $cutters = $ra->cutters;
> for my $enz ($cutters->each_enzyme){
>     print join("\t",($enz->name,$enz->string,$ra->seq->seq)),"\n";
> }
> The result was that every enzyme was printed out in the default collection
> used in the analysis, even those that
> Could not possibly be in the sequence.
> Looking at the code I discovered the problem
> >From the cutters subroutine in Bio::Restriction::Analysis-
> By default, no args passed to cutters, then  $start=1
> However this line of code appears after this assignment
> $start = $self->{'maximum_cuts'} if $start > $self->{'maximum_cuts'};
> If there are 0 maximum_cuts then $start is then set to 0, meaning that the
> cutters subroutine will look for enzymes that cut 0 or more times.
> I inserted this line right after the collection object is made but before
> The searchis done for enzymes that cut.  This apparently fixes the problem
>  my $set = new Bio::Restriction::EnzymeCollection(-empty => 1);
> -->    #return an empty set if nothing cut
> -->    return $set unless $self->{'maximum_cuts'};

More information about the Bioperl-l mailing list