Skip to content
Snippets Groups Projects
Commit 8d080c6a authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

#-----------------------------------------------------------------------

# Demo program for the Ensembl ontology database and API.
#
# This program fetches a set of ontology terms by name and displays them
# on the console.
#-----------------------------------------------------------------------
parent b06264a5
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env perl
#-----------------------------------------------------------------------
# Demo program for the Ensembl ontology database and API.
#
# This program fetches a set of ontology terms by name and displays them
# on the console.
#-----------------------------------------------------------------------
use strict;
use warnings;
use Bio::EnsEMBL::Registry;
my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db( '-host' => 'ensembldb.ensembl.org',
'-user' => 'anonymous' );
my $pattern = '%splice_site%';
# Get an ontology term adaptor and a gene adaptor (for human).
my $adaptor =
$registry->get_adaptor( 'Multi', 'Ontology', 'OntologyTerm' );
# Fetch the terms by its accession.
my @terms = @{ $adaptor->fetch_all_by_name($pattern) };
foreach my $term (@terms) {
printf( "Accession = %s\tName = %s\n",
$term->accession(), $term->name() );
}
# $Id$
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment