Package org.biojava.bio.seq.db
Class NCBISequenceDB
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.seq.db.WebSequenceDB
-
- org.biojava.bio.seq.db.NCBISequenceDB
-
- All Implemented Interfaces:
SequenceDBLite,Changeable
public class NCBISequenceDB extends WebSequenceDB
- Author:
- Matthew Pocock, Mark Schreiber
-
-
Field Summary
Fields Modifier and Type Field Description static StringDB_NUCLEOTIDEstatic StringDB_PROTEIN-
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
-
-
Constructor Summary
Constructors Constructor Description NCBISequenceDB()Default constructor, querys the Genbank nucleotide database on "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi" and retrieves sequences in FastaFormat.NCBISequenceDB(String server, String CGI, String database, SequenceFormat format)Parameterized constructorNCBISequenceDB(String database, SequenceFormat format)Parameterized constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected URLgetAddress(String uid)protected AlphabetgetAlphabet()StringgetDataBase()StringgetName()Get the name of this sequence database.SequenceFormatgetSequenceFormat()voidsetDatabase(String dataBase)voidsetSequenceFormat(SequenceFormat format)-
Methods inherited from class org.biojava.bio.seq.db.WebSequenceDB
addSequence, getSequence, removeSequence
-
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
-
-
-
-
Field Detail
-
DB_NUCLEOTIDE
public static final String DB_NUCLEOTIDE
- See Also:
- Constant Field Values
-
DB_PROTEIN
public static final String DB_PROTEIN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NCBISequenceDB
public NCBISequenceDB()
Default constructor, querys the Genbank nucleotide database on "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi" and retrieves sequences in FastaFormat.
-
NCBISequenceDB
public NCBISequenceDB(String database, SequenceFormat format)
Parameterized constructor- Parameters:
database- must be one of "nucleotide" or "protein" (use the static DB fields)format- must be one ofGenbankFormatorFastaFormat- Throws:
BioRuntimeException- if the database or format is invalid
-
NCBISequenceDB
public NCBISequenceDB(String server, String CGI, String database, SequenceFormat format) throws BioRuntimeException
Parameterized constructor- Parameters:
server- eg "http://www.ncbi.nlm.nih.gov/"CGI- eg "entrez/query.fcgi"database- must be one of "nucleotide" or "protein" (use the static DB fields)format- must be one ofGenbankFormatorFastaFormat- Throws:
BioRuntimeException- if the database or format is invalid
-
-
Method Detail
-
getDataBase
public String getDataBase()
-
setDatabase
public void setDatabase(String dataBase) throws BioException
- Parameters:
dataBase- must be one of "nucleotide" or "protein" (use the static DB fields)- Throws:
BioException- if an unknown database name is used.
-
getSequenceFormat
public SequenceFormat getSequenceFormat()
- Specified by:
getSequenceFormatin classWebSequenceDB
-
setSequenceFormat
public void setSequenceFormat(SequenceFormat format) throws BioException
- Parameters:
format- must be one ofFastaFormatorGenbankFormat- Throws:
BioException- if an unknownSequenceFormatis used
-
getAlphabet
protected Alphabet getAlphabet()
- Specified by:
getAlphabetin classWebSequenceDB
-
getAddress
protected URL getAddress(String uid) throws MalformedURLException
- Specified by:
getAddressin classWebSequenceDB- Throws:
MalformedURLException
-
getName
public String getName()
Description copied from interface:SequenceDBLiteGet the name of this sequence database.- Returns:
- the name of the sequence database, which may be null.
-
-