Use CXGN::Cview::Config in bin/re-generate-overview.pl
[cview.git] / bin / re-generate-overview.pl
blobe537a6b38b00dfcaa8ea9c49d3a45d12ccedd38c
2 =head1 NAME
4 re-generate-overview.pl - regenerates the small progress overview image on the homepage
6 =head1 DESCRIPTION
8 This is a quick hack to generate the overview diagram for mirror sites. Needs to be run on the actual production system.
10 =head1 AUTHOR
12 Lukas Mueller <lam87@cornell.edu>
14 =cut
16 use strict;
17 use warnings;
18 use Carp;
19 use CXGN::Cview::Map_overviews;
20 use CXGN::Cview::Map_overviews::ProjectStats;
21 use CXGN::Cview::Config;
23 my $vhost = CXGN::Cview::Config->new();
25 print STDERR "Generating new overview object...\n";
26 my $map_overview = CXGN::Cview::Map_overviews::ProjectStats->new("force"); # force re-calculation of the image/stats
28 print STDERR "Setting the parameters for the small overview...\n";
29 # also generate a smaller version of the image that can be
30 # used on the homepage.
32 $map_overview->set_image_width(400);
33 $map_overview->set_image_height(100);
34 $map_overview->set_chr_height(50);
35 $map_overview->set_horizontal_spacing(30);
37 print STDERR "Creating the file...\n";
38 my $url = "/documents/tempfiles/frontpage/project_stats_overview.png";
39 my $path = File::Spec->catfile($vhost->get_conf("basepath"), $url);
41 print STDERR "File name is: $path\n";
42 $map_overview->set_temp_file($url, $path);
43 $map_overview->render_map();
44 $map_overview->get_file_png();
46 print STDERR "Done.";