3 # BioPerl module for Bio::DB::EMBL
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>
9 # Copyright Jason Stajich
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::DB::RefSeq - Database object interface for RefSeq retrieval
23 $db = Bio::DB::RefSeq->new();
25 # most of the time RefSeq_ID eq RefSeq acc
26 $seq = $db->get_Seq_by_id('NM_006732'); # RefSeq ID
27 print "accession is ", $seq->accession_number, "\n";
29 # or changeing to accession number and Fasta format ...
30 $db->request_format('fasta');
31 $seq = $db->get_Seq_by_acc('NM_006732'); # RefSeq ACC
32 print "seq is ", $seq->seq, "\n";
34 # especially when using versions, you better be prepared
35 # in not getting what what want
37 $seq = $db->get_Seq_by_version('NM_006732.1'); # RefSeq VERSION
39 print "accesion is ", $seq->accession_number, "\n" unless $@;
41 # or ... best when downloading very large files, prevents
42 # keeping all of the file in memory
44 # also don't want features, just sequence so let's save bandwith
45 # and request Fasta sequence
46 $db = Bio::DB::RefSeq->new(-retrievaltype => 'tempfile' ,
48 my $seqio = $db->get_Stream_by_id(['NM_006732', 'NM_005252'] );
49 while( my $seq = $seqio->next_seq ) {
50 print "seqid is ", $seq->id, "\n";
55 Allows the dynamic retrieval of sequence objects L<Bio::Seq> from the
56 RefSeq database using the dbfetch script at EBI:
58 http://www.ebi.ac.uk/Tools/dbfetch/dbfetch
60 In order to make changes transparent we have host type (currently only
61 ebi) and location (defaults to ebi) separated out. This allows later
62 additions of more servers in different geographical locations.
64 The functionality of this module is inherited from L<Bio::DB::DBFetch>
65 which implements L<Bio::DB::WebDBSeqI>.
67 This module retrieves entries from EBI although it
68 retrives database entries produced at NCBI. When read into bioperl
69 objects, the parser for GenBank format it used. RefSeq is a
70 NONSTANDARD GenBank file so be ready for surprises.
76 User feedback is an integral part of the evolution of this and other
77 Bioperl modules. Send your comments and suggestions preferably to one
78 of the Bioperl mailing lists. Your participation is much appreciated.
80 bioperl-l@bioperl.org - General discussion
81 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
85 Please direct usage questions or support issues to the mailing list:
87 I<bioperl-l@bioperl.org>
89 rather than to the module maintainer directly. Many experienced and
90 reponsive experts will be able look at the problem and quickly
91 address it. Please include a thorough description of the problem
92 with code and data examples if at all possible.
96 Report bugs to the Bioperl bug tracking system to help us keep track
97 the bugs and their resolution. Bug reports can be submitted via the
100 https://github.com/bioperl/bioperl-live/issues
102 =head1 AUTHOR - Heikki Lehvaslaiho
104 Email Heikki Lehvaslaiho E<lt>heikki-at-bioperl-dot-orgE<gt>
108 The rest of the documentation details each of the object
109 methods. Internal methods are usually preceded with a _
113 # Let the code begin...
115 package Bio
::DB
::RefSeq
;
117 use vars
qw($MODVERSION %HOSTS %FORMATMAP $DEFAULTFORMAT);
121 use base qw(Bio::DB::DBFetch);
124 # you can add your own here theoretically.
127 baseurl
=> 'http://%s/Tools/dbfetch/dbfetch?db=refseq&style=raw',
129 'ebi' => 'www.ebi.ac.uk'
133 %FORMATMAP = ( 'embl' => 'embl',
134 'genbank' => 'genbank',
137 $DEFAULTFORMAT = 'genbank';
141 my ($class, @args ) = @_;
142 my $self = $class->SUPER::new
(@args);
144 $self->{ '_hosts' } = {};
145 $self->{ '_formatmap' } = {};
147 $self->hosts(\
%HOSTS);
148 $self->formatmap(\
%FORMATMAP);
149 $self->{'_default_format'} = $DEFAULTFORMAT;
156 my ($self,%qualifiers) = @_;
157 if( exists $qualifiers{'-uids'} ) {
158 if( ref($qualifiers{'-uids'}) =~ /ARRAY/i ) {
159 foreach my $u ( @
{$qualifiers{'-uids'}} ) {
163 $qualifiers{'-uids'} =~ s/^(\S+)\|//;
166 $self->SUPER::get_seq_stream
(%qualifiers);