Bio::DB::RefSeq(3pm)

πŸ“¦
version 1.7.4 Β· 2 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– Bio::DB::RefSeq πŸ’–

hey bestie, welcome to Bio::DB::RefSeq β€” one of those User Contributed Perl Documentation pages from the BioPerl fam. it's giving "i fetch RefSeq sequences off the internet for you" and honestly? iconic. let's get into it 🫢


✨ NAME ✨

Bio::DB::RefSeq β€” it's a Database object interface for RefSeq retrieval, no cap. that's the whole vibe. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's how you actually use it. read it slow, it's not that deep:

use Bio::DB::RefSeq;

$db = Bio::DB::RefSeq->new();

# most of the time RefSeq_ID eq RefSeq acc
$seq = $db->get_Seq_by_id('NM_006732'); # RefSeq ID
print "accession is ", $seq->accession_number, "\n";

# or changeing to accession number and Fasta format ...
$db->request_format('fasta');
$seq = $db->get_Seq_by_acc('NM_006732'); # RefSeq ACC
print "seq is ", $seq->seq, "\n";

# especially when using versions, you better be prepared
# in not getting what what want
eval {
    $seq = $db->get_Seq_by_version('NM_006732.1'); # RefSeq VERSION
};
print "accesion is ", $seq->accession_number, "\n" unless $@;

# or ... best when downloading very large files, prevents
# keeping all of the file in memory

# also don't want features, just sequence so let's save bandwidth
# and request Fasta sequence
$db = Bio::DB::RefSeq->new(-retrievaltype => 'tempfile' ,
                             -format => 'fasta');
my $seqio = $db->get_Stream_by_id(['NM_006732', 'NM_005252'] );
while( my $seq  =  $seqio->next_seq ) {
      print "seqid is ", $seq->id, "\n";
}

so basically: new() to build your db object, get_Seq_by_id for the RefSeq ID, get_Seq_by_acc when you're working with the accession, and get_Seq_by_version when you're feeling spicy and using versions (and yes, wrap that one in eval β€” see the comment, sometimes you just don't get what you want 😭). and when the files are HUGE, switch -retrievaltype to 'tempfile' and -format to 'fasta' so you're not holding the whole thing in memory. stream it, don't hoard it. periodt.


🌸 DESCRIPTION 🌸

so what does this thing actually DO. it lets you dynamically retrieve sequence objects β€” Bio::Seq, specifically β€” out of the RefSeq nucleotide database, using the dbfetch script over at EBI:

http://www.ebi.ac.uk/Tools/dbfetch/dbfetch

as of right now, this module retrieves nucleotide sequences only. that's the whole menu. 🧚

to keep changes transparent, the author split out host type (currently only ebi) and location (defaults to ebi). the glow-up here is that later on, more servers in different geographical locations can get added. forward thinking, we love to see it. ✨

the functionality of this module is inherited from Bio::DB::DBFetch, which implements Bio::DB::WebDBSeqI. so it's standing on the shoulders of giants, lowkey.

and here's a lil caveat, bestie, listen up: this module retrieves entries from EBI even though the database entries it grabs were produced at NCBI. when they get read into bioperl objects, the parser for GenBank format it used. RefSeq is a NONSTANDARD GenBank file so be ready for surprises. πŸ‘€

not me warning you that your data might be weird. it might be weird. be ready.

πŸ’Œ FEEDBACK πŸ’Œ

Mailing Lists

user feedback is an integral part of the evolution of this and other Bioperl modules. so like, 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

okay so for usage questions and support issues, please direct them to the mailing list:

bioperl-l@bioperl.org

rather than going straight to the module maintainer. the reason is that there are many experienced and reponsive experts who can look at your problem and quickly address it. and bestie, please include a thorough description of the problem with code and data examples if at all possible. the more context, the faster the fix. πŸ™

πŸ› Reporting Bugs

report bugs to the Bioperl bug tracking system so we can keep track the bugs and their resolution. bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

go forth and file them. it's a public service. πŸ’…


πŸ‘‘ AUTHOR - Heikki Lehvaslaiho πŸ‘‘

email Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>


πŸ“Ž APPENDIX πŸ“Ž

the rest of the documentation details each of the object methods. internal methods are usually preceded with a _ β€” that's your lil tell, iykyk. πŸ”


and that's the whole page, bestie!! this absolute classic shipped as perl v5.30.0, dated 2019-12-30, and it lives under Bio::DB::RefSeq(3pm) β€” go forth, fetch some sequences, and slay πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from