Bio::DB::SeqVersion::gi(3) interface to NCBI Sequence Revision History page


Do not use this module directly, use Bio::DB::SeqVersion.

use Bio::DB::SeqVersion;
my $query = Bio::DB::SeqVersion->new(-type => 'gi');
# all GIs, which will include the GI used to query
my @all_gis = $query->get_all(2);
# the most recent GI, which may or may not be the GI used to query
my $live_gi = $query->get_recent(2);
# get all the visible data on the Sequence Revision page
my $array_ref = $query->get_history(11111111);

These methods can also take accession numbers as arguments, just like the Sequence Revision page itself.


All sequence entries at GenBank are identified by a pair of identifiers, an accession and a numeric identifier, and this number is frequently called a GI number (GenInfo Identifier). The accession is stable, but each new version of the sequence entry for the accession receives a new GI number (see <> for more information on GenBank identifiers). One accession can have one or more GI numbers and the highest of these is the most recent, or ``live'', GI.

Information on an accession and its associated GI numbers is available at the Sequence Revision History page at NCBI, <>, this information is not available in file format. This module queries the Web page and retrieves GI numbers and related data given an accession (e.g. NP_111111, A11111, P12345) or a GI number (e.g. 2, 11111111) as query.


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.

  [email protected]                  - General discussion  - About the mailing lists


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

[email protected]

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:

AUTHOR - Brian Osborne

Email < osborne at optonline dot net >


Torsten Seemann - torsten.seemann AT


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


 Title   : new
 Usage   : $gb = Bio::DB::SeqVersion::gi->new
 Function: Creates a new query object
 Returns : New query object


 Title   : get_all
 Usage   : my @gis = $q->get_all(2)
 Function: Get all GI numbers given a GI number
 Returns : An array of GI numbers, earliest GI number is the 0 element
 Args    : A single GI number (string)


 Title   : get_recent
 Usage   : my $newest_gi = $q->get_recent(2)
 Function: Get most recent GI given a single GI
 Returns : String
 Args    : A single GI number (string)


 Title   : get_status
 Usage   : my $newest_gi = $q->get_status(2)
 Function: Get most recent GI given a single GI
 Returns : String
 Args    : A single GI number (string)


 Title   : get_history
 Usage   : my $ref = $query_obj->get_history()
 Function: Queries the NCBI Revision page, gets the data from the HTML table
 Returns : Reference to an array of arrays where element 0 refers to the most
           recent version and the last element refers to the oldest version.
           In the second dimension the elements are:
           0      GI number
           1      Version
           2      Update Date
           For example, to get the GI number of the first version:
           To get the Update Date of the latest version:
 Args    : One identifier (string)
 Note    : Status of the GI was returned here previously as the last element in
           the row of elemnts above; however the status is currently only
           returned for the GI requested (e.g. a single value).  One can get
           the status for this using the get_status() method above


 Title   : _get_request
 Usage   : my $url = $self->_get_request
 Function: GET using NCBI Revision page URL, uses Root::HTTPget
 Returns : HTML
 Args    : One identifier (string)


 Title   : _process_data
 Usage   : $self->_process_data($html)
 Function: extract data from HTML
 Args    : HTML from Revision History page
 Returns : reference to an array of arrays