Mercurial > repos > iuc > onto_tk_get_terms
diff get_terms_by_relationship_type.pl @ 0:6c5e1431c7df draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
author | iuc |
---|---|
date | Fri, 10 Nov 2017 11:31:06 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get_terms_by_relationship_type.pl Fri Nov 10 11:31:06 2017 -0500 @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' + if 0; # not running under some shell + +use Carp; +use strict; +use warnings; +use Encode; + +use OBO::Parser::OBOParser; + +my $my_parser = OBO::Parser::OBOParser->new(); +my $ontology = $my_parser->work(shift(@ARGV)); +my $rel_type_name = shift(@ARGV); +my @relationships = @{$ontology->get_relationships()}; + +foreach my $r (@relationships) { + if($r->type() eq $rel_type_name){ + print $r->tail()->id(), "\t"; + print $r->type(),"\t"; + print $r->head()->id(), "\n"; + } +} + +exit 0; + +__END__