org.biojavax.bio.db.biosql
Class BioSQLRichSequenceDB

java.lang.Object
  extended by org.biojava.utils.AbstractChangeable
      extended by org.biojavax.bio.db.AbstractBioEntryDB
          extended by org.biojavax.bio.db.AbstractRichSequenceDB
              extended by 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.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
 
Fields inherited from interface org.biojavax.bio.db.BioEntryDBLite
BIOENTRYS
 
Fields inherited from interface org.biojavax.bio.db.BioEntryDBLite
BIOENTRYS
 
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
 
Constructor Summary
BioSQLRichSequenceDB(Object session)
          Creates a new instance of BioSQLRichSequenceDB
BioSQLRichSequenceDB(String name, Object session)
          Creates a new instance of BioSQLRichSequenceDB
 
Method Summary
 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
 
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 applying filter to all sequences then merging the results.

Specified by:
filter in interface SequenceDB
Overrides:
filter in class AbstractRichSequenceDB
Parameters:
ff - a FeatureFilter.

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 id
BioException

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 id
BioException

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 by
db - a database to load the seqs into
Returns:
the RichSequences with that id
Throws:
IllegalIDException - if the database doesn't know about the id
BioException

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 interface RichSequenceDBLite
Overrides:
removeRichSequence in class AbstractRichSequenceDB
Parameters:
id - the ID of the RichSequence to remove
Throws:
IllegalIDException - if there is no RichSequence for the ID
BioException - if something failed while removing the RichSequence for that ID
ChangeVetoException - 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 interface RichSequenceDBLite
Overrides:
addRichSequence in class AbstractRichSequenceDB
Parameters:
seq - the RichSequence to add
Throws:
IllegalIDException - if a uniqe ID could not be generated for RichSequence
BioException - if something goes wrong with adding the RichSequence
ChangeVetoException - if either the database does not allow RichSequences to be added or the modification was vetoed