Created
December 17, 2013 10:04
-
-
Save avrilcoghlan/8002675 to your computer and use it in GitHub Desktop.
Perl script to use the Ensembl Compara Perl API to print the sequence of the Member corresponding to SwissProt protein O93279
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Print the sequence of the Member corresponding to SwissProt protein O93279 | |
use strict; | |
use warnings; | |
use Bio::EnsEMBL::Registry; | |
my $registry = 'Bio::EnsEMBL::Registry'; | |
$registry->load_registry_from_db( | |
-host => 'ensembldb.ensembl.org', | |
-user => 'anonymous' | |
); | |
# get the Bio::EnsEMBL::Compara::SeqMember for the SwissProt protein O93279 | |
my $sma = $registry->get_adaptor("multi", "compara", "seqmember"); | |
my $seqmember = $sma->fetch_by_source_stable_id("Uniprot/SWISSPROT", "O93279"); | |
# get the stable id. for protein O93279 | |
my $stable_id = $seqmember->stable_id(); | |
print "stable id. is: $stable_id\n"; | |
# get the sequence for protein O93279 | |
my $sequence = $seqmember->sequence(); | |
print "sequence is:\n$sequence\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment