[Bioperl-l] Trying to get a mysql DB from genbank flat files

Heikki Lehvaslaiho heikki@ebi.ac.uk
Tue, 27 Nov 2001 16:52:44 +0000


Elia Stupka wrote:
> 
> > quote
> > $sql = $dbh->quote($string);
> > This method escapes special characters (quotation marks, etc.) from strings
> > and adds the required outer quotation marks. May not be able to handle all
> > types of input (i.e binary data).
> 
> Excellent, thank you guys for all the suggestions!
> 
> Elia

I ran into this same problem today trying to use bioperl-db.
An immunoglobulin sequence entry (D87009) has ' characters in keywords...


I think I came up with a clean solution to this. I added quote() as a
shortcut into Bio::DB::SQL::BaseAdaptor and added line
	$kw = $self->quote($kw);
into Bio::DB::SeqAdaptor.

I did the same for the description lines because I know that they sometimes
contain "prime" and other funny characters.

	-Heikki

-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki@ebi.ac.uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________