tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / DB / Flat / BDB / swiss.pm
blobceceb4a686f2af52b14f2fb475188a09f2277b4e
2 # $Id$
4 # BioPerl module for Bio::DB::Flat::BDB::swiss
6 # Please direct questions and support issues to <bioperl-l@bioperl.org>
8 # Cared for by Lincoln Stein <lstein@cshl.org>
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::DB::Flat::BDB::swiss - swissprot adaptor for Open-bio standard BDB-indexed flat file
18 =head1 SYNOPSIS
20 See Bio::DB::Flat.
22 =head1 DESCRIPTION
24 This module allows swissprot files to be stored in Berkeley DB flat files
25 using the Open-Bio standard BDB-indexed flat file scheme. You should
26 not be using this directly, but instead use it via Bio::DB::Flat.
28 =head1 FEEDBACK
30 =head2 Mailing Lists
32 User feedback is an integral part of the evolution of this and other
33 Bioperl modules. Send your comments and suggestions preferably to one
34 of the Bioperl mailing lists. Your participation is much appreciated.
36 bioperl-l@bioperl.org - General discussion
37 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39 =head2 Support
41 Please direct usage questions or support issues to the mailing list:
43 I<bioperl-l@bioperl.org>
45 rather than to the module maintainer directly. Many experienced and
46 reponsive experts will be able look at the problem and quickly
47 address it. Please include a thorough description of the problem
48 with code and data examples if at all possible.
50 =head2 Reporting Bugs
52 Report bugs to the Bioperl bug tracking system to help us keep track
53 the bugs and their resolution. Bug reports can be submitted via the
54 web:
56 http://bugzilla.open-bio.org/
58 =head1 SEE ALSO
60 L<Bio::DB::Flat>,
62 =head1 AUTHOR - Lincoln Stein
64 Email - lstein@cshl.org
66 =cut
68 package Bio::DB::Flat::BDB::swiss;
70 use strict;
72 use base qw(Bio::DB::Flat::BDB);
74 sub default_file_format { "swiss" }
76 sub default_primary_namespace {
77 return "ID";
80 sub default_secondary_namespaces {
81 return qw(ACC VERSION);
84 sub seq_to_ids {
85 my $self = shift;
86 my $seq = shift;
88 my $display_id = $seq->display_id;
89 my $accession = $seq->accession_number;
90 my $version = $seq->seq_version;
91 my $gi = $seq->primary_id;
92 my %ids;
93 $ids{ID} = $display_id;
94 $ids{ACC} = $accession if defined $accession;
95 $ids{VERSION} = "$accession.$version" if defined $accession && defined $version;
96 return \%ids;