annotate get_parent_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
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
7 use Carp;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
8 use strict;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
9 use warnings;
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 $term_id = 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 $rel_id = shift(@ARGV);
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 my $target_term = $ontology->get_term_by_id($term_id);
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
19 my @rels = @{$ontology->get_relationships_by_source_term($target_term, $rel_id)};
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
20
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
21 foreach my $r (@rels) {
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
22 # print "rel: ", $r->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 print $r->head()->id();
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
24 # print "tail: ", $r->tail()->id(), "\n\n";
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
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
27 exit 0;
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
28 __END__
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
29
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
30
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
31
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
32
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
33
c5b1acc3c42c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/onto-toolkit commit 9422f839ae354d4c26b02d4494abdeaad518d0e6
iuc
parents:
diff changeset
34