NAME
Bio::DB::BioFetch - Database object interface to BioFetch retrieval
SYNOPSIS
use Bio::DB::BioFetch;$bf = Bio::DB::BioFetch->new();$seq = $bf->get_Seq_by_id('HSFOS'); # EMBL or SWALL ID# change formats, storage procedures$bf = Bio::DB::BioFetch->new(-format => 'fasta',-retrievaltype => 'tempfile',-db => 'EMBL');$stream = $bf->get_Stream_by_id(['HSFOS','J00231']);while (my $s = $stream->next_seq) {print $s->seq,"\n";}# get a RefSeq entry$bf->db('refseq');eval {$seq = $bf->get_Seq_by_version('NM_006732.1'); # RefSeq VERSION};print "accession is ", $seq->accession_number, "\n" unless $@;
DESCRIPTION
Bio::DB::BioFetch is a guaranteed best effort sequence entry fetching method. It goes to the Web-based dbfetch server located at the EBI (http://www.ebi.ac.uk/Tools/dbfetch/dbfetch) to retrieve sequences in the EMBL or GenBank sequence repositories.
This module implements all the Bio::DB::RandomAccessI interface, plus the get_Stream_by_id() and get_Stream_by_acc() methods that are found in the Bio::DB::SwissProt interface.
FEEDBACK
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 discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
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.
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:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Lincoln Stein
Email Lincoln Stein <[email protected]<
Also thanks to Heikki Lehvaslaiho <heikki-at-bioperl-dot-org> for the BioFetch server and interface specification.
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : $bf = Bio::DB::BioFetch->new(@args)Function: Construct a new Bio::DB::BioFetch objectReturns : a Bio::DB::BioFetch objectArgs : see belowThrows :
@args are standard -name=>value options as listed in the following table. If you do not provide any options, the module assumes reasonable defaults.
Option Value Default------ ----- --------baseaddress location of dbfetch server http://www.ebi.ac.uk/Tools/dbfetch/dbfetch-retrievaltype "tempfile" or "io_string" io_string-format "embl", "fasta", "swissprot", emblor "genbank"-db "embl", "genbank" or "swissprot" embl
new_from_registry
Title : new_from_registryUsage : $biofetch = $db->new_from_registry(%config)Function: Creates a BioFetch object from the registry config hashReturns : itselfArgs : A configuration hash (see Registry.pm)Throws :
get_Seq_by_id
Title : get_Seq_by_idUsage : $seq = $db->get_Seq_by_id('ROA1_HUMAN')Function: Gets a Bio::Seq object by its nameReturns : a Bio::Seq objectArgs : the id (as a string) of a sequenceThrows : "id does not exist" exception
get_Seq_by_acc
Title : get_Seq_by_accUsage : $seq = $db->get_Seq_by_acc('X77802');Function: Gets a Bio::Seq object by accession numberReturns : A Bio::Seq objectArgs : accession number (as a string)Throws : "acc does not exist" exception
get_Seq_by_gi
Title : get_Seq_by_giUsage : $seq = $db->get_Seq_by_gi('405830');Function: Gets a Bio::Seq object by gi numberReturns : A Bio::Seq objectArgs : gi number (as a string)Throws : "gi does not exist" exception
get_Seq_by_version
Title : get_Seq_by_versionUsage : $seq = $db->get_Seq_by_version('X77802.1');Function: Gets a Bio::Seq object by sequence versionReturns : A Bio::Seq objectArgs : accession.version (as a string)Throws : "acc.version does not exist" exception
get_Stream_by_id
Title : get_Stream_by_idUsage : $stream = $db->get_Stream_by_id( [$uid1, $uid2] );Function: Gets a series of Seq objects by unique identifiersReturns : a Bio::SeqIO stream objectArgs : $ref : a reference to an array of unique identifiers forthe desired sequence entries
get_Stream_by_gi
Title : get_Stream_by_giUsage : $seq = $db->get_Seq_by_gi([$gi1, $gi2]);Function: Gets a series of Seq objects by gi numbersReturns : a Bio::SeqIO stream objectArgs : $ref : a reference to an array of gi numbers forthe desired sequence entriesNote : For GenBank, this just calls the same code for get_Stream_by_id()
get_Stream_by_batch
Title : get_Stream_by_batchUsage : $seq = $db->get_Stream_by_batch($ref);Function: Get a series of Seq objects by their IDsExample :Returns : a Bio::SeqIO stream objectArgs : $ref : an array reference containing a list of uniqueids/accession numbers.
In some of the Bio::DB::* moduels, get_Stream_by_id() is called get_Stream_by_batch(). Since there seems to be no consensus, this is provided as an alias.
The remainder of these methods are for internal use
get_request
Title : get_requestUsage : my $url = $self->get_requestFunction: returns a HTTP::Request objectReturns :Args : %qualifiers = a hash of qualifiers (ids, format, etc)
default_format
Title : default_formatUsage : $format = $self->default_formatFunction: return the default formatReturns : a stringArgs :
default_db
Title : default_dbUsage : $db = $self->default_dbFunction: return the default databaseReturns : a stringArgs :
db
Title : dbUsage : $db = $self->db([$db])Function: get/set the databaseReturns : a stringArgs : new database
postprocess_data
Title : postprocess_dataUsage : $self->postprocess_data ( 'type' => 'string','location' => \$datastr);Function: process downloaded data before loading into a Bio::SeqIOReturns : voidArgs : hash with two keys - 'type' can be 'string' or 'file'- 'location' either file location or stringreference containing data
request_format
Title : request_formatUsage : my ($req_format, $ioformat) = $self->request_format;$self->request_format("genbank");$self->request_format("fasta");Function: Get/Set sequence format retrieval. The get-form will normally notbe used outside of this and derived modules.Returns : Array of two strings, the first representing the format forretrieval, and the second specifying the corresponding SeqIO format.Args : $format = sequence format
Bio::DB::WebDBSeqI methods
Overriding WebDBSeqI method to help newbies to retrieve sequences. EMBL database is all too often passed RefSeq accessions. This redirects those calls. See Bio::DB::RefSeq.
get_Stream_by_acc
Title : get_Stream_by_accUsage : $seq = $db->get_Seq_by_acc([$acc1, $acc2]);Function: Gets a series of Seq objects by accession numbersReturns : a Bio::SeqIO stream objectArgs : $ref : a reference to an array of accession numbers forthe desired sequence entries
_check_id
Title : _check_idUsage :Function: Throw on whole chromosome NCBI sequences not in sequence databasesand redirect RefSeq accession requests sent to EMBL.Returns :Args : $id(s), $stringThrows : if accessionn number indicates whole chromosome NCBI sequence