Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
4c219bf2
Commit
4c219bf2
authored
Jan 06, 2011
by
Andreas Kusalananda Kähäri
Browse files
Update the ontology demo code.
parent
da0c3228
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
misc-scripts/ontology/scripts/demo1.pl
misc-scripts/ontology/scripts/demo1.pl
+7
-8
misc-scripts/ontology/scripts/demo2.pl
misc-scripts/ontology/scripts/demo2.pl
+3
-3
No files found.
misc-scripts/ontology/scripts/demo1.pl
View file @
4c219bf2
...
...
@@ -19,15 +19,15 @@ my $registry = 'Bio::EnsEMBL::Registry';
$registry
->
load_registry_from_db
(
'
-host
'
=>
'
ensembldb.ensembl.org
',
'
-user
'
=>
'
anonymous
'
);
my
$accession
=
'
GO:00
50825
';
my
$accession
=
'
GO:00
44430
';
# cytoskeletal part
# Get a
GO
term adaptor and a gene adaptor (for human).
# Get a
n ontology
term adaptor and a gene adaptor (for human).
my
$go_adaptor
=
$registry
->
get_adaptor
(
'
Multi
',
'
Ontology
',
'
G
OTerm
'
);
$registry
->
get_adaptor
(
'
Multi
',
'
Ontology
',
'
O
ntology
Term
'
);
my
$gene_adaptor
=
$registry
->
get_adaptor
(
'
Mouse
',
'
Core
',
'
Gene
'
);
my
$gene_adaptor
=
$registry
->
get_adaptor
(
'
Human
',
'
Core
',
'
Gene
'
);
# Fetch
a
GO term by its accession.
# Fetch
the
GO term by its accession.
my
$term
=
$go_adaptor
->
fetch_by_accession
(
$accession
);
# Use the GO term to get a bunch of genes cross-referenced to this GO
...
...
@@ -38,9 +38,8 @@ printf( "Genes associated with the term '%s' (%s):\n",
$term
->
accession
(),
$term
->
name
()
);
foreach
my
$gene
(
@genes
)
{
printf
(
"
stable ID = %s, external DB = %s, external name = %s
\n
",
$gene
->
stable_id
(),
$gene
->
external_db
(),
$gene
->
external_name
()
);
printf
(
"
stable ID = %s, external name = %s
\n
",
$gene
->
stable_id
(),
$gene
->
external_name
()
);
}
# $Id$
misc-scripts/ontology/scripts/demo2.pl
View file @
4c219bf2
...
...
@@ -48,11 +48,11 @@ my $registry = 'Bio::EnsEMBL::Registry';
$registry
->
load_registry_from_db
(
'
-host
'
=>
'
ensembldb.ensembl.org
',
'
-user
'
=>
'
anonymous
'
);
my
$accession
=
'
GO:00
30326
';
my
$accession
=
'
GO:00
44430
';
# cytoskeletal part
# Get a
GO
term adaptor.
# Get a
n ontology
term adaptor.
my
$go_adaptor
=
$registry
->
get_adaptor
(
'
Multi
',
'
Ontology
',
'
G
OTerm
'
);
$registry
->
get_adaptor
(
'
Multi
',
'
Ontology
',
'
O
ntology
Term
'
);
my
$term
=
$go_adaptor
->
fetch_by_accession
(
$accession
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment