Fetching contributors…
Cannot retrieve contributors at this time
101 lines (67 sloc) 2.37 KB
# $Id: 15549 2009-02-21 00:48:48Z maj $
# BioPerl module for Bio::DB::Flat::BDB::swiss
# Please direct questions and support issues to <>
# Cared for by Lincoln Stein <>
# You may distribute this module under the same terms as perl itself
# POD documentation - main docs before the code
=head1 NAME
Bio::DB::Flat::BDB::swiss - swissprot adaptor for Open-bio standard BDB-indexed flat file
See Bio::DB::Flat.
This module allows swissprot files to be stored in Berkeley DB flat files
using the Open-Bio standard BDB-indexed flat file scheme. You should
not be using this directly, but instead use it via Bio::DB::Flat.
=head2 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. - General discussion - About the mailing lists
=head2 Support
Please direct usage questions or support issues to the mailing list:
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.
=head2 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
=head1 SEE ALSO
=head1 AUTHOR - Lincoln Stein
Email -
package Bio::DB::Flat::BDB::swiss;
use strict;
use base qw(Bio::DB::Flat::BDB);
sub default_file_format { "swiss" }
sub default_primary_namespace {
return "ID";
sub default_secondary_namespaces {
return qw(ACC VERSION);
sub seq_to_ids {
my $self = shift;
my $seq = shift;
my $display_id = $seq->display_id;
my $accession = $seq->accession_number;
my $version = $seq->seq_version;
my $gi = $seq->primary_id;
my %ids;
$ids{ID} = $display_id;
$ids{ACC} = $accession if defined $accession;
$ids{VERSION} = "$accession.$version" if defined $accession && defined $version;
return \%ids;