3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
38 $registry->get_adaptor(
'Multi',
'Ontology',
'OntologyTerm' );
42 my @children = @{ $goa->fetch_all_by_parent_term($term) };
43 my @descendants = @{ $goa->fetch_all_by_ancestor_term($term) };
45 my @parents = @{ $goa->fetch_all_by_child_term($term) };
46 my @ancestors = @{ $goa->fetch_all_by_descendant_term($term) };
48 my %ancestor_chart = %{ $goa->_fetch_ancestor_chart($term) };
52 An
abstract adaptor
class for fetching ontology
53 terms, creates
Bio::EnsEMBL::OntologyTerm objects.
64 use DBI qw( :sql_types );
71 use base qw( Bio::EnsEMBL::DBSQL::BaseAdaptor );
73 =head2 fetch_all_by_name
75 Arg [1] : String, name of term, or SQL pattern
76 Arg [2] : (optional) String, name of ontology
77 Arg [3] : (optional) Boolean, search through obsolete terms as well
79 Description : Fetches ontology term(s) given a name, a synonym, or a
80 SQL pattern like "%splice_site%"
85 @{ $ot_adaptor->fetch_by_name(
'DNA_binding_site',
'SO' ) };
87 # Will find terms in both SO and GO:
88 my @terms = @{ $ot_adaptor->fetch_by_name(
'%splice_site%') };
94 sub fetch_all_by_name {
95 my ( $this, $pattern, $ontology, $include_obsolete ) = @_;
108 ontology.data_version
110 JOIN term USING (ontology_id)
111 LEFT JOIN synonym USING (term_id)
112 WHERE ( term.name LIKE ? OR synonym.name LIKE ? ));
114 if ( defined($ontology) ) {
115 $statement .=
" AND ontology.name = ?";
117 $statement .=
" AND term.is_obsolete = 0" unless $include_obsolete;
119 my $sth = $this->prepare($statement);
120 $sth->bind_param( 1, $pattern, SQL_VARCHAR );
121 $sth->bind_param( 2, $pattern, SQL_VARCHAR );
123 if ( defined($ontology) ) {
124 $sth->bind_param( 3, $ontology, SQL_VARCHAR );
129 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $namespace, $ontology_version );
131 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version ) );
135 while ( $sth->fetch() ) {
142 '-accession' => $accession,
143 '-is_root' => $is_root,
144 '-is_obsolete' => $is_obsolete,
145 '-ontology' => $ontology,
146 '-ontology_version' => $ontology_version,
147 '-namespace' => $namespace,
148 '-subsets' => [ split( /,/, $subsets ) ],
150 '-definition' => $definition,
151 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
157 } ## end sub fetch_all_by_name
160 =head2 fetch_by_accession
163 Arg [2] : (optional) Boolean, search through obsolete terms as well
165 Description : Fetches an ontology term given an
accession.
169 my $term = $ot_adaptor->fetch_by_accession(
'GO:0030326');
175 sub fetch_by_accession {
176 my ( $this, $accession, $include_obsolete ) = @_;
188 ontology.data_version
190 JOIN term USING (ontology_id)
191 WHERE term.accession = ?);
193 $statement .=
" AND term.is_obsolete = 0" unless $include_obsolete;
195 my $sth = $this->prepare($statement);
196 $sth->bind_param( 1, $accession, SQL_VARCHAR );
200 my ( $dbid, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version );
202 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version ) );
209 $term = $this->fetch_by_alt_id($accession);
217 '-accession' => $accession,
218 '-is_root' => $is_root,
219 '-is_obsolete'=> $is_obsolete,
220 '-ontology' => $ontology,
221 '-ontology_version' => $ontology_version,
222 '-namespace' => $namespace,
223 '-subsets' => [ split( /,/, $subsets ) ],
225 '-definition' => $definition,
226 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
231 } ## end sub fetch_by_accession
234 =head2 fetch_by_alt_id
238 Description : Fetches an ontology term given an alt_id.
242 my $term = $ot_adaptor->fetch_by_alt_id(
'GO:0019952');
248 sub fetch_by_alt_id {
249 my ( $this, $accession ) = @_;
261 ontology.data_version
263 JOIN term USING (ontology_id)
264 JOIN alt_id USING (term_id)
265 WHERE alt_id.accession = ?);
267 my $sth = $this->prepare($statement);
268 $sth->bind_param( 1, $accession, SQL_VARCHAR );
272 my ( $dbid, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version );
274 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version ) );
278 # early exit in the event of bad $accession
279 unless ($dbid) {
return;}
286 '-accession' => $accession,
287 '-ontology' => $ontology,
288 '-ontology_version' => $ontology_version,
289 '-namespace' => $namespace,
290 '-subsets' => [ split( /,/, $subsets ) ],
292 '-definition' => $definition,
293 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
298 } ## end sub fetch_by_alt_id
302 =head2 fetch_all_by_parent_term
305 The term whose children terms should be fetched.
307 Description : Given a parent ontology term, returns a list of
308 its immediate children terms.
313 @{ $ot_adaptor->fetch_all_by_parent_term($term) };
319 sub fetch_all_by_parent_term {
320 my ( $this, $term, $ontology, $include_obsolete ) = @_;
322 assert_ref( $term,
'Bio::EnsEMBL::OntologyTerm' );
326 if ( !$term->{
'child_terms_fetched'} ) {
328 SELECT child_term.term_id,
329 child_term.accession,
331 child_term.definition,
334 child_term.is_obsolete,
336 ontology.data_version
338 JOIN relation ON (relation.child_term_id = child_term.term_id)
339 JOIN relation_type rt USING (relation_type_id)
340 JOIN ontology ON (ontology.ontology_id = relation.ontology_id)
341 WHERE relation.parent_term_id = ?
342 AND ontology.name = ?);
344 $statement .=
" AND child_term.is_obsolete = 0" unless $include_obsolete;
346 my $sth = $this->prepare($statement);
347 $sth->bind_param( 1, $term->dbID(), SQL_INTEGER );
349 if (!defined $ontology) {
350 $ontology = $term->{
'ontology'};
352 $sth->bind_param( 2, $ontology, SQL_VARCHAR );
357 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $relation, $ontology_version );
359 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $relation, $ontology_version ) );
361 while ( $sth->fetch() ) {
368 '-accession' => $accession,
369 '-is_root' => $is_root,
370 '-is_obsolete' => $is_obsolete,
371 '-ontology' => $term->{
'ontology'},
372 '-ontology_version' => $ontology_version,
373 '-namespace' => $term->{
'namespace'},
374 '-subsets' => [ split( /,/, $subsets ) ],
376 '-definition' => $definition,
377 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
380 push( @terms, $child_term );
381 push( @{ $term->{
'children'}{$relation} }, $child_term );
384 $term->{
'child_terms_fetched'} = 1;
386 foreach my $relation ( values( %{ $term->{
'children'} } ) ) {
387 push( @terms, @{$relation} );
392 } ## end sub fetch_all_by_parent_term
394 =head2 fetch_all_by_ancestor_term
397 The term whose descendant terms should be fetched.
399 Description : Given a parent ontology term, returns a list of
400 all its descendant terms, down to and including
401 any leaf terms. Relations of the type
'is_a' and
402 'part_of' are followed.
407 @{ $ot_adaptor->fetch_all_by_ancestor_term($term) };
413 sub fetch_all_by_ancestor_term {
414 my ( $this, $term, $ontology ) = @_;
416 assert_ref( $term,
'Bio::EnsEMBL::OntologyTerm' );
421 child_term.accession,
423 child_term.definition,
426 child_term.is_obsolete,
427 ontology.data_version,
430 JOIN closure ON (closure.child_term_id = child_term.term_id)
431 JOIN ontology ON (closure.ontology_id = ontology.ontology_id)
432 WHERE closure.parent_term_id = ?
433 AND closure.distance > 0
434 AND closure.ontology_id = child_term.ontology_id
435 AND ontology.name = ?
436 ORDER BY closure.distance, child_term.accession);
438 my $sth = $this->prepare($statement);
439 $sth->bind_param( 1, $term->dbID(), SQL_INTEGER );
440 if (!defined $ontology) {
441 $ontology = $term->{
'ontology'};
443 $sth->bind_param( 2, $ontology, SQL_VARCHAR );
446 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology_version, $closure_distance );
448 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology_version, $closure_distance ) );
452 while ( $sth->fetch() ) {
459 '-accession' => $accession,
460 '-is_root' => $is_root,
461 '-is_obsolete' => $is_obsolete,
462 '-ontology' => $term->{
'ontology'},
463 '-ontology_version' => $ontology_version,
464 '-namespace' => $term->{
'namespace'},
465 '-subsets' => [ split( /,/, $subsets ) ],
467 '-definition' => $definition,
468 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
473 } ## end sub fetch_all_by_ancestor_term
475 =head2 fetch_all_by_child_term
478 The term whose parent terms should be fetched.
480 Description : Given a child ontology term, returns a list of
481 its immediate parent terms.
485 my @parents = @{ $ot_adaptor->fetch_all_by_child_term($term) };
491 sub fetch_all_by_child_term {
492 my ( $this, $term, $ontology ) = @_;
494 assert_ref( $term,
'Bio::EnsEMBL::OntologyTerm' );
498 if ( !$term->{
'parent_terms_fetched'} ) {
500 SELECT parent_term.term_id,
501 parent_term.accession,
503 parent_term.definition,
506 parent_term.is_obsolete,
508 ontology.data_version
509 FROM term parent_term
510 JOIN relation ON (relation.parent_term_id = parent_term.term_id)
511 JOIN relation_type rt USING (relation_type_id)
512 JOIN ontology ON (ontology.ontology_id = relation.ontology_id)
513 WHERE relation.child_term_id = ?
514 AND ontology.name = ?);
516 my $sth = $this->prepare($statement);
517 $sth->bind_param( 1, $term->dbID(), SQL_INTEGER );
519 if (!defined $ontology) {
520 $ontology = $term->{
'ontology'};
522 $sth->bind_param( 2, $ontology, SQL_VARCHAR );
526 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $relation, $ontology_version );
528 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $relation, $ontology_version ) );
530 while ( $sth->fetch() ) {
537 '-accession' => $accession,
538 '-is_root' => $is_root,
539 '-is_obsolete' => $is_obsolete,
540 '-ontology' => $term->{
'ontology'},
541 '-ontology_version' => $ontology_version,
542 '-namespace' => $term->{
'namespace'},
543 '-subsets' => [ split( /,/, $subsets ) ],
545 '-definition' => $definition,
546 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
549 push( @terms, $parent_term );
550 push( @{ $term->{
'parents'}{$relation} }, $parent_term );
553 $term->{
'parent_terms_fetched'} = 1;
555 foreach my $relation ( values( %{ $term->{
'parents'} } ) ) {
556 push( @terms, @{$relation} );
561 } ## end sub fetch_all_by_child_term
563 =head2 fetch_all_by_descendant_term
566 The term whose ancestor terms should be fetched.
568 Arg [2] : (optional) String
569 The subset within the ontolgy to which the query
570 should be restricted. The subset may be specified as
571 a SQL pattern, e.g.,
"%goslim%" (but
"goslim%" might
572 not
do what you expect), or as a specific subset name,
573 e.g.,
"goslim_generic".
575 Arg [3] : (optional) Boolean
576 If
true (non-zero), only
return the closest
577 term(s). If
this argument is
true, and the
578 previous argument is left undefined,
this method
579 will
return the parent(s) of the given term.
581 Arg [4] : (optional) Boolean
582 If
true we will allow the retrieval of terms whose distance
583 to the current term is 0. If
false then we will only
return
584 those which are above the current term in the ontology
586 Description : Given a child ontology term, returns a list of
587 all its ancestor terms, up to and including any
588 root term. Relations of the type
'is_a' and
589 'part_of' are followed. Optionally, only terms in
590 a given subset of the ontology may be returned,
591 and additionally one may ask to only get the
592 closest term(s) to the given child term.
597 @{ $ot_adaptor->fetch_all_by_descendant_term($term) };
603 sub fetch_all_by_descendant_term {
604 my ( $this, $term, $subset, $closest_only, $allow_zero_distance, $ontology ) = @_;
606 assert_ref( $term,
'Bio::EnsEMBL::OntologyTerm' );
613 parent_term.accession,
615 parent_term.definition,
618 parent_term.is_obsolete,
620 ontology.data_version
621 FROM term parent_term
622 JOIN closure ON (closure.parent_term_id = parent_term.term_id)
623 JOIN ontology ON (closure.ontology_id = ontology.ontology_id)
624 WHERE closure.child_term_id = ?
625 AND closure.distance > ?
626 AND closure.ontology_id = parent_term.ontology_id
627 AND ontology.name = ?);
629 if ( defined($subset) ) {
630 if ( index( $subset,
'%' ) != -1 ) {
632 AND parent_term.subsets LIKE ?);
635 AND FIND_IN_SET(?, parent_term.subsets) > 0);
640 ORDER BY closure.distance, parent_term.accession);
642 my $sth = $this->prepare($statement);
643 $sth->bind_param( 1, $term->dbID(), SQL_INTEGER );
644 my $query_distance = ($allow_zero_distance) ? -1 : 0;
645 $sth->bind_param( 2, $query_distance, SQL_INTEGER );
646 if (!defined $ontology) {
647 $ontology = $term->{
'ontology'};
649 $sth->bind_param( 3, $ontology, SQL_VARCHAR );
651 if ( defined($subset) ) {
652 $sth->bind_param( 4, $subset, SQL_VARCHAR );
657 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $distance, $ontology_version );
659 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $distance, $ontology_version ) );
664 while ( $sth->fetch() ) {
666 $min_distance ||= $distance;
668 if ( !$closest_only || $distance == $min_distance ) {
673 '-accession' => $accession,
674 '-is_root' => $is_root,
675 '-is_obsolete' => $is_obsolete,
676 '-ontology' => $term->{
'ontology'},
677 '-ontology_version' => $ontology_version,
678 '-namespace' => $term->{
'namespace'},
679 '-subsets' => [ split( /,/, $subsets ) ],
681 '-definition' => $definition,
682 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
691 } ## end sub fetch_all_by_descendant_term
693 sub _fetch_synonyms_by_dbID {
694 my ( $this, $dbID ) = @_;
699 WHERE synonym.term_id = ?);
701 my $sth = $this->prepare($statement);
702 $sth->bind_param( 1, $dbID, SQL_INTEGER );
707 $sth->bind_col( 1, \$synonym );
710 while ( $sth->fetch() ) {
711 push( @synonyms, $synonym );
719 =head2 _fetch_ancestor_chart
722 The term whose ancestor terms should be fetched.
724 Description : Given a child ontology term, returns a hash
725 structure containing its ancestor terms, up to and
726 including any root term. Relations of the type
727 'is_a' and
'part_of' are included.
731 my %chart = %{ $ot_adaptor->_fetch_ancestor_chart($term) };
733 Return type : A reference to a hash structure like
this:
742 # Similarly for all ancestors,
743 # and including the query term itself.
749 sub _fetch_ancestor_chart {
750 my ( $this, $term, $ontology ) = @_;
752 assert_ref( $term,
'Bio::EnsEMBL::OntologyTerm' );
755 SELECT subparent_term.term_id,
760 ON (relation.parent_term_id = closure.parent_term_id
761 AND relation.child_term_id = closure.subparent_term_id
762 AND closure.ontology_id = relation.ontology_id)
763 JOIN relation_type USING (relation_type_id)
764 JOIN term subparent_term
765 ON (subparent_term.term_id = closure.subparent_term_id)
766 JOIN term parent_term ON (parent_term.term_id = closure.parent_term_id)
767 JOIN ontology ON (ontology.ontology_id = closure.ontology_id)
768 WHERE closure.child_term_id = ?
769 AND ontology.name = ?
770 ORDER BY closure.distance);
772 my $sth = $this->prepare($statement);
773 $sth->bind_param( 1, $term->dbID(), SQL_INTEGER );
774 if (!defined $ontology) {
775 $ontology = $term->{
'ontology'};
777 $sth->bind_param( 2, $ontology, SQL_VARCHAR );
781 my ( $subparent_id, $parent_id, $relation );
782 $sth->bind_columns( \( $subparent_id, $parent_id, $relation ) );
787 while ( $sth->fetch() ) {
788 if ( !exists( $id_chart{$parent_id} ) ) {
789 $id_chart{$parent_id} = {};
791 push( @{ $id_chart{$subparent_id}{$relation} }, $parent_id );
794 my @terms = @{ $this->fetch_all_by_dbID_list( [ keys(%id_chart) ] ) };
796 foreach my $term (@terms) {
797 $id_chart{ $term->dbID() }{
'term'} = $term;
798 $acc_chart{ $term->accession() }{
'term'} = $term;
801 foreach my $term (@terms) {
802 my $accession = $term->accession();
803 my $dbID = $term->dbID();
805 foreach my $relation ( keys( %{ $id_chart{$dbID} } ) ) {
806 if ( $relation eq
'term' ) { next }
808 foreach my $id ( @{ $id_chart{$dbID}{$relation} } ) {
809 push( @{ $acc_chart{$accession}{$relation} },
810 $id_chart{$id}{
'term'} );
816 } ## end sub _fetch_ancestor_chart
818 #-----------------------------------------------------------------------
819 # Useful public methods that implement functionality not properly
820 # provided by the parent class Bio::EnsEMBL::DBSQL::BaseAdaptor.
823 my ( $this, $dbid, $include_obsolete ) = @_;
835 ontology.data_version
837 JOIN term USING (ontology_id)
838 WHERE term.term_id = ?);
840 $statement .=
" AND term.is_obsolete = 0" unless $include_obsolete;
842 my $sth = $this->prepare($statement);
843 $sth->bind_param( 1, $dbid, SQL_INTEGER );
847 my ( $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology,
848 $namespace, $ontology_version );
850 \( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version
855 unless ($accession) {
return;}
863 '-accession' => $accession,
864 '-is_root' => $is_root,
865 '-is_obsolete' => $is_obsolete,
866 '-ontology' => $ontology,
867 '-ontology_version' => $ontology_version,
868 '-namespace' => $namespace,
869 '-subsets' => [ split( /,/, $subsets ) ],
871 '-definition' => $definition,
872 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
877 } ## end sub fetch_by_dbID
879 sub fetch_all_by_dbID_list {
880 my ( $this, $dbids, $include_obsolete ) = @_;
882 if ( !@{$dbids} ) {
return [] }
894 ontology.data_version
896 JOIN term USING (ontology_id)
897 WHERE term.term_id IN (%s));
899 my $statement = sprintf(
904 $this->dbc()->db_handle()->quote( $_, SQL_INTEGER )
907 $statement .=
" AND term.is_obsolete = 0" unless $include_obsolete;
909 my $sth = $this->prepare($statement);
913 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology,
914 $namespace, $ontology_version );
915 $sth->bind_columns( \( $dbid, $accession, $name, $definition,
916 $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version ) );
920 while ( $sth->fetch() ) {
927 '-accession' => $accession,
928 '-is_root' => $is_root,
929 '-is_obsolete' => $is_obsolete,
930 '-ontology' => $ontology,
931 '-ontology_version' => $ontology_version,
932 '-namespace' => $namespace,
933 '-subsets' => [ split( /,/, $subsets ) ],
935 '-definition' => $definition,
936 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
941 } ## end sub fetch_all_by_dbID_list
944 =head2 fetch_all_alt_ids
948 Description : Fetches all alt_ids
for a given ontology term
953 @{ $ot_adaptor->fetch_all_alt_ids(
'GO:0000003' ) };
955 Return type : listref of accessions
958 sub fetch_all_alt_ids {
959 my ($this, $accession) = @_;
962 SELECT alt_id.accession
964 JOIN alt_id USING (term_id)
965 WHERE term.accession = ?);
967 my $sth = $this->prepare($statement);
968 $sth->bind_param(1, $accession, SQL_VARCHAR);
971 my (@accessions, $alt_id);
972 $sth->bind_columns( \$alt_id);
974 while ( $sth->fetch() ) {
975 push( @accessions, $alt_id);
984 =head2 fetch_all_roots
986 Arg [1] : (optional) String, name of ontology
988 Description : Fetches all roots
for all ontologies
989 Optionally, can be restricted to a given ontology
994 @{ $ot_adaptor->fetch_all_roots(
'SO' ) };
996 # Will find terms in EFO, SO and GO:
997 my @terms = @{ $ot_adaptor->fetch_all_roots() };
1003 sub fetch_all_roots {
1004 my ($this, $ontology_name) = @_;
1007 SELECT term.term_id,
1016 ontology.data_version
1018 JOIN term USING (ontology_id)
1021 if (defined $ontology_name) {
1022 $statement .=
" AND ontology.name = ?";
1025 my $sth = $this->prepare($statement);
1026 if (defined $ontology_name) {
1027 $sth->bind_param( 1, $ontology_name, SQL_VARCHAR );
1031 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology,
1032 $namespace, $ontology_version );
1033 $sth->bind_columns( \( $dbid, $accession, $name, $definition,
1034 $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version ) );
1038 while ( $sth->fetch() ) {
1044 '-adaptor' => $this,
1045 '-accession' => $accession,
1046 '-is_root' => $is_root,
1047 '-is_obsolete' => $is_obsolete,
1048 '-ontology' => $ontology,
1049 '-ontology_version' => $ontology_version,
1050 '-namespace' => $namespace,
1051 '-subsets' => [ split( /,/, $subsets ) ],
1053 '-definition' => $definition,
1054 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
1064 my ($this, $include_obsolete) = @_;
1067 SELECT term.term_id,
1076 ontology.data_version
1078 JOIN term USING (ontology_id));
1080 $statement .=
" WHERE term.is_obsolete = 0" unless $include_obsolete;
1082 my $sth = $this->prepare($statement);
1085 my ( $dbid, $accession, $name, $definition, $subsets, $is_root, $is_obsolete, $ontology,
1086 $namespace, $ontology_version );
1087 $sth->bind_columns( \( $dbid, $accession, $name, $definition,
1088 $subsets, $is_root, $is_obsolete, $ontology, $namespace, $ontology_version ) );
1092 while ( $sth->fetch() ) {
1098 '-adaptor' => $this,
1099 '-accession' => $accession,
1100 '-is_root' => $is_root,
1101 '-is_obsolete' => $is_obsolete,
1102 '-ontology' => $ontology,
1103 '-ontology_version' => $ontology_version,
1104 '-namespace' => $namespace,
1105 '-subsets' => [ split( /,/, $subsets ) ],
1107 '-definition' => $definition,
1108 '-synonyms' => $this->_fetch_synonyms_by_dbID($dbid)
1113 } ## end sub fetch_all