4 # BioPerl module for Bio::DB::Flat::BDB
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
16 Bio::DB::Flat::BDB::fasta - fasta adaptor for Open-bio standard BDB-indexed flat file
24 This module allows fasta 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.
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
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.
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
56 http://bugzilla.open-bio.org/
62 =head1 AUTHOR - Lincoln Stein
64 Email - lstein@cshl.org
68 package Bio
::DB
::Flat
::BDB
::fasta
;
72 use base
qw(Bio::DB::Flat::BDB);
74 sub default_file_format
{ "fasta" }
80 $ids{$self->primary_namespace} = $seq->primary_id;
84 sub parse_one_record
{
88 # fasta parses by changing $/ to '\n>', need to adjust accordingly
89 my $adj = ( $^O
=~ /mswin/i ) ?
-2 : -1;
91 $self->{cached_parsers
}{fileno($fh)}
92 ||= Bio
::SeqIO
->new(-fh
=>$fh,-format
=>$self->default_file_format);
93 my $seq = $parser->next_seq or return;
94 $self->{flat_alphabet
} ||= $seq->alphabet;
95 my $ids = $self->seq_to_ids($seq);