Package org.biojavax.bio.db.biosql
Class BioSQLRichSequenceDB
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojavax.bio.db.AbstractBioEntryDB
-
- org.biojavax.bio.db.AbstractRichSequenceDB
-
- org.biojavax.bio.db.biosql.BioSQLRichSequenceDB
-
- All Implemented Interfaces:
SequenceDB
,SequenceDBLite
,Changeable
,BioEntryDB
,BioEntryDBLite
,RichSequenceDB
,RichSequenceDBLite
public class BioSQLRichSequenceDB extends AbstractRichSequenceDB
- Since:
- 1.5
- Author:
- Richard Holland, David Scott
-
-
Field Summary
-
Fields inherited from interface org.biojavax.bio.db.BioEntryDBLite
BIOENTRYS
-
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
-
-
Constructor Summary
Constructors Constructor Description BioSQLRichSequenceDB(Object session)
Creates a new instance of BioSQLRichSequenceDBBioSQLRichSequenceDB(String name, Object session)
Creates a new instance of BioSQLRichSequenceDB
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRichSequence(RichSequence seq)
Adds a sequence to the database.FeatureHolder
filter(FeatureFilter ff)
Query features attached to all sequences in this database.RichSequence
fullyLoadRichSequence(RichSequence id)
Object
getHibernateSession()
String
getName()
Get the name of this sequence database.RichSequence
getRichSequence(String id)
Retrieve a single RichSequence by its id.RichSequenceDB
getRichSequences(Set ids)
Retrieve multiple RichSequence by its id.RichSequenceDB
getRichSequences(Set ids, RichSequenceDB db)
Retrieve multiple RichSequence into a specific sequence database.Set
ids()
Get an immutable set of all of the IDs in the database.FeatureHolder
processFeatureFilter(FeatureFilter ff)
void
removeRichSequence(String id)
Remove the RichSequence associated with an ID from the database.-
Methods inherited from class org.biojavax.bio.db.AbstractRichSequenceDB
addBioEntry, addSequence, getBioEntry, getBioEntryIterator, getBioEntrys, getBioEntrys, getRichSequenceIterator, getSequence, removeBioEntry, removeSequence, sequenceIterator
-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
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
-
BioSQLRichSequenceDB
public BioSQLRichSequenceDB(Object session)
Creates a new instance of BioSQLRichSequenceDB
-
BioSQLRichSequenceDB
public BioSQLRichSequenceDB(String name, Object session)
Creates a new instance of BioSQLRichSequenceDB
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:SequenceDBLite
Get the name of this sequence database.- Returns:
- the name of the sequence database, which may be null.
-
getHibernateSession
public Object getHibernateSession()
-
processFeatureFilter
public FeatureHolder processFeatureFilter(FeatureFilter ff)
-
filter
public FeatureHolder filter(FeatureFilter ff)
Description copied from interface:SequenceDB
Query features attached to all sequences in this database. This is equivalent to applyingfilter
to all sequences then merging the results.- Specified by:
filter
in interfaceSequenceDB
- Overrides:
filter
in classAbstractRichSequenceDB
- Parameters:
ff
- aFeatureFilter
.
-
ids
public Set ids()
Description copied from interface:SequenceDB
Get an immutable set of all of the IDs in the database. The ids are legal arguments to getSequence.- Returns:
- a Set of ids - at the moment, strings
-
fullyLoadRichSequence
public RichSequence fullyLoadRichSequence(RichSequence id) throws IllegalIDException, BioException
- Throws:
IllegalIDException
BioException
-
getRichSequence
public RichSequence getRichSequence(String id) throws IllegalIDException, BioException
Description copied from interface:RichSequenceDBLite
Retrieve a single RichSequence by its id.- Parameters:
id
- the id to retrieve by- Returns:
- the Sequence with that id
- Throws:
IllegalIDException
- if the database doesn't know about the idBioException
-
getRichSequences
public RichSequenceDB getRichSequences(Set ids) throws BioException, IllegalIDException
Description copied from interface:RichSequenceDBLite
Retrieve multiple RichSequence by its id.- Parameters:
ids
- a set of ids to retrieve by- Returns:
- the RichSequences with that id
- Throws:
IllegalIDException
- if the database doesn't know about the idBioException
-
getRichSequences
public RichSequenceDB getRichSequences(Set ids, RichSequenceDB db) throws BioException, IllegalIDException
Description copied from interface:RichSequenceDBLite
Retrieve multiple RichSequence into a specific sequence database. If that database is null, a new HashRichSequenceDB is used.- Parameters:
ids
- a set of ids to retrieve bydb
- a database to load the seqs into- Returns:
- the RichSequences with that id
- Throws:
IllegalIDException
- if the database doesn't know about the idBioException
-
removeRichSequence
public void removeRichSequence(String id) throws IllegalIDException, BioException, ChangeVetoException
Description copied from interface:RichSequenceDBLite
Remove the RichSequence associated with an ID from the database.- Specified by:
removeRichSequence
in interfaceRichSequenceDBLite
- Overrides:
removeRichSequence
in classAbstractRichSequenceDB
- 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
-
addRichSequence
public void addRichSequence(RichSequence seq) throws IllegalIDException, BioException, ChangeVetoException
Description copied from interface:RichSequenceDBLite
Adds a sequence to the database.- Specified by:
addRichSequence
in interfaceRichSequenceDBLite
- Overrides:
addRichSequence
in classAbstractRichSequenceDB
- 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
-
-