Bio::D...ssProt(3pm)
π Bio::DB::SwissProt π
Okay bestie, sit down, hydrate, because today we're talking about Bio::DB::SwissProt β the database object interface to SwissProt retrieval. It's a Perl module, it lives in the Bioperl universe, and it's basically your VIP pass into a whole curated protein database. No cap. π¦
β¨ NAME β¨
Bio::DB::SwissProt β database object interface to SwissProt retrieval. That's it, that's the whole name. Short, iconic, does exactly what it says on the tin. π
π SYNOPSIS π
Here's the whole vibe in code, literally untouched because I would never mess with your copy-paste:
use Bio::DB::SwissProt;
$sp = Bio::DB::SwissProt->new();
$seq = $sp->get_Seq_by_id('KPY1_ECOLI'); # SwissProt ID
# <4-letter-identifier>_<species 5-letter code>
# or ...
$seq = $sp->get_Seq_by_acc('P43780'); # SwissProt AC
# [OPQ]xxxxx
# In fact in this implementation
# these methods call the same webscript so you can use
# then interchangeably
# choose a different server to query
$sp = Bio::DB::SwissProt->new('-servertype' => 'expasy',
'-hostlocation' => 'us');
$seq = $sp->get_Seq_by_id('BOLA_HAEIN'); # SwissProtID
So real talk: the ID looks like <4-letter-identifier>_<species 5-letter code>, and the accession number (AC) looks like [OPQ]xxxxx. And the tea is that in this implementation, both of those methods hit the same webscript, so you can genuinely use them interchangeably. Choose your own adventure. π«Ά
π DESCRIPTION π
SwissProt is a curated database of proteins managed by the Swiss Bioinformatics Institute. Extra tools for parsing and manipulating swissprot files live at:
ftp://ftp.ebi.ac.uk/pub/software/swissprot/Swissknife/
What this module does: it allows the dynamic retrieval of Sequence objects (Bio::Seq) from the SwissProt database via an Expasy retrieval. Very demure, very mindful, very protein.
And here's the design choice that ate: to make changes transparent, host type (currently only expasy) and location (defaults to Switzerland) are separated out. So you get to pick the closest Expasy mirror for running your queries. Main character energy: your queries, your mirror, your rules. β¨
π FEEDBACK π
Mailing Lists π¬
User feedback is 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. Truly.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support π«Ά
Please direct usage questions and support issues to the mailing list:
bioperl-l@bioperl.org
...rather than to the module maintainer directly. There are lots of experienced and responsive experts who will be able to look at the problem and quickly address it. And please include a thorough description of the problem with code and data examples if at all possible β help them help you, bestie. π₯Ί
Reporting Bugs π
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
π AUTHOR - Jason Stajich π
Email Jason Stajich <jason@bioperl.org <
Thanks go to Alexandre Gattiker <gattiker@isb-sib.ch> of Swiss Institute of Bioinformatics for helping point us in the direction of the correct expasy scripts and for swissknife references. King behaviour. π
Also thanks to Heikki Lehvaslaiho <heikki-at-bioperl-dot-org> for help with adding the EBI swall server. π
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ β that's your heads up that they're the backstage crew, not the performers. π
Routines from Bio::DB::RandomAccessI π§
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
Give it a name, get back a Bio::Seq object. If the id isn't a thing? It throws the "id does not exist" exception. It's giving honesty. π
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
Same energy, but you're looking things up by accession number instead. Bad accession = "acc does not exist" exception, no drama, just facts. β¨
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
One id is cute, but a whole array of unique identifiers? Now we're streaming. You get a Bio::SeqIO stream object. π
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
Note : For GenBank, this just calls the same code for get_Stream_by_id()
Bulk accession-number retrieval, also returning a Bio::SeqIO stream object. And heads up on that Note: for GenBank, this just calls the same code as get_Stream_by_id(). Efficient queen. π
get_Stream_by_batch
Title : get_Stream_by_batch
Usage : $seq = $db->get_Stream_by_batch($ref);
Function: Retrieves Seq objects from SwissProt 'en masse', rather than one
at a time. This is implemented the same way as get_Stream_by_id,
but is provided here in keeping with access methods of NCBI
modules.
Example :
Returns : a Bio::SeqIO stream object
Args : $ref : either an array reference, a filename, or a filehandle
from which to get the list of unique ids/accession numbers.
This one grabs Seq objects from SwissProt 'en masse' instead of one at a time. It's implemented the same way as get_Stream_by_id, but it's hanging out here to stay consistent with the access methods of NCBI modules. And look at those Args β you can hand it an array reference, a filename, or a filehandle to get your list of unique ids/accession numbers. Versatile. π
β οΈ NOTE: deprecated API. Use get_Stream_by_id() instead. Like, it still exists, but it's the ex you don't text back. Use the replacement.
Implemented Routines from Bio::DB::WebDBSeqI interface π₯
get_request
Title : get_request
Usage : my $url = $self->get_request
Function: returns a HTTP::Request object
Returns :
Args : %qualifiers = a hash of qualifiers (ids, format, etc)
Returns an HTTP::Request object. Note that Returns is just... empty up there. It said what it said. π
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
This is the glow-up step β it processes downloaded data before loading it into a Bio::SeqIO. Returns void, takes a hash with two keys: 'type' (either 'string' or 'file') and 'location' (either a file location or a string reference containing data). π
default_format
Title : default_format
Usage : my $format = $self->default_format
Function: Returns default sequence format for this module
Returns : string
Args : none
Returns the default sequence format for this module, as a string. No args, no stress. π
Bio::DB::SwissProt specific routines πΈ
servertype
Title : servertype
Usage : my $servertype = $self->servertype
$self->servertype($servertype);
Function: Get/Set server type
Returns : string
Args : server type string [optional]
Get and set the server type. Pass the server type string if you want to set it β it's optional, so it's giving flexible. π¦
hostlocation
Title : hostlocation
Usage : my $location = $self->hostlocation()
$self->hostlocation($location)
Function: Set/Get Hostlocation
Returns : string representing hostlocation
Args : string specifying hostlocation [optional]
Set or get the host location. Returns a string representing the hostlocation, and yes, the argument is optional here too. Pick your mirror, live your life. β¨
location_url
Title : location
Usage : my $url = $self->location_url()
Function: Get host url
Returns : string representing url
Args : none
Gets the host URL, returning a string representing the url. (Fun fact: the Title up there says location while the method is location_url β I'm just reporting what the page says, bestie.) π
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
Get or set the sequence format retrieval. The get-form normally won't be used outside of this module and its derived modules β so it's kind of an internal thing, iykyk. It returns an array of two strings: first one is the format for retrieval, second one is the corresponding SeqIO format. And you can set it to "genbank" or "fasta". π§¬
idtracker
Title : idtracker
Usage : my ($newid) = $self->idtracker($oldid);
Function: Retrieve new ID using old ID.
Returns : single ID if one is found
Args : ID to look for
Old ID in, new ID out. Returns a single ID if one is found. Glow-up but for identifiers. β¨
id_mapper
Title : id_tracker
Usage : my $map = $self->id_mapper( -from => '',
-to => '',
-ids => \@ids);
Function: Retrieve new ID using old ID.
Returns : hash reference of successfully mapped IDs
Args : -from : database mapping from
-to : database mapped to
-ids : a single ID or array ref of IDs to map
Note : For a list of valid database IDs, see:
http://www.uniprot.org/faq/28#id_mapping_examples
This one maps a whole batch: -from is the database you're mapping from, -to is the database you're mapping to, and -ids is a single ID or an array ref of IDs to map. You get back a hash reference of successfully mapped IDs. (And yes, the Title field says id_tracker even though the method is id_mapper β again, just relaying the page, no edits. π)
π Note: for a list of valid database IDs, see http://www.uniprot.org/faq/28#id_mapping_examples.
And that's the whole page, bestie. This manual came to you from User Contributed Perl Documentation, generated with perl v5.30.0 and dated 2020-01-01. Go forth and retrieve your proteins. π«Άβ¨π§¬
π¦ where this page comes from
- debian bookworm: libbio-db-swissprot-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-db-swissprot-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-db-swissprot-perl 1.7.4-1 Β· 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