annotate get_terms_by_relationship_type.pl @ 0:e3e11b9e7750 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:35:28 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e3e11b9e7750 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
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
2
e3e11b9e7750 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+"$@"}'
e3e11b9e7750 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
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
5
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
6 use Carp;
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
7 use strict;
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
8 use warnings;
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
9 use Encode;
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
10
e3e11b9e7750 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;
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
12
e3e11b9e7750 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();
e3e11b9e7750 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));
e3e11b9e7750 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);
e3e11b9e7750 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()};
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
17
e3e11b9e7750 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) {
e3e11b9e7750 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){
e3e11b9e7750 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";
e3e11b9e7750 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";
e3e11b9e7750 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";
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
23 }
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
24 }
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
25
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
26 exit 0;
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
27
e3e11b9e7750 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
28 __END__