org.biojava.bio.seq.db
Class GenbankSequenceDB

java.lang.Object
  extended by org.biojava.bio.seq.db.GenbankSequenceDB

public class GenbankSequenceDB
extends java.lang.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
protected  boolean ExceptionFound
           
protected  boolean IOExceptionFound
           
protected static java.lang.String urlBatchSequences
           
 
Constructor Summary
GenbankSequenceDB()
           
 
Method Summary
 boolean checkException()
           
 boolean checkIOException()
           
protected  java.net.URL getAddress(java.lang.String id)
          Get the URL object for locating sequence object using eutils.
protected  java.net.URL getAddress(java.lang.String id, java.lang.String format)
          Get the URL object for locating sequence object using eutils.
protected  Alphabet getAlphabet()
           
 java.lang.String getName()
           
 Sequence getSequence(java.lang.String id)
           
protected  SequenceFormat getSequenceFormat()
           
 SequenceDB getSequences(java.util.Set list)
          Retrieve sequences from a Genbank
 SequenceDB getSequences(java.util.Set list, SequenceDB database)
          Retrieve sequences from a Genbank
protected  java.lang.String makeBatchRequest(java.net.URL url, java.util.Set list)
          Create the Http Post Request to fetch (in batch mode) a list of sequence with Genbank.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IOExceptionFound

protected boolean IOExceptionFound

ExceptionFound

protected boolean ExceptionFound

urlBatchSequences

protected static final java.lang.String urlBatchSequences
See Also:
Constant Field Values
Constructor Detail

GenbankSequenceDB

public GenbankSequenceDB()
Method Detail

getSequenceFormat

protected SequenceFormat getSequenceFormat()

getAlphabet

protected Alphabet getAlphabet()

getAddress

protected java.net.URL getAddress(java.lang.String id)
                           throws java.net.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:
java.net.MalformedURLException

getAddress

protected java.net.URL getAddress(java.lang.String id,
                                  java.lang.String format)
                           throws java.net.MalformedURLException
Get the URL object for locating sequence object using eutils. User could specify the return format of the sequence object.

Throws:
java.net.MalformedURLException

getName

public java.lang.String getName()

getSequence

public Sequence getSequence(java.lang.String id)
                     throws java.lang.Exception
Throws:
java.lang.Exception

checkIOException

public boolean checkIOException()

checkException

public boolean checkException()

makeBatchRequest

protected java.lang.String makeBatchRequest(java.net.URL url,
                                            java.util.Set list)
Create the Http Post Request to fetch (in batch mode) a list of sequence with Genbank.

Parameters:
url - URL of the request
list - List of sequence identifier
Returns:
The Post request.

getSequences

public SequenceDB getSequences(java.util.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(java.util.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