annotate get_terms_by_relationship_type.pl @ 0:c5b1acc3c42c draft

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:32:28 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
1 #!/usr/bin/perl
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
2
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
3 eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
4 if 0; # not running under some shell
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
5
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
6 use Carp;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
7 use strict;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
8 use warnings;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
9 use Encode;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
10
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
11 use OBO::Parser::OBOParser;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
12
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
13 my $my_parser = OBO::Parser::OBOParser->new();
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
14 my $ontology = $my_parser->work(shift(@ARGV));
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
15 my $rel_type_name = shift(@ARGV);
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
16 my @relationships = @{$ontology->get_relationships()};
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
17
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
18 foreach my $r (@relationships) {
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
19 if($r->type() eq $rel_type_name){
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
20 print $r->tail()->id(), "\t";
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
21 print $r->type(),"\t";
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
22 print $r->head()->id(), "\n";
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
23 }
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
24 }
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
25
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
26 exit 0;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
27
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
28 __END__