[Bioperl-l] recursion limit reached for a gbk file

Dave Messina David.Messina at sbc.su.se
Thu Jun 10 19:56:21 UTC 2010


On Jun 10, 2010, at 9:54 PM, Gopal wrote:

> Hi Dave,
> 
> thanks for the tip. I saw that and  others too. 
> 
> In "Beginning Perl for Bioinformatics", such a sub routine that I posted earlier was used for parsing out features etc. of genbank file (chapter 10).
> That does not work well, at least with me, when large genbank files with multiple records are used.  
> 
> Meanwhile, by avoiding the problem of regex for long strings in a while loop and by parsing information by differently by reducing the 
> length of the string, I have fixed the problem.  The trick was to avoid the hash as that required all of the long string to be stored  in $value.
> 
> thanks anyway,
> 
> best
> 
> -gopal
> 
> On Thu, Jun 10, 2010 at 3:39 PM, Dave Messina <David.Messina at sbc.su.se> wrote:
> Hi Gopal,
> 
> This is not a BioPerl question, so this list is really not the place for it.
> 
> However, here's the first Google hit on your error message, which provides a solution:
> 
>        http://www.perlmonks.org/?node_id=810857
> 
> The short answer is that it's sort of a bug in Perl which is fixed in Perl version 5.12.
> 
> Also, this is probably not a good approach for long strings. What is this technique being used for in "Beginning Perl for Bioinformatics"?
> 
> 
> Dave
> 
> 
> 
> On Jun 10, 2010, at 6:24 PM, Gopal wrote:
> 
> > Hi,
> >
> > I get a  error message "Complex regular subexpression recursion limit
> > (32766) exceeded " when I try to parse CDS from a microbial genbank file.
> > Apparently  recursion limit is universal and that means,
> > others have somehow overcome this problem.
> >
> > The subroutine that triggers this error is pasted below:
> >
> > (based on "Beginning perl for Bioinformatics"  as I am trying to adapt an
> > example in that book for my work)
> >
> >
> > $fh = open_file($library);
> >
> > $offset = tell($fh);
> >
> > while( $record = get_next_record($fh) ) {
> >
> > my $locus=( );
> >
> > ($annotation, $dna) = get_annotation_and_dna($record);
> >
> > $offset = tell($fh);
> >
> >
> >
> >  # Extract the fields of the annotation
> > %fields = parse_annotation($annotation);
> >
> >
> > Sub-routine that triggers the error message:
> >
> >
> > sub parse_annotation {
> >
> >    my($annotation) = @_;
> >    my(%results) = (  );
> >
> >    while( $annotation =~ /^[A-Z].*\n(^\s.*\n)*/gm ) {
> >        my $value = $&;
> >        (my $key = $value) =~ s/^([A-Z]+).*/$1/s;
> >        $results{$key} = $value;
> >    }
> >
> >    return %results;
> > }
> >
> > thanks,
> >
> > -gopal
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> 
> 
> 





More information about the Bioperl-l mailing list