line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: GraphNodeInstance.pm,v 1.4 2004/11/29 20:18:16 cmungall Exp $ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# This GO module is maintained by Chris Mungall |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# see also - http://www.geneontology.org |
6
|
|
|
|
|
|
|
# - http://www.godatabase.org/dev |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package GO::Model::GraphNodeInstance; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
GO::Model::GraphNodeInstance - a graph node located in a tree |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$it = $graph->create_iterator; |
20
|
|
|
|
|
|
|
# returns a GO::Model::GraphIterator object |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
while (my $ni = $it->next_node_instance) { |
23
|
|
|
|
|
|
|
$depth = $ni->depth; |
24
|
|
|
|
|
|
|
$term = $ni->term; |
25
|
|
|
|
|
|
|
$reltype = $ni->parent_rel->type; |
26
|
|
|
|
|
|
|
printf |
27
|
|
|
|
|
|
|
"%s %8s Term = %s (%s) // depth=%d\n", |
28
|
|
|
|
|
|
|
"----" x $depth, |
29
|
|
|
|
|
|
|
$reltype, |
30
|
|
|
|
|
|
|
$term->name, |
31
|
|
|
|
|
|
|
$term->public_acc, |
32
|
|
|
|
|
|
|
$depth; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
see GO::Model::Graph |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
14
|
|
|
14
|
|
67
|
use Carp; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
1147
|
|
45
|
14
|
|
|
14
|
|
68
|
use strict; |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
387
|
|
46
|
14
|
|
|
14
|
|
65
|
use Exporter; |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
504
|
|
47
|
14
|
|
|
14
|
|
66
|
use GO::Utils qw(rearrange); |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
547
|
|
48
|
14
|
|
|
14
|
|
97
|
use GO::Model::Term; |
|
14
|
|
|
|
|
38
|
|
|
14
|
|
|
|
|
489
|
|
49
|
14
|
|
|
14
|
|
1575
|
use FileHandle; |
|
14
|
|
|
|
|
26443
|
|
|
14
|
|
|
|
|
119
|
|
50
|
14
|
|
|
14
|
|
6697
|
use Exporter; |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
505
|
|
51
|
14
|
|
|
14
|
|
74
|
use Data::Dumper; |
|
14
|
|
|
|
|
25
|
|
|
14
|
|
|
|
|
737
|
|
52
|
14
|
|
|
14
|
|
394
|
use vars qw(@EXPORT_OK %EXPORT_TAGS); |
|
14
|
|
|
|
|
23
|
|
|
14
|
|
|
|
|
760
|
|
53
|
|
|
|
|
|
|
|
54
|
14
|
|
|
14
|
|
71
|
use base qw(GO::Model::Root Exporter); |
|
14
|
|
|
|
|
28
|
|
|
14
|
|
|
|
|
2758
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _valid_params { |
57
|
4999
|
|
|
4999
|
|
21676
|
return qw(term path depth parent_rel blocked); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 term |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Usage - |
63
|
|
|
|
|
|
|
Returns - GO::Model::Term |
64
|
|
|
|
|
|
|
Args - |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
see L |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 depth |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Usage - |
73
|
|
|
|
|
|
|
Returns - int |
74
|
|
|
|
|
|
|
Args - |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 parent_rel |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Usage - |
81
|
|
|
|
|
|
|
Returns - GO::Model::Relationship |
82
|
|
|
|
|
|
|
Args - |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
see L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
#=head2 block |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# Usage - |
92
|
|
|
|
|
|
|
# Returns - |
93
|
|
|
|
|
|
|
# Args - |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
#blocking a node instance will stop the graph iterator going below this one |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
#=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
#sub block { |
100
|
|
|
|
|
|
|
# my $self = shift; |
101
|
|
|
|
|
|
|
# $self->blocked(1); |
102
|
|
|
|
|
|
|
#} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub _initialize { |
105
|
492
|
|
|
492
|
|
1201
|
my $self = shift; |
106
|
492
|
|
|
|
|
1410
|
$self->SUPER::_initialize(@_); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |