Skip to content
Snippets Groups Projects
Commit 649a4c36 authored by Patrick Meidl's avatar Patrick Meidl
Browse files

latest state of the code (mostly adaptations due to changes in ConfParser and Logger)

parent 8396a261
No related branches found
No related tags found
No related merge requests found
; for dry runs, no data is written to the database
dry_run = 1
; verbose logging
verbose = 1
; log level
loglevel = INFO
; prepend this path to your 'log' parameter
logpath = /ecs2/work2/pm2/logs/test_20060926
logpath = /lustre/work1/ensembl/pm2/logs/test_20070611
; old db settings
sourcehost = ecs2
sourceport = 3364
sourcehost = ens-research
sourceport = 3306
sourceuser = ensro
sourcedbname = homo_sapiens_core_41_36c
sourcedbname = pm2_pan_troglodytes_core_40_3c
; new db settings
targethost = ecs2
targetport = 3364
targethost = ens-research
targetport = 3306
targetuser = ensro
targetdbname = homo_sapiens_core_41_36c
targetdbname = pm2_pan_troglodytes_core_41_21
; cache
dumppath = /ecs2/scratch3/pm2/data/test_20060926
;region = chromosome:NCBI36:X:1:2000000:1
dumppath = /lustre/scratch1/ensembl/pm2/idmapping/out_20070611
region = chromosome:CHIMP1A:1:1:2000000:1
; ScoreBuilder
min_exon_length = 15
......
......@@ -23,8 +23,8 @@ Optional arguments:
--logfile, --log=FILE log to FILE (default: *STDOUT)
--logpath=PATH write logfile to PATH (default: .)
--logappend, --log_append append to logfile (default: truncate)
--loglevel=LEVEL define log level (default: INFO)
-v, --verbose=0|1 verbose logging (default: false)
-i, --interactive=0|1 run script interactively (default: true)
-n, --dry_run, --dry=0|1 don't write results to database
-h, --help, -? print help (this message)
......@@ -53,84 +53,41 @@ use warnings;
no warnings 'uninitialized';
use FindBin qw($Bin);
use vars qw($SERVERROOT);
BEGIN {
$SERVERROOT = "$Bin/../../..";
unshift(@INC, "$SERVERROOT/ensembl/modules");
unshift(@INC, "$SERVERROOT/bioperl-live");
}
use Getopt::Long;
use Pod::Usage;
use Bio::EnsEMBL::Utils::ConfParser;
use Bio::EnsEMBL::Utils::Logger;
use Bio::EnsEMBL::Utils::ScriptUtils qw(dynamic_use);
$| = 1;
# parse configuration and commandline arguments
my $conf = new Bio::EnsEMBL::Utils::ConfParser(
-SERVERROOT => $SERVERROOT,
-SERVERROOT => "$Bin/../../..",
-DEFAULT_CONF => "$Bin/default.conf"
);
# parse options
$conf->param('default_conf', './default.conf');
$conf->parse_common_options(@_);
$conf->parse_extra_options(qw(
sourcehost|source_host=s
sourceport|source_port=n
sourceuser|source_user=s
sourcepass|source_pass=s
sourcedbname|source_dbname=s
targethost|target_host=s
targetport|target_port=n
targetuser|target_user=s
targetpass|target_pass=s
targetdbname|target_dbname=s
dumppath|dump_path=s
biotypes=s@
dbtype=s
slice_name=s
cache_impl=s
));
$conf->allowed_params(
$conf->get_common_params,
qw(
sourcehost sourceport sourceuser sourcepass sourcedbname
targethost targetport targetuser targetpass targetdbname
dumppath biotypes
dbtype slice_name cache_impl
)
$conf->parse_options(
'sourcehost|source_host=s' => 1,
'sourceport|source_port=n' => 1,
'sourceuser|source_user=s' => 1,
'sourcepass|source_pass=s' => 0,
'sourcedbname|source_dbname=s' => 1,
'targethost|target_host=s' => 1,
'targetport|target_port=n' => 1,
'targetuser|target_user=s' => 1,
'targetpass|target_pass=s' => 0,
'targetdbname|target_dbname=s' => 1,
'dumppath|dump_path=s' => 1,
'biotypes=s@' => 0,
'dbtype=s' => 1,
'slice_name=s' => 1,
'cache_impl=s' => 1,
);
if ($conf->param('help') or $conf->error) {
warn $conf->error if $conf->error;
pod2usage(1);
}
# ask user to confirm parameters to proceed
$conf->confirm_params;
# get log filehandle and print heading and parameters to logfile
my $logger = new Bio::EnsEMBL::Utils::Logger(
-LOGFILE => $conf->param('logfile') || 'dump_by_seq_region.log',
-LOGPATH => $conf->param('logpath'),
-LOGAPPEND => $conf->param('logappend'),
-VERBOSE => $conf->param('verbose'),
-IS_COMPONENT => $conf->param('is_component'),
);
# initialise log
$logger->init_log($conf->list_all_params);
# check required parameters were set
$conf->check_required_params(
qw(
sourcehost sourceport sourceuser sourcedbname
targethost targetport targetuser targetdbname
dumppath
dbtype slice_name cache_impl
)
-LOGAPPEND => 1,
-LOGLEVEL => $conf->param('loglevel'),
-IS_COMPONENT => 1,
);
# build cache
......@@ -150,11 +107,11 @@ my $size = 0;
($i, $size) = $cache->build_cache($dbtype, $slice_name);
# set flag to indicate everything went fine
my $success_file = $conf->param('logpath')."/lsf/dump_by_seq_region.$dbtype.$slice_name.success";
my $success_file = $conf->param('logpath')."/lsf_dump_cache/dump_by_seq_region.$dbtype.$slice_name.success";
open(TMPFILE, '>', $success_file) and close TMPFILE
or die "Can't open $success_file for writing: $!";
# log success
$logger->log("Done with $dbtype $slice_name (genes: $i, filesize: $size, runtime: ".$logger->runtime." ".$logger->date_and_mem."\n");
$logger->info("Done with $dbtype $slice_name (genes: $i, filesize: $size, runtime: ".$logger->runtime." ".$logger->date_and_mem."\n");
......@@ -23,8 +23,8 @@ Optional arguments:
--logfile, --log=FILE log to FILE (default: *STDOUT)
--logpath=PATH write logfile to PATH (default: .)
--logappend, --log_append append to logfile (default: truncate)
--loglevel=LEVEL define log level (default: INFO)
-v, --verbose=0|1 verbose logging (default: false)
-i, --interactive=0|1 run script interactively (default: true)
-n, --dry_run, --dry=0|1 don't write results to database
-h, --help, -? print help (this message)
......@@ -63,97 +63,59 @@ use warnings;
no warnings 'uninitialized';
use FindBin qw($Bin);
use vars qw($SERVERROOT);
BEGIN {
$SERVERROOT = "$Bin/../../..";
unshift(@INC, "$SERVERROOT/ensembl/modules");
unshift(@INC, "$SERVERROOT/bioperl-live");
}
use Getopt::Long;
use Pod::Usage;
use Bio::EnsEMBL::Utils::ConfParser;
use Bio::EnsEMBL::Utils::Logger;
use Bio::EnsEMBL::Utils::ScriptUtils qw(dynamic_use);
$| = 1;
# parse configuration and commandline arguments
my $conf = new Bio::EnsEMBL::Utils::ConfParser(
-SERVERROOT => $SERVERROOT,
-SERVERROOT => "$Bin/../../..",
-DEFAULT_CONF => "$Bin/default.conf"
);
# parse options
$conf->param('default_conf', './default.conf');
$conf->parse_common_options(@_);
$conf->parse_extra_options(qw(
sourcehost|source_host=s
sourceport|source_port=n
sourceuser|source_user=s
sourcepass|source_pass=s
sourcedbname|source_dbname=s
targethost|target_host=s
targetport|target_port=n
targetuser|target_user=s
targetpass|target_pass=s
targetdbname|target_dbname=s
dumppath|dump_path=s
chromosomes|chr=s@
region=s
biotypes=s@
));
$conf->allowed_params(
$conf->get_common_params,
qw(
sourcehost sourceport sourceuser sourcepass sourcedbname
targethost targetport targetuser targetpass targetdbname
dumppath
chromosomes region biotypes
)
$conf->parse_options(
'sourcehost|source_host=s' => 1,
'sourceport|source_port=n' => 1,
'sourceuser|source_user=s' => 1,
'sourcepass|source_pass=s' => 0,
'sourcedbname|source_dbname=s' => 1,
'targethost|target_host=s' => 1,
'targetport|target_port=n' => 1,
'targetuser|target_user=s' => 1,
'targetpass|target_pass=s' => 0,
'targetdbname|target_dbname=s' => 1,
'dumppath|dump_path=s' => 1,
'chromosomes|chr=s@' => 0,
'region=s' => 0,
'biotypes=s@' => 0,
);
if ($conf->param('help') or $conf->error) {
warn $conf->error if $conf->error;
pod2usage(1);
}
# ask user to confirm parameters to proceed
$conf->confirm_params;
# get log filehandle and print heading and parameters to logfile
my $logger = new Bio::EnsEMBL::Utils::Logger(
-LOGFILE => $conf->param('logfile'),
-LOGPATH => $conf->param('logpath'),
-LOGAPPEND => $conf->param('logappend'),
-VERBOSE => $conf->param('verbose'),
-LOGLEVEL => $conf->param('loglevel'),
-IS_COMPONENT => $conf->param('is_component'),
);
# initialise log
$logger->init_log($conf->list_all_params);
# check required parameters were set
$conf->check_required_params(
qw(
sourcehost sourceport sourceuser sourcedbname
targethost targetport targetuser targetdbname
dumppath
)
);
$logger->init_log($conf->list_param_values);
my %jobs;
# create empty directory for logs
my $logpath = ($conf->param('logpath')||$conf->param('dumppath')).'/lsf_dump_cache';
my $logpath = ($conf->param('logpath') || $conf->param('dumppath')) .
'/lsf_dump_cache';
system("rm -rf $logpath") == 0 or
$logger->log_error("Unable to delete lsf log dir $logpath: $!\n");
$logger->error("Unable to delete lsf log dir $logpath: $!\n");
system("mkdir -p $logpath") == 0 or
$logger->log_error("Can't create lsf log dir $logpath: $!\n");
$logger->error("Can't create lsf log dir $logpath: $!\n");
# submit jobs to lsf
foreach my $dbtype (qw(source target)) {
$logger->log_stamped("\n".ucfirst($dbtype)." db...\n");
$logger->info("\n".ucfirst($dbtype)." db...\n", 0, 'stamped');
my $schema = $conf->param("${dbtype}schema") || 'latest';
my $cache_builder = "build_cache_$schema";
......@@ -178,22 +140,23 @@ while (keys %jobs) {
push @types, $type;
}
$logger->log("Jobs waiting: ".scalar(keys %jobs)."/$total.\r");
$logger->info("Jobs waiting: ".scalar(keys %jobs)."/$total.\r");
sleep(3) if (scalar(keys %jobs));
}
$logger->log("\n\n");
$logger->info("\n\n");
# check if anything went wrong
foreach my $type (@types) {
warn "$logpath/dump_by_seq_region.$type.success\n";
$err++ unless (-e "$logpath/dump_by_seq_region.$type.success");
}
my $retval = 0;
if ($err) {
$logger->log("At least one of your jobs failed.\n");
$logger->log("Please check $logpath and ".$conf->param('logpath')."/dump_by_seq_region.log for errors.\n");
$logger->warning("At least one of your jobs failed.\n");
$logger->warning("Please check $logpath and ".$conf->param('logpath')."/".$conf->param('logfile')." for errors.\n");
$retval = 1;
}
......@@ -221,7 +184,7 @@ sub build_cache_latest {
my $dba = $cache->get_DBAdaptor($dbtype);
my $sa = $dba->get_SliceAdaptor;
$logger->log("Submitting jobs to lsf...\n", 1);
$logger->info("Submitting jobs to lsf...\n", 1);
foreach my $slice_name (@{ $cache->slice_names($dbtype) }) {
&bsubmit($dbtype, $slice_name, $cache, $logpath);
......@@ -236,22 +199,18 @@ sub bsubmit {
my $cache = shift;
my $logpath = shift;
$logger->log("$slice_name\n", 2);
$logger->info("$slice_name\n", 2);
my $type = "$dbtype.$slice_name";
unless ($cache->all_cache_files_exist($type)) {
my $options = $conf->create_commandline_options(
-ALLOWED_PARAMS => 1,
-REPLACE => {
interactive => 0,
is_component => 1,
dbtype => $dbtype,
slice_name => $slice_name,
cache_impl => ref($cache),
log_append => 1,
},
-EXCLUDE => [qw(region chromosomes)]
interactive => 0,
is_component => 1,
dbtype => $dbtype,
slice_name => $slice_name,
cache_impl => ref($cache),
log_append => 1,
);
my $cmd = "bsub ".
......@@ -260,7 +219,7 @@ sub bsubmit {
"./dump_by_seq_region.pl $options";
system("$cmd") == 0
or $logger->log_error("Error running dump_by_seq_region.pl: $!");
or $logger->error("Error running dump_by_seq_region.pl: $!");
# mark job as submitted
$jobs{$type} = 1;
......
......@@ -23,8 +23,8 @@ Optional arguments:
--logfile, --log=FILE log to FILE (default: *STDOUT)
--logpath=PATH write logfile to PATH (default: .)
--logappend, --log_append append to logfile (default: truncate)
--loglevel=LEVEL define log level (default: INFO)
-v, --verbose=0|1 verbose logging (default: false)
-i, --interactive=0|1 run script interactively (default: true)
-n, --dry_run, --dry=0|1 don't write results to database
-h, --help, -? print help (this message)
......@@ -53,85 +53,47 @@ use warnings;
no warnings 'uninitialized';
use FindBin qw($Bin);
use vars qw($SERVERROOT);
BEGIN {
$SERVERROOT = "$Bin/../../..";
unshift(@INC, "$SERVERROOT/ensembl/modules");
unshift(@INC, "$SERVERROOT/bioperl-live");
}
use Getopt::Long;
use Pod::Usage;
use Bio::EnsEMBL::Utils::ConfParser;
use Bio::EnsEMBL::Utils::Logger;
use Bio::EnsEMBL::IdMapping::Cache;
use Bio::EnsEMBL::IdMapping::ExonScoreBuilder;
use Bio::EnsEMBL::IdMapping::TranscriptScoreBuilder;
use Bio::EnsEMBL::IdMapping::GeneScoreBuilder;
#use Devel::Size qw(size total_size);
#use Data::Dumper;
#$Data::Dumper::Indent = 1;
$| = 1;
# parse configuration and commandline arguments
my $conf = new Bio::EnsEMBL::Utils::ConfParser(
-SERVERROOT => $SERVERROOT,
-SERVERROOT => "$Bin/../../..",
-DEFAULT_CONF => "$Bin/default.conf"
);
# parse options
$conf->param('default_conf', './default.conf');
$conf->parse_common_options(@_);
$conf->parse_extra_options(qw(
mode=s
dumppath|dump_path=s
chromosomes|chr=s@
region=s
biotypes=s@
min_exon_length|minexonlength=i
exonerate_path|exoneratepath=s
exonerate_threshold|exoneratethreshold=i
exonerate_jobs|exoneratejobs=i
exonerate_bytes_per_job|exoneratebytesperjob=i
));
$conf->allowed_params(
$conf->get_common_params,
qw(
mode dumppath
chromosomes region biotypes
min_exon_length
exonerate_path exonerate_threshold exonerate_jobs exonerate_byte_per_job
)
$conf->parse_options(
'mode=s' => 0,
'dumppath|dump_path=s' => 1,
'chromosomes|chr=s@' => 0,
'region=s' => 0,
'biotypes=s@' => 0,
'min_exon_length|minexonlength=i' => 0,
'exonerate_path|exoneratepath=s' => 1,
'exonerate_threshold|exoneratethreshold=f' => 0,
'exonerate_jobs|exoneratejobs=i' => 0,
'exonerate_bytes_per_job|exoneratebytesperjob=f' => 0,
);
if ($conf->param('help') or $conf->error) {
warn $conf->error if $conf->error;
pod2usage(1);
}
# ask user to confirm parameters to proceed
$conf->confirm_params;
# get log filehandle and print heading and parameters to logfile
my $logger = new Bio::EnsEMBL::Utils::Logger(
-LOGFILE => $conf->param('logfile'),
-LOGPATH => $conf->param('logpath'),
-LOGAPPEND => $conf->param('logappend'),
-VERBOSE => $conf->param('verbose'),
-LOGLEVEL => $conf->param('loglevel'),
-IS_COMPONENT => $conf->param('is_component'),
);
# initialise log
$logger->init_log($conf->list_all_params);
# check required parameters were set
$conf->check_required_params(
qw(
dumppath
exonerate_path
)
);
$logger->init_log($conf->list_param_values);
# instance variables
......@@ -179,11 +141,15 @@ sub build_scores {
-CONF => $conf,
-CACHE => $cache
);
#my $gsb = Bio::EnsEMBL::IdMapping::GeneScoreBuilder->new(
my $gsb = Bio::EnsEMBL::IdMapping::GeneScoreBuilder->new(
-LOGGER => $logger,
-CONF => $conf,
-CACHE => $cache
);
$exon_scores = $esb->score_exons;
$transcript_scores = $tsb->score_transcripts;
#$gene_scores = $gsb->score_genes;
$transcript_scores = $tsb->score_transcripts($exon_scores);
$gene_scores = $gsb->score_genes($transcript_scores);
}
......@@ -191,7 +157,7 @@ sub build_scores {
# test memory consumption of cache after merging. used for debugging.
#
sub log_cache_stats {
$logger->log("\nCache memory usage:\n\n");
$logger->info("\nCache memory usage:\n\n");
my $s;
my %keys;
......@@ -211,26 +177,26 @@ sub log_cache_stats {
my $fmt = "%-50s%12.0f\n";
foreach my $k (sort { $keys{$a} <=> $keys{$b} } keys %keys) {
$logger->log(sprintf($fmt, $k, $keys{$k}), 1);
$logger->info(sprintf($fmt, $k, $keys{$k}), 1);
}
$logger->log(sprintf($fmt, "total overhead", $s), 1);
$logger->log(sprintf($fmt, "data", ($ts-$s)), 1);
$logger->log(sprintf($fmt, "total", $ts)."\n", 1);
$logger->info(sprintf($fmt, "total overhead", $s), 1);
$logger->info(sprintf($fmt, "data", ($ts-$s)), 1);
$logger->info(sprintf($fmt, "total", $ts)."\n", 1);
# test
my $i = 0;
foreach my $eid (keys %{ $cache->get_by_name('exons_by_id', 'target') }) {
last if ($i++ > 0);
$logger->log("\nData object memory usage:\n\n");
$logger->info("\nData object memory usage:\n\n");
my $exon = $cache->get_by_key('exons_by_id', 'target', $eid);
my $s1 = size($exon);
my $ts1 = total_size($exon);
$logger->log(sprintf($fmt, "object", $s1), 1);
$logger->log(sprintf($fmt, "data", ($ts1-$s1)), 1);
$logger->log(sprintf($fmt, "total", $ts1)."\n", 1);
$logger->info(sprintf($fmt, "object", $s1), 1);
$logger->info(sprintf($fmt, "data", ($ts1-$s1)), 1);
$logger->info(sprintf($fmt, "total", $ts1)."\n", 1);
print $exon->stable_id."\n";
#warn Data::Dumper::Dumper($exon);
......
......@@ -2,10 +2,11 @@
=head1 NAME
run_all.pl - wrapper script to run the stable ID mapping
=head1 SYNOPSIS
.pl [arguments]
run_all.pl [arguments]
Required arguments:
......@@ -23,8 +24,8 @@ Optional arguments:
--logfile, --log=FILE log to FILE (default: *STDOUT)
--logpath=PATH write logfile to PATH (default: .)
--logappend, --log_append append to logfile (default: truncate)
--loglevel=LEVEL define log level (default: INFO)
-v, --verbose=0|1 verbose logging (default: false)
-i, --interactive=0|1 run script interactively (default: true)
-n, --dry_run, --dry=0|1 don't write results to database
-h, --help, -? print help (this message)
......@@ -53,135 +54,80 @@ use warnings;
no warnings 'uninitialized';
use FindBin qw($Bin);
use vars qw($SERVERROOT);
BEGIN {
$SERVERROOT = "$Bin/../../..";
unshift(@INC, "$SERVERROOT/ensembl/modules");
unshift(@INC, "$SERVERROOT/bioperl-live");
}
use Getopt::Long;
use Pod::Usage;
use Bio::EnsEMBL::Utils::ConfParser;
use Bio::EnsEMBL::Utils::Logger;
$| = 1;
# parse configuration and commandline arguments
my $conf = new Bio::EnsEMBL::Utils::ConfParser(
-SERVERROOT => $SERVERROOT,
-SERVERROOT => "$Bin/../../..",
-DEFAULT_CONF => "$Bin/default.conf"
);
# parse options
$conf->param('default_conf', './default.conf');
$conf->parse_common_options(@_);
$conf->parse_extra_options(qw(
sourcehost|source_host=s
sourceport|source_port=n
sourceuser|source_user=s
sourcepass|source_pass=s
sourcedbname|source_dbname=s
targethost|target_host=s
targetport|target_port=n
targetuser|target_user=s
targetpass|target_pass=s
targetdbname|target_dbname=s
mode=s
dumppath|dump_path=s
cachefile|cache_file=s
chromosomes|chr=s@
region=s
biotypes=s@
min_exon_length|minexonlength=i
exonerate_path|exoneratepath=s
exonerate_threshold|exoneratethreshold=i
exonerate_jobs|exoneratejobs=i
exonerate_bytes_per_job|exoneratebytesperjob=i
));
$conf->allowed_params(
$conf->get_common_params,
qw(
sourcehost sourceport sourceuser sourcepass sourcedbname
targethost targetport targetuser targetpass targetdbname
mode
dumppath cachefile
chromosomes region biotypes
min_exon_length
exonerate_path exonerate_threshold exonerate_jobs exonerate_byte_per_job
)
$conf->parse_options(
'sourcehost|source_host=s' => 1,
'sourceport|source_port=n' => 1,
'sourceuser|source_user=s' => 1,
'sourcepass|source_pass=s' => 0,
'sourcedbname|source_dbname=s' => 1,
'targethost|target_host=s' => 1,
'targetport|target_port=n' => 1,
'targetuser|target_user=s' => 1,
'targetpass|target_pass=s' => 0,
'targetdbname|target_dbname=s' => 1,
'mode=s' => 0,
'dumppath|dump_path=s' => 1,
'chromosomes|chr=s@' => 0,
'region=s' => 0,
'biotypes=s@' => 0,
'min_exon_length|minexonlength=i' => 0,
'exonerate_path|exoneratepath=s' => 1,
'exonerate_threshold|exoneratethreshold=f' => 0,
'exonerate_jobs|exoneratejobs=i' => 0,
'exonerate_bytes_per_job|exoneratebytesperjob=f' => 0,
);
if ($conf->param('help') or $conf->error) {
warn $conf->error if $conf->error;
pod2usage(1);
}
# ask user to confirm parameters to proceed
$conf->confirm_params;
# get log filehandle and print heading and parameters to logfile
my $logger = new Bio::EnsEMBL::Utils::Logger(
-LOGFILE => $conf->param('logfile'),
-LOGPATH => $conf->param('logpath'),
-LOGAPPEND => $conf->param('logappend'),
-VERBOSE => $conf->param('verbose'),
-LOGLEVEL => $conf->param('loglevel'),
);
# initialise log
$logger->init_log($conf->list_all_params);
# check required parameters were set
$conf->check_required_params(
qw(
sourcehost sourceport sourceuser sourcedbname
targethost targetport targetuser targetdbname
dumppath
)
);
$logger->init_log($conf->list_param_values);
# define options for the components
# this script is only a wrapper and will run one or more components.
# define options for the components here.
my %options;
$options{'dump_cache'} = $conf->create_commandline_options(
-ALLOWED_PARAMS => 1,
-REPLACE => {
interactive => 0,
is_component => 1,
},
-EXCLUDE => [qw(mode min_exon_length exonerate_path exonerate_threshold
exonerate_jobs exonerate_byte_per_job)]
interactive => 0,
is_component => 1,
);
$options{'id_mapping'} = $conf->create_commandline_options(
-ALLOWED_PARAMS => 1,
-REPLACE => {
interactive => 0,
is_component => 1,
},
-EXCLUDE => [qw(
sourcehost sourceport sourceuser sourcepass sourcedbname
targethost targetport targetuser targetpass targetdbname
)]
interactive => 0,
is_component => 1,
);
# dump cache files (this is done for all modes)
&run_component('dump_cache.pl', $options{'dump_cache'}, 'building cache');
# run components, depending on mode
my $mode = $conf->param('mode') || 'normal';
my $sub = "run_$mode";
no strict 'refs';
&$sub;
# finish logfile
$logger->finish_log;
### END main ###
sub run_normal {
# dump cache files (this is done for all modes)
&run_component('dump_cache.pl', $options{'dump_cache'}, 'building cache');
# ID mapping
&run_component('id_mapping.pl', $options{'id_mapping'}, 'Id mapping');
......@@ -193,6 +139,7 @@ sub run_normal {
# QC
#&run_component('qc.pl', $options{'qc'}, 'QC');
}
......@@ -201,11 +148,11 @@ sub run_component {
my $options = shift;
my $logtext = shift || $cmd;
$logger->log_stamped("----- $logtext -----\n");
$logger->info("----- $logtext -----\n", 0, 'stamped');
system("./$cmd $options") == 0
or $logger->log_error("Error running $cmd. Please see the respective logfile for more information.\n");
or $logger->error("Error running $cmd. Please see the respective logfile for more information.\n");
$logger->log_stamped("----- done with $logtext -----\n\n");
$logger->info("----- done with $logtext -----\n\n", 0, 'stamped');
}
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