[Bioperl-l] Slow restriction digestion

Rob Edwards redwards at utmem.edu
Mon May 12 12:55:32 EDT 2003


Bio::Tools::RestrictionEnzyme uses split to find the sites, and this is slow 
because it is using a regexp. 

A much faster way is to use index to find the sequence, something like this 
should work

$pos=0;
while ($pos>-1) {
 $pos=index($seq, 'TTAA', $pos);
 print "$pos\n";
}

Rob

On Monday 12 May 2003 11:02 am, anthony.underwood at hpa.org.uk wrote:
> Hi All,
>
>
> I'm trying to list all the MseI sites (recognition site TTAA)  in a 4
> megabase genome, using the Bio::Tools::RestrictionEnzyme module.
> This works but takes a VERY long time. Is there a way of speeding this up?.
> I realise it maybe a perl string searching problem- since searching long
> strings in perl tends to be slow and when I've written perl code to do the
> same without Bio::Perl it is also very slow. Just wondered if there were
> any neat tricks?
>
>
> Thanks,
>
> Anthony
>
> Dr Anthony Underwood
> Bioinformatics Unit
> Central Public Health Laboratory
> Health Protection Agency
> 61 Colindale Avenue
> London
> NW9 5HT
> t:    0208 2004400 ext. 3618
> f:    0208 3583138
> e: anthony.underwood at hpa.org.uk
>
> **************************************************************************
> The information contained in the EMail and any attachments is
> confidential
> and intended solely and for the attention and use of the named
> addressee(s).
> It may not be disclosed to any other person without the express
> authority of
> the HPA, or the intended recipient, or both. If you are not the
> intended
> recipient, you must not disclose, copy, distribute or retain this
> message or
> any part of it.
>
> For information on how to send data to the HPA in encrypted form via
> E.Mail, visit www.HPA.org.uk.
>
> This footnote also confirms that this EMail has been swept for computer
> viruses, but please re-sweep any attachments before opening or saving.
>
> HTTP://www.HPA.org.uk
> **************************************************************************
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://pw600a.bioperl.org/mailman/listinfo/bioperl-l


More information about the Bioperl-l mailing list