Package org.biojava.bio.program.das
Class DASSequenceDB
- java.lang.Object
-
- org.biojava.utils.Unchangeable
-
- org.biojava.bio.program.das.DASSequenceDB
-
- All Implemented Interfaces:
SequenceDB,SequenceDBLite,Changeable
public class DASSequenceDB extends Unchangeable implements SequenceDB
Collection of sequences retrieved from the DAS network.
The DAS-specific parts of this API are still subject to change.
- Since:
- 1.1
- Author:
- Thomas Down
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
-
-
Constructor Summary
Constructors Constructor Description DASSequenceDB(java.net.URL dataSourceURL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSequence(Sequence seq)Adds a sequence to the database.SequenceDBLiteallEntryPointsDB()FeatureHolderfilter(FeatureFilter ff)Query features attached to all sequences in this database.java.lang.StringgetName()Get the name of this sequence database.SequencegetSequence(java.lang.String id)Retrieve a single sequence by its id.java.net.URLgetURL()Return the URL of the reference server for this database.java.util.Setids()Get an immutable set of all of the IDs in the database.voidremoveSequence(java.lang.String id)Remove the sequence associated with an ID from the database.SequenceIteratorsequenceIterator()Returns a SequenceIterator over all sequences in the database.-
Methods inherited from class org.biojava.utils.Unchangeable
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Constructor Detail
-
DASSequenceDB
public DASSequenceDB(java.net.URL dataSourceURL) throws BioException- Throws:
BioException
-
-
Method Detail
-
filter
public FeatureHolder filter(FeatureFilter ff)
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.
-
allEntryPointsDB
public SequenceDBLite allEntryPointsDB()
-
getURL
public java.net.URL getURL()
Return the URL of the reference server for this database.
-
getName
public java.lang.String getName()
Description copied from interface:SequenceDBLiteGet the name of this sequence database.- Specified by:
getNamein interfaceSequenceDBLite- Returns:
- the name of the sequence database, which may be null.
-
getSequence
public Sequence getSequence(java.lang.String id) throws BioException, IllegalIDException
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
-
ids
public java.util.Set ids()
Description copied from interface:SequenceDBGet an immutable set of all of the IDs in the database. The ids are legal arguments to getSequence.- Specified by:
idsin interfaceSequenceDB- Returns:
- a Set of ids - at the moment, strings
-
addSequence
public void addSequence(Sequence seq) throws ChangeVetoException
Description copied from interface:SequenceDBLiteAdds a sequence to the database.- Specified by:
addSequencein interfaceSequenceDBLite- Parameters:
seq- the Sequence to add- Throws:
ChangeVetoException- if either the database does not allow sequences to be added or the modification was vetoed
-
removeSequence
public void removeSequence(java.lang.String id) throws ChangeVetoExceptionDescription 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:
ChangeVetoException- if either the database does not allow sequences to be removed or the modification was vetoed
-
sequenceIterator
public SequenceIterator sequenceIterator()
Description copied from interface:SequenceDBReturns a SequenceIterator over all sequences in the database. The order of retrieval is undefined.- Specified by:
sequenceIteratorin interfaceSequenceDB- Returns:
- a SequenceIterator over all sequences
-
-