This file is indexed.

/usr/share/perl5/GO/Basic.pm is in libgo-perl 0.15-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# $Id: Basic.pm,v 1.4 2005/03/30 21:15:48 cmungall Exp $
#
#
# see also - http://www.geneontology.org
#          - http://www.godatabase.org/dev
#
# You may distribute this module under the same terms as perl itself

=head1 NAME

  GO::Basic     - basic procedural interface to go-perl

=head1 SYNOPSIS

  use GO::Basic;
  parse_obo(shift @ARGV);
  find_term(name=>"cytosol");
  print $term->acc();                 # OO usage
  print acc();                        # procedural usage
  get_parent;
  print name();
  

=head1 DESCRIPTION

=cut

package GO::Basic;

use Exporter;

use Carp;
use GO::Model::Graph;
use GO::Parser;
use FileHandle;
use strict;
use base qw(GO::Model::Root Exporter);
use vars qw(@EXPORT);

our $graph;
our $terms;
our $term;

@EXPORT =
  qw(
     parse
     parse_obo
     parse_goflat
     parse_def
     parse_assoc
     term
     terms
     acc
     accs
     name
     names
     graph
     find_term
     find_terms
     get_parents
     get_rparents
     get_children
     get_rchildren
    );

sub parse_obo { parse(@_, {fmt=>'obo'}) }
sub parse_goflat { parse(@_, {fmt=>'go_ont'}) }
sub parse_def { parse(@_, {fmt=>'go_def'}) }
sub parse_assoc { parse(@_, {fmt=>'go_assoc'}) }

sub parse {
    my $opt = {format=>'obo'};
    my @files =
      map {
          if (ref($_)) {
              if (ref($_) eq 'HASH') {
                  my %h = %$_;
                  $opt->{$_} = $h{$_} foreach keys %h;
              }
              else {
                  throw("bad argument: $_");
              }
              ();
          }
          else {
              $_;
          }
      } @_;
    my $parser = GO::Parser->new({format=>$opt->{fmt}, 
                                  use_cache=>$opt->{use_cache},
                                  handler=>'obj'});
    $parser->parse($_) foreach @files;
    $graph = $parser->handler->graph;
    $graph;
}

sub find_terms {
    @_ < 1 && throw("must pass an argument!");
    my %constr = @_==1 ? (name=>shift) : @_;
    check_for_graph();
    $terms = $graph->term_query(\%constr);
    return $terms;
}

sub find_term {
    find_terms(@_);
    if (@$terms) {
        if (@$terms > 1) {
            message(">1 terms returned!");
        }
        $term = $terms->[0];
        return $term;
    }
    return;
}

sub term {
    check_for_term();
    return $term;
}

sub terms {
    check_for_terms();
    return @$terms;
}

sub next_term {
    $term = shift @$terms;
}

sub graph {
    check_for_graph();
    return $graph;
}

sub acc {
    check_for_term();
    return $term->acc;
}

sub accs {
    check_for_terms();
    return map {$_->acc} @$terms;
}

sub name {
    check_for_term();
    return $term->name;
}

sub names {
    check_for_terms();
    return map {$_->name} @$terms;
}


sub definition {
    check_for_term();
    return $term->definition;
}

sub check_for_term {
    $term || throw("no term selected!");
}
sub check_for_terms {
    $terms || throw("no term set selected!");
}
sub check_for_graph {
    $graph || throw("no graph selected!");
}

sub get_parents {
    check_for_graph();
    check_for_term();
    $terms = $graph->get_parent_terms($term->acc);
}

sub get_rparents {
    check_for_graph();
    check_for_term();
    $terms = $graph->get_recursive_parent_terms($term->acc);
}

sub get_children {
    check_for_graph();
    check_for_term();
    $terms = $graph->get_child_terms($term->acc);
}

sub get_rchildren {
    check_for_graph();
    check_for_term();
    $terms = $graph->get_recursive_child_terms($term->acc);
}

sub throw {
    confess "@_";
}

sub message {
    print STDERR "@_\n";
}

1;