File: pathlist.pm

package info (click to toggle)
libgo-perl 0.13-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,404 kB
  • sloc: perl: 13,104; sh: 21; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 476 bytes parent folder | download | duplicates (8)
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
package GO::Handlers::pathlist;
use base qw(GO::Handlers::obj);
use strict;

sub e_obo {
    my $self = shift;
    my $g = $self->g;
    $self->export_graph($g);
}

sub export_graph {
    my $self = shift;
    my $g = shift;

    $g->iterate(sub {
		     my $n=shift->term;
		     my $paths = $g->paths_to_top($n->acc);
		     foreach my $path (@$paths) {
			 $self->print($n->acc . " ");
			 $self->print($path->to_text('acc'));
			 $self->print("\n");
		     }
		 });
}

1;