From f9fba079aafe8ee0d397378d614cfc1a593e566a Mon Sep 17 00:00:00 2001 From: Monika Komorowska <mk8@sanger.ac.uk> Date: Fri, 26 Aug 2011 14:46:16 +0000 Subject: [PATCH] Added test for ONTO-PERL version, for 1.31 and below use OBO::Core::Ontology->subset_def_set(), for 1.35 and above use OBO::Core::Ontology->subset_def_map() --- misc-scripts/ontology/scripts/load_OBO_file.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/misc-scripts/ontology/scripts/load_OBO_file.pl b/misc-scripts/ontology/scripts/load_OBO_file.pl index 6f5c496e3c..48bbda3801 100755 --- a/misc-scripts/ontology/scripts/load_OBO_file.pl +++ b/misc-scripts/ontology/scripts/load_OBO_file.pl @@ -458,8 +458,14 @@ EOT my ( %terms, %namespaces, %relation_types, %subsets ); my $default_namespace = $ontology->default_namespace(); -my $set = $ontology->subset_def_set(); -my @subsets = $set->get_set(); +my @subsets; +if ($OBO::Core::Ontology::VERSION <= 1.31) { + my $set = $ontology->subset_def_set(); + @subsets = $set->get_set(); +} else { + @subsets = $ontology->subset_def_map()->values(); +} + foreach my $subs (@subsets) { $subsets{$subs->name()}{'name'} = $subs->name(); $subsets{$subs->name()}{'definition'} = $subs->description(); -- GitLab