[Bioperl-l] problems with $enzyme->site(); for enzyme NlaIII or TspRI

Jason Stajich jason@cgt.mc.duke.edu
Mon, 28 Oct 2002 12:12:18 -0500 (EST)


Fixed in CVS now.

Small bug in the code for cutsites which occur after the specified site
as in the ChaI, TaiI, TscI, etc.

This patch should take care of your problem:

[jason@sonogno core]$ cvs diff Bio/Tools/RestrictionEnzyme.pm
Index: Bio/Tools/RestrictionEnzyme.pm
===================================================================
RCS file:
/home/repository/bioperl/bioperl-live/Bio/Tools/RestrictionEnzyme.pm,v
retrieving revision 1.24
diff -r1.24 RestrictionEnzyme.pm
898c898,902
<         return $seq->subseq(1,
$self->cuts_after).'^'.$seq->subseq($self->cuts_after+1, $seq->length);
---
>       if( $cuts_after >= $seq->length) {
>           return $seq->seq.'^';
>       } else {
>           return $seq->subseq(1,
$self->cuts_after).'^'.$seq->subseq($self->cuts_after+1, $seq->length);
>       }


On Mon, 28 Oct 2002, felipe wettstein wrote:

> doing $enzyme->site(); for the enzymes NlaIII or TspRI stops my program
> with the following error:
>
> ------------- EXCEPTION  -------------
> MSG: in subseq, start [5] has to be greater than end [4]
> STACK Bio::PrimarySeq::subseq /Library/Perl/Bio/PrimarySeq.pm:336
> STACK Bio::Tools::RestrictionEnzyme::site
> /Library/Perl/Bio/Tools/RestrictionEnzyme.pm:510
> STACK toplevel ./restritest.pl:17
>
> --------------------------------------
>
> i use perl 5.8, mac os x.
>
> the following program fails with 'NlaIII' or 'TspRI', but not when i
> uncomment the line with 'next if...'. does anybody have an idea whats
> going wrong? i mean, it is not exxxtreeeemly important to know, but
> maybe it would help. thanks a lot.
>
>
> felipe wettstein
>
> ------------------------------------------------------------------------
> -------
>
>
> #!/usr/bin/perl -w
> use Bio::Tools::RestrictionEnzyme;
> use Bio::PrimarySeq;
>
> $enzyme = Bio::Tools::RestrictionEnzyme->new(-name=>'EcoRI');
> @enz_list=$enzyme->available_list();
>
> $i=0;
> foreach $enzyme (@enz_list) {
> 	$enz_list[$i] = Bio::Tools::RestrictionEnzyme->new(-name=>$enzyme);
> 	print "\n";
> 	print $enz_list[$i]->name();
> 	print "\t";
> 	print $enz_list[$i]->string();
> #	next if ($enz_list[$i]->name()eq 'NlaIII')||($enz_list[$i]->name()eq
> 'TspRI');
> 	print "\t";
> 	print $enz_list[$i]->site();
> 	$i++;
> }
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

-- 
Jason Stajich
Duke University
jason at cgt.mc.duke.edu