Package org.biojavax.bio.db
Class AbstractRichSequenceDB
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.bio.db.AbstractBioEntryDB
org.biojavax.bio.db.AbstractRichSequenceDB
- All Implemented Interfaces:
SequenceDB,SequenceDBLite,Changeable,BioEntryDB,BioEntryDBLite,RichSequenceDB,RichSequenceDBLite
- Direct Known Subclasses:
BioSQLRichSequenceDB,GenbankRichSequenceDB,GenpeptRichSequenceDB,HashRichSequenceDB
An abstract implementation of RichSequenceDB that provides the getRichSequenceIterator
method.
- Since:
- 1.5
- Author:
- Matthew Pocock, Thomas Down, Richard Holland
-
Field Summary
Fields inherited from interface org.biojavax.bio.db.BioEntryDBLite
BIOENTRYSFields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBioEntry(BioEntry seq) Adds a sequence to the database.voidAdds a sequence to the database.voidaddSequence(Sequence seq) Adds a sequence to the database.filter(FeatureFilter ff) Query features attached to all sequences in this database.getBioEntry(String id) Retrieve a single BioEntry by its id.Returns a BioEntryIterator over all BioEntrys in the database.getBioEntrys(Set ids) Retrieve multiple BioEntry by their ids.getBioEntrys(Set ids, BioEntryDB db) Retrieve multiple BioEntry into a specific sequence database.Returns a RichSequenceIterator over all sequences in the database.getSequence(String id) Retrieve a single sequence by its id.voidremoveBioEntry(String id) Remove the BioEntry associated with an ID from the database.voidRemove the RichSequence associated with an ID from the database.voidremoveSequence(String id) Remove the sequence associated with an ID from the database.Returns a SequenceIterator over all sequences in the database.Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojavax.bio.db.BioEntryDB
idsMethods inherited from interface org.biojavax.bio.db.BioEntryDBLite
getNameMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from interface org.biojavax.bio.db.RichSequenceDBLite
getRichSequence, getRichSequences, getRichSequencesMethods inherited from interface org.biojava.bio.seq.db.SequenceDB
idsMethods inherited from interface org.biojava.bio.seq.db.SequenceDBLite
getName
-
Constructor Details
-
AbstractRichSequenceDB
public AbstractRichSequenceDB()
-
-
Method Details
-
getSequence
Description copied from interface:SequenceDBLiteRetrieve a single sequence by its id.- Specified by:
getSequencein interfaceSequenceDBLite- Parameters:
id- the id to retrieve by- Returns:
- the Sequence with that id
- Throws:
IllegalIDException- if the database doesn't know about the idBioException- if there was a failure in retrieving the sequence
-
getBioEntry
Description copied from interface:BioEntryDBLiteRetrieve a single BioEntry by its id.- Specified by:
getBioEntryin interfaceBioEntryDBLite- Parameters:
id- the id to retrieve by- Returns:
- the BioEntry with that id
- Throws:
IllegalIDException- if the database doesn't know about the idBioException- if there was a failure in retrieving the BioEntry
-
getBioEntrys
Description copied from interface:BioEntryDBLiteRetrieve multiple BioEntry by their ids.- Specified by:
getBioEntrysin interfaceBioEntryDBLite- Parameters:
ids- a set of ids to retrieve by- Returns:
- the BioEntrys with those ids
- Throws:
IllegalIDException- if the database doesn't know about the idBioException
-
getBioEntrys
Description copied from interface:BioEntryDBLiteRetrieve multiple BioEntry into a specific sequence database. If that database is null, a new HashBioEntryDB is used.- Specified by:
getBioEntrysin interfaceBioEntryDBLite- Parameters:
ids- a set of ids to retrieve bydb- a database to load the seqs into- Returns:
- the BioEntrys with that id
- Throws:
IllegalIDException- if the database doesn't know about the idBioException
-
addSequence
Description copied from interface:SequenceDBLiteAdds a sequence to the database.- Specified by:
addSequencein interfaceSequenceDBLite- Parameters:
seq- the Sequence to add- Throws:
IllegalIDException- if a uniqe ID could not be generated for seqBioException- if something goes wrong with adding the sequenceChangeVetoException- if either the database does not allow sequences to be added or the modification was vetoed
-
removeSequence
Description copied from interface:SequenceDBLiteRemove the sequence associated with an ID from the database.- Specified by:
removeSequencein interfaceSequenceDBLite- Parameters:
id- the ID of the sequence to remove- Throws:
IllegalIDException- if there is no sequence for the IDBioException- if something failed while removing the sequence for that IDChangeVetoException- if either the database does not allow sequences to be removed or the modification was vetoed
-
addBioEntry
Description copied from interface:BioEntryDBLiteAdds a sequence to the database.- Specified by:
addBioEntryin interfaceBioEntryDBLite- Overrides:
addBioEntryin classAbstractBioEntryDB- Parameters:
seq- the BioEntry to add- Throws:
IllegalIDException- if a uniqe ID could not be generated for BioEntryBioException- if something goes wrong with adding the BioEntryChangeVetoException- if either the database does not allow BioEntrys to be added or the modification was vetoed
-
removeBioEntry
Description copied from interface:BioEntryDBLiteRemove the BioEntry associated with an ID from the database.- Specified by:
removeBioEntryin interfaceBioEntryDBLite- Overrides:
removeBioEntryin classAbstractBioEntryDB- Parameters:
id- the ID of the BioEntry to remove- Throws:
IllegalIDException- if there is no BioEntry for the IDBioException- if something failed while removing the BioEntry for that IDChangeVetoException- if either the database does not allow BioEntrys to be removed or the modification was vetoed
-
addRichSequence
public void addRichSequence(RichSequence seq) throws IllegalIDException, BioException, ChangeVetoException Description copied from interface:RichSequenceDBLiteAdds a sequence to the database.- Specified by:
addRichSequencein interfaceRichSequenceDBLite- Parameters:
seq- the RichSequence to add- Throws:
IllegalIDException- if a uniqe ID could not be generated for RichSequenceBioException- if something goes wrong with adding the RichSequenceChangeVetoException- if either the database does not allow RichSequences to be added or the modification was vetoed
-
removeRichSequence
public void removeRichSequence(String id) throws IllegalIDException, BioException, ChangeVetoException Description copied from interface:RichSequenceDBLiteRemove the RichSequence associated with an ID from the database.- Specified by:
removeRichSequencein interfaceRichSequenceDBLite- Parameters:
id- the ID of the RichSequence to remove- Throws:
IllegalIDException- if there is no RichSequence for the IDBioException- if something failed while removing the RichSequence for that IDChangeVetoException- if either the database does not allow RichSequences to be removed or the modification was vetoed
-
sequenceIterator
Description copied from interface:RichSequenceDBReturns a SequenceIterator over all sequences in the database. The order of retrieval is undefined. Will always return an instance of RichSequenceIterator.- Specified by:
sequenceIteratorin interfaceRichSequenceDB- Specified by:
sequenceIteratorin interfaceSequenceDB- Returns:
- a SequenceIterator over all sequences
-
getBioEntryIterator
Description copied from interface:BioEntryDBReturns a BioEntryIterator over all BioEntrys in the database. The order of retrieval is undefined.- Specified by:
getBioEntryIteratorin interfaceBioEntryDB- Overrides:
getBioEntryIteratorin classAbstractBioEntryDB- Returns:
- a BioEntryIterator over all BioEntrys
-
getRichSequenceIterator
Description copied from interface:RichSequenceDBReturns a RichSequenceIterator over all sequences in the database. The order of retrieval is undefined.- Specified by:
getRichSequenceIteratorin interfaceRichSequenceDB- Returns:
- a RichSequenceIterator over all sequences
-
filter
Description copied from interface:SequenceDBQuery features attached to all sequences in this database. This is equivalent to applyingfilterto all sequences then merging the results.- Specified by:
filterin interfaceSequenceDB- Parameters:
ff- aFeatureFilter.
-