Package org.biojava.bio.seq.db
Class GenbankSequenceDB
- java.lang.Object
-
- org.biojava.bio.seq.db.GenbankSequenceDB
-
public class GenbankSequenceDB extends Object
This class contains functions accessing DNA sequences in Genbank format.- Author:
- Lei Lai, Matthew Pocock, Laurent Jourdren, Shuvankar Mukherjee, Mark Schreiber, Richard Holland
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanExceptionFoundprotected booleanIOExceptionFoundprotected static StringurlBatchSequences
-
Constructor Summary
Constructors Constructor Description GenbankSequenceDB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckException()booleancheckIOException()protected URLgetAddress(String id)Get the URL object for locating sequence object using eutils.protected URLgetAddress(String id, String format)Get the URL object for locating sequence object using eutils.protected AlphabetgetAlphabet()StringgetName()SequencegetSequence(String id)protected SequenceFormatgetSequenceFormat()SequenceDBgetSequences(Set list)Retrieve sequences from a GenbankSequenceDBgetSequences(Set list, SequenceDB database)Retrieve sequences from a Genbankprotected StringmakeBatchRequest(URL url, Set list)Create the Http Post Request to fetch (in batch mode) a list of sequence with Genbank.
-
-
-
Field Detail
-
IOExceptionFound
protected boolean IOExceptionFound
-
ExceptionFound
protected boolean ExceptionFound
-
urlBatchSequences
protected static final String urlBatchSequences
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GenbankSequenceDB
public GenbankSequenceDB()
-
-
Method Detail
-
getSequenceFormat
protected SequenceFormat getSequenceFormat()
-
getAlphabet
protected Alphabet getAlphabet()
-
getAddress
protected URL getAddress(String id) throws MalformedURLException
Get the URL object for locating sequence object using eutils. The default value of the return format of the sequence object is text.- Throws:
MalformedURLException
-
getAddress
protected URL getAddress(String id, String format) throws MalformedURLException
Get the URL object for locating sequence object using eutils. User could specify the return format of the sequence object.- Throws:
MalformedURLException
-
getSequence
public Sequence getSequence(String id) throws Exception
- Throws:
Exception
-
checkIOException
public boolean checkIOException()
-
checkException
public boolean checkException()
-
makeBatchRequest
protected String makeBatchRequest(URL url, Set list)
Create the Http Post Request to fetch (in batch mode) a list of sequence with Genbank.- Parameters:
url- URL of the requestlist- List of sequence identifier- Returns:
- The Post request.
-
getSequences
public SequenceDB getSequences(Set list) throws BioException
Retrieve sequences from a Genbank- Parameters:
list- List of NCBI sequence number (GI), accession, accession.version, fasta or seqid.- Returns:
- The database object (HashSequenceDB) with downloaded sequences.
- Throws:
BioException
-
getSequences
public SequenceDB getSequences(Set list, SequenceDB database) throws BioException
Retrieve sequences from a Genbank- Parameters:
list- List of NCBI sequence number (GI), accession, accession.version, fasta or seqid.database- Where to store sequences. if database is null, use an HashSequenceDB Objet.- Returns:
- The database object with downloaded sequences.
- Throws:
BioException
-
-