public interface SequenceDBInstallation
A SequenceDBInstallation has the functionality of a factory for SequenceDB objects and additionally manages the SequenceDB objects created by itself such that the minimum number of SequenceDB objects is created by a particular SequenceDBInstallation object.
The idea behind this interface is that sequence databases are usually installed in groups. E.g., there might be a directory which contains FASTA-formated sequence files for EMBL and SwissProt; or there might be an SRS-installation that provides access to GenBank and SwissProt; or there might be a relational database that can be queried for GenBank, PIR and SwissProt entries. These 3 cases would be represented through 3 distinct SequenceDBInstallation objects. Each of these objects can be queried for the set of SequenceDB objects it supports, or a particular SequenceDB object can be retrieved from a SequenceDBInstallation object through a string identifier. All SequenceDB objects that belong to a particular SequenceDBInstallation share the same way of retrieving sequences and will hence be constructed and configured in a very similar fashion - which is the primary reason for inventing the SequenceDBInstallation object which can act as a factory for SequenceDB objects.
A SequenceDBInstallation object also manages the SequenceDB objects it has created so that requests for the same database (say SwissProt) will always return the same SequenceDB object. This becomes particularly important when SequenceDB objects allow the modification (create/update/delete of Sequence entries) of the underlying sequence database and this sequence "database" is not transactional in itself (such as a FASTA file). Because in this case the SequenceDB object must act as a transactional front-end to the sequence database and there should really be only one SequenceDB object for each sequence database - which is ensured by SequenceDBInstallation.
Modifier and Type | Method and Description |
---|---|
void |
addSequenceDB(SequenceDBLite sequenceDB,
Set otherIdentifiers)
addSequenceDB adds a new SequenceDB
under its own identifier which will additionally be recognised
by the set of other identifiers. |
SequenceDBLite |
getSequenceDB(String identifier)
Return the SequenceDB for the given identifier.
|
Set |
getSequenceDBs()
Return all sequence dbs available in this sequence db
installation.
|
Set getSequenceDBs()
SequenceDBLite getSequenceDB(String identifier)
Return the SequenceDB for the given identifier. The identifier can (but need not) be the name of the sequence db. An implementation may support any number of identifiers to (uniquely) identify a particular sequence db - but the name of the sequence db (returned by SequenceDB.getName()) must always be among them.
If the sequence db identified by the given identifier has not been requested through this object, it will be created and returned (hence this method is a factory method). If the sequence db identified by the given identifier has already been requested, the same object is returned.
identifier
- the string that identifies the sequence db. May
not be null.void addSequenceDB(SequenceDBLite sequenceDB, Set otherIdentifiers)
addSequenceDB
adds a new SequenceDB
under its own identifier which will additionally be recognised
by the set of other identifiers. It is up to the implementation
as to how conflicting identifiers are handled.sequenceDB
- a SequenceDB
.otherIdentifiers
- a Set
.Copyright © 2014 BioJava. All rights reserved.