org.biojava.bio.seq.db
Class WebSequenceDB
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.seq.db.WebSequenceDB
- All Implemented Interfaces:
- Changeable, SequenceDBLite
- Direct Known Subclasses:
- NCBISequenceDB
- public abstract class WebSequenceDB
- extends AbstractChangeable
- implements SequenceDBLite
Functions for access to a web based database that returns sequences
in a variety of formats.
- Author:
- Jason Stajich, Matthew Pocock, Mark Schreiber
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebSequenceDB
public WebSequenceDB()
getSequenceFormat
protected abstract SequenceFormat getSequenceFormat()
getAddress
protected abstract java.net.URL getAddress(java.lang.String id)
throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
getAlphabet
protected abstract Alphabet getAlphabet()
getSequence
public Sequence getSequence(java.lang.String id)
throws BioException
- Gets a sequence using its unique ID (eg for GenBank this would be the GI number)
- Specified by:
getSequence
in interface SequenceDBLite
- Parameters:
id
- the unique ID
- Returns:
- the matching sequence
- Throws:
BioException
- if the ID is invalid
java.io.IOException
- if the io operation times out or has problems connecting. Can also indicate an invalid URL has been constructed.
addSequence
public void addSequence(Sequence seq)
throws ChangeVetoException
- Not supported, You can't add sequences to a WebDB!
- Specified by:
addSequence
in interface SequenceDBLite
- Parameters:
seq
- the sequence you tried to add
- Throws:
ChangeVetoException
- always!
removeSequence
public void removeSequence(java.lang.String id)
throws ChangeVetoException
- Not supported, you can't remove a sequence from a WebDB!
- Specified by:
removeSequence
in interface SequenceDBLite
- Parameters:
id
- the sequence you tried to change.
- Throws:
ChangeVetoException
- always!