[Bioperl-l] bioperl-db: posqgresql adaptor
Hilmar Lapp
hlapp@gnf.org
Thu, 28 Nov 2002 17:57:23 -0800
It will work so long as the input doesn't specify things which are
already in the database and which the adaptors don't cache. By
default, only taxa, namespaces, ontology terms, and dbxrefs are
cached. Therefore, a reference that exists already will make the
whole entry fail. You can enable caching for references by
$radp = $db->get_object_adaptor("Bio::Annotation::Reference");
$radp->caching_mode(1);
before any entry is loaded. (adaptor instances are cached, hence
every subsequent call to obtain an adaptor for references will
return the instance you just manipulated - which is what you want)
Associations are generally not cached. Most associations are ranked,
however, so as long as you only insert and don't update you should
be fine for those. Unfortunately, dbxref associations are not
ranked, so if the same dbxref occurs twice in the entry (believe it
or not, swissprot and some others have this once in a while), that
entry will fail.
So, for inserts most things will work if you enable caching for
references or your input doesn't have references. Those entries with
redundant dbxrefs will fail to load, but shouldn't bail out the
script (supply --safe; the failure will cause a rollback for that
entry which terminates the transaction - after that Pg should be
happy again. I haven't tested this though.). Updating deserialized
entries should be fine, too (those will immediately result in an
UPDATE). Loading the same entry twice (second time from an updated
datasource) will fail with Pg at this time (however, you could
provide --remove to load_seqdatabase.pl - that should work too).
-hilmar
On Monday, November 25, 2002, at 04:09 AM, AUnderwood@PHLS.org.uk wrote:
>
> Also do I understand correctly from your later postings that the
> problems
> with the postgres database adaptor mean that the load_seqdatabase
> script
> won't work for the time being?
>
>
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------