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