Bio::D...ioFetch(3pm)
πΈ NAME πΈ
Bio::DB::BioFetch β the database object interface to BioFetch retrieval, bestie. Yes that's the whole vibe: you want a sequence, it goes and fetches it for you.
Oh and hi, you're reading the Bio::D...ioFetch(3pm) page, from the User Contributed Perl Documentation collection. Pull up a chair. π«Ά
β¨ 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. Like, it will try its hardest, no cap.
It slides over to the Web-based dbfetch server hanging out at the EBI (http://www.ebi.ac.uk/Tools/dbfetch/dbfetch) to pull sequences out of the EMBL or GenBank sequence repositories. Obsessed with the convenience honestly. β¨
This module implements all of the Bio::DB::RandomAccessI interface, plus the get_Stream_by_id() and get_Stream_by_acc() methods that live over in the Bio::DB::SwissProt interface. So it's giving range. π
π¬ FEEDBACK π¬
Mailing Lists π
User feedback is, like, an integral part of the evolution of this and other Bioperl modules. So send your comments and suggestions preferably to one of the Bioperl mailing lists β your participation is much appreciated, fr fr. π«Ά
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support π©·
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
β¦and not to the module maintainer directly, okay? Not because they're mean, but because there are so many experienced and reponsive experts who'll be able to look at the problem and quickly address it. (Yes, "reponsive" β that's how the original spells it, we keep it. π)
Please include a thorough description of the problem, with code and data examples if at all possible. The more receipts the better. π
Reporting Bugs π
Report bugs to the Bioperl bug tracking system β it helps keep track of 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 lstein@cshl.org (the original has a lil stray < at the end of that address, and honestly? iconic. we love him. π)
Also thanks to Heikki Lehvaslaiho <heikki-at-bioperl-dot-org> for the BioFetch server and interface specification. Absolute legends, both of them. π
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ β that's your lil "backstage pass" signal, iykyk. π
π new
- Title: new
- Usage:
$bf = Bio::DB::BioFetch->new(@args) - Function: Construct a new Bio::DB::BioFetch object
- Returns: a Bio::DB::BioFetch object
- Args: see below
- Throws: (nothing, it's chill)
@args are standard -name=>value options as listed in the following table. If you do not provide any options, the module assumes reasonable defaults. β¨
-baseaddressβ location of dbfetch server β defaulthttp://www.ebi.ac.uk/Tools/dbfetch/dbfetch-retrievaltypeβ"tempfile"or"io_string"β defaultio_string-formatβ"embl","fasta","swissprot", or"genbank"β defaultembl-dbβ"embl","genbank"or"swissprot"β defaultembl
π new_from_registry
- Title: new_from_registry
- Usage:
$biofetch = $db->new_from_registry(%config) - Function: Creates a BioFetch object from the registry config hash
- Returns: itself
- Args: A configuration hash (see Registry.pm)
- Throws: (nada)
π get_Seq_by_id
- Title: get_Seq_by_id
- Usage:
$seq = $db->get_Seq_by_id('ROA1_HUMAN') - Function: Gets a Bio::Seq object by its name
- Returns: a Bio::Seq object
- Args: the id (as a string) of a sequence
- Throws:
"id does not exist"exception
π get_Seq_by_acc
- Title: get_Seq_by_acc
- Usage:
$seq = $db->get_Seq_by_acc('X77802'); - Function: Gets a Bio::Seq object by accession number
- Returns: A Bio::Seq object
- Args: accession number (as a string)
- Throws:
"acc does not exist"exception
π get_Seq_by_gi
- Title: get_Seq_by_gi
- Usage:
$seq = $db->get_Seq_by_gi('405830'); - Function: Gets a Bio::Seq object by gi number
- Returns: A Bio::Seq object
- Args: gi number (as a string)
- Throws:
"gi does not exist"exception
π get_Seq_by_version
- Title: get_Seq_by_version
- Usage:
$seq = $db->get_Seq_by_version('X77802.1'); - Function: Gets a Bio::Seq object by sequence version
- Returns: A Bio::Seq object
- Args: accession.version (as a string)
- Throws:
"acc.version does not exist"exception
π get_Stream_by_id
- Title: get_Stream_by_id
- Usage:
$stream = $db->get_Stream_by_id( [$uid1, $uid2] ); - Function: Gets a series of Seq objects by unique identifiers
- Returns: a Bio::SeqIO stream object
- Args:
$ref: a reference to an array of unique identifiers for the desired sequence entries
π get_Stream_by_gi
- Title: get_Stream_by_gi
- Usage:
$seq = $db->get_Seq_by_gi([$gi1, $gi2]); - Function: Gets a series of Seq objects by gi numbers
- Returns: a Bio::SeqIO stream object
- Args:
$ref: a reference to an array of gi numbers for the desired sequence entries - Note: For GenBank, this just calls the same code for
get_Stream_by_id()
π get_Stream_by_batch
- Title: get_Stream_by_batch
- Usage:
$seq = $db->get_Stream_by_batch($ref); - Function: Get a series of Seq objects by their IDs
- Example: (the original leaves this literally blank, bestie π we keep it blank out of respect)
- Returns: a Bio::SeqIO stream object
- Args:
$ref: an array reference containing a list of unique ids/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. (Also: "moduels" is their spelling, not mine. π«£)
π The remainder of these methods are for internal use
π get_request
- Title: get_request
- Usage:
my $url = $self->get_request - Function: returns a HTTP::Request object
- Returns: (nothing listed)
- Args:
%qualifiers= a hash of qualifiers (ids, format, etc)
π default_format
- Title: default_format
- Usage:
$format = $self->default_format - Function: return the default format
- Returns: a string
- Args: (none)
π default_db
- Title: default_db
- Usage:
$db = $self->default_db - Function: return the default database
- Returns: a string
- Args: (none)
π db
- Title: db
- Usage:
$db = $self->db([$db]) - Function: get/set the database
- Returns: a string
- Args: new database
π postprocess_data
- Title: postprocess_data
- Usage:
$self->postprocess_data ( 'type' => 'string',
'location' => \$datastr);
- Function: process downloaded data before loading into a Bio::SeqIO
- Returns: void
- Args: hash with two keys β
'type'can be'string'or'file';'location'either file location or string reference containing data
π request_format
- Title: request_format
- Usage:
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 not be used outside of this and derived modules.
- Returns: Array of two strings, the first representing the format for retrieval, 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. The 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_acc
- Usage:
$seq = $db->get_Seq_by_acc([$acc1, $acc2]); - Function: Gets a series of Seq objects by accession numbers
- Returns: a Bio::SeqIO stream object
- Args:
$ref: a reference to an array of accession numbers for the desired sequence entries
π _check_id
- Title: _check_id
- Usage: (blank)
- Function: Throw on whole chromosome NCBI sequences not in sequence databases, and redirect RefSeq accession requests sent to EMBL.
- Returns: (blank)
- Args:
$id(s),$string - Throws: if accessionn number indicates whole chromosome NCBI sequence (yes, "accessionn", we're keeping it, it's part of the lore π«Ά)
And that's the whole page, bestie!! π¦ This was Bio::D...ioFetch(3pm), brought to you by perl v5.32.1 and dated 2021-03-01. Go fetch some sequences. You got this. πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libbio-db-biofetch-perl 1.7.3-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-db-biofetch-perl 1.7.3-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-db-biofetch-perl 1.7.3-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-db-biofetch-perl 1.7.3-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbio-db-biofetch-perl 1.7.3-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbio-db-biofetch-perl 1.7.3-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms