Commit 7a8a0e9b authored by Leo Gordon's avatar Leo Gordon
Browse files

.txt output file format is also supported - you simply get your Unicode diagram in a file

parent b8d245bc
......@@ -84,19 +84,28 @@ sub main {
}
}
my $graph = Bio::EnsEMBL::Hive::Utils::Graph->new(
$self->{'pipeline'},
$self->{'config_files'} ? @{ $self->{'config_files'} } : ()
);
my $graphviz = $graph->build();
if($self->{'format'} eq 'txt') {
local *STDOUT;
if($self->{'dot_input'}) {
$graphviz->dot_input_filename( $self->{'dot_input'} );
}
open (STDOUT, '>', $self->{'output'}); # redirect STDOUT to $self->{'output'}
my $call = 'as_'.$self->{'format'};
$self->{'pipeline'}->print_diagram; # and capture the Unicode diagram in a text file
$graphviz->$call($self->{'output'});
} else {
my $graph = Bio::EnsEMBL::Hive::Utils::Graph->new(
$self->{'pipeline'},
$self->{'config_files'} ? @{ $self->{'config_files'} } : ()
);
my $graphviz = $graph->build();
if($self->{'dot_input'}) {
$graphviz->dot_input_filename( $self->{'dot_input'} );
}
my $call = 'as_'.$self->{'format'};
$graphviz->$call($self->{'output'});
}
} else {
$self->{'pipeline'}->print_diagram;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment