DESCRIPTION

Allows the dynamic retrieval of Bio::Seq sequence objects from the GenBank database at NCBI, via an Entrez query.

WARNING: Please do NOT spam the Entrez web server with multiple requests. NCBI offers Batch Entrez for this purpose.

Note that when querying for GenBank accessions starting with 'NT_' you will need to call $gb->request_format('fasta') beforehand, because in GenBank format (the default) the sequence part will be left out (the reason is that NT contigs are rather annotation with references to clones).

Some work has been done to automatically detect and retrieve whole NT_ clones when the data is in that format (NCBI RefSeq clones). The former behavior prior to bioperl 1.6 was to retrieve these from EBI, but now these are retrieved directly from NCBI. The older behavior can be regained by setting the 'redirect_refseq' flag to a value evaluating to TRUE.

Running

Complexity: gi is often a part of a biological blob, containing other gis

complexity regulates the display: 0 - get the whole blob 1 - get the bioseq for gi of interest (default in Entrez) 2 - get the minimal bioseq-set containing the gi of interest 3 - get the minimal nuc-prot containing the gi of interest 4 - get the minimal pub-set containing the gi of interest

'seq_start' and 'seq_stop' will not work when setting complexity to any value other than 1. 'strand' works for any setting other than a complexity of 0 (whole glob); when you try this with a GenBank return format nothing happens, whereas using FASTA works but causes display problems with the other sequences in the glob. As Tao Tao says from NCBI, "Better left it out or set it to 1."

FEEDBACK

Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.

bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists

Support

Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

AUTHOR - Aaron Mackey, Jason Stajich

Email amackey@virginia.edu Email jason@bioperl.org

APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

new

Title : new
Usage : $gb = Bio::DB::GenBank->new(@options)
Function: Creates a new genbank handle
Returns : a new Bio::DB::Genbank object
Args : -delay number of seconds to delay between fetches (3s)

NOTE: There are other options that are used internally. By NCBI policy, this module introduces a 3s delay between fetches. If you are fetching multiple genbank ids, it is a good idea to use get

Routines Bio::DB::WebDBSeqI from Bio::DB::RandomAccessI

get_Seq_by_id

Title : get_Seq_by_id
Usage : $seq = $db->get_Seq_by_id('ROA1_HUMAN')
Function: Gets a Bio::Seq object by its name
Returns : a Bio::Seq object
Args : the id (as a string) of a sequence
Throws : "id does not exist" exception

get_Seq_by_acc

Title : get_Seq_by_acc
Usage : $seq = $db->get_Seq_by_acc($acc);
Function: Gets a Seq object by accession numbers
Returns : a Bio::Seq object
Args : the accession number as a string
Note : For GenBank, this just calls the same code for get_Seq_by_id().
Caveat: this normally works, but in rare cases simply passing the
accession can lead to odd results, possibly due to unsynchronized
NCBI ID servers. Using get_Seq_by_version() is slightly better, but
using the unique identifier (GI) and get_Seq_by_id is the most
consistent
Throws : "id does not exist" exception

get_Seq_by_version

Title : get_Seq_by_version
Usage : $seq = $db->get_Seq_by_version('X77802.1');
Function: Gets a Bio::Seq object by sequence version
Returns : A Bio::Seq object
Args : accession.version (as a string)
Note : Caveat: this normally works, but using the unique identifier (GI) and
get_Seq_by_id is the most consistent
Throws : "acc.version does not exist" exception

Routines implemented by Bio::DB::NCBIHelper

get_Stream_by_query

Title : get_Stream_by_query
Usage : $seq = $db->get_Stream_by_query($query);
Function: Retrieves Seq objects from Entrez 'en masse', rather than one
at a time. For large numbers of sequences, this is far superior
than get_Stream_by_[id/acc]().
Example :
Returns : a Bio::SeqIO stream object
Args : $query : An Entrez query string or a
Bio::DB::Query::GenBank object. It is suggested that you
create a Bio::DB::Query::GenBank object and get the entry
count before you fetch a potentially large stream.

get_Stream_by_acc

Title : get_Stream_by_acc
Usage : $seq = $db->get_Stream_by_acc([$acc1, $acc2]);
Function: Gets a series of Seq objects by accession numbers
Returns : a Bio::SeqIO stream object
Args : $ref : a reference to an array of accession numbers for
the desired sequence entries
Note : For GenBank, this just calls the same code for get_Stream_by_id()

get_Stream_by_gi

Title : get_Stream_by_gi
Usage : $seq = $db->get_Seq_by_gi([$gi1, $gi2]);
Function: Gets a series of Seq objects by gi numbers
Returns : a Bio::SeqIO stream object
Args : $ref : a reference to an array of gi numbers for
the desired sequence entries
Note : For GenBank, this just calls the same code for get_Stream_by_id()

get_Stream_by_batch

Title : get_Stream_by_batch
Usage : $seq = $db->get_Stream_by_batch($ref);
Function: Retrieves Seq objects from Entrez 'en masse', rather than one
at a time.
Example :
Returns : a Bio::SeqIO stream object
Args : $ref : either an array reference, a filename, or a filehandle
from which to get the list of unique ids/accession numbers.

NOTE: This method is redundant and deprecated. Use get_Stream_by_id() instead.