Skip to content

Commit

Permalink
Rendering (#443)
Browse files Browse the repository at this point in the history
* display from where is comming the config by default

* re-activate progress bar and display AGAT HEADER even for sq script. Display by default origin of the config file
  • Loading branch information
Juke34 authored Mar 20, 2024
1 parent 39e841d commit 6bff76e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions lib/AGAT/AGAT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,15 @@ MESSAGE
sub get_agat_config{
my ($args)=@_;

# Print the header. Put here because get_agat_config it the first function call for _sp_ and _sq_ screen
print AGAT::AGAT::get_agat_header();

my ($config_file_provided);
if( defined($args->{config_file_in}) ) { $config_file_provided = $args->{config_file_in};}

# Get the config file
my $config_file_checked = get_config({type => "local", config_file_in => $config_file_provided}); #try local first, if none will take the original
# Load the config
my $config = load_config({ config_file => $config_file_checked});
check_config({ config => $config});
return $config;
Expand Down
10 changes: 5 additions & 5 deletions lib/AGAT/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sub get_config{
# -------------- INPUT --------------
# -- Declare all variables and fill them --
my ( $verbose, $log, $debug, $type, $config_file_in ) ;
if( ! defined($args->{verbose}) ) { $verbose = undef;} else{ $verbose = $args->{verbose}; }
if( ! defined($args->{verbose}) ) { $verbose = 1;} else{ $verbose = $args->{verbose}; }
if( ! defined($args->{log}) ) { $log = undef;} else{ $log = $args->{log}; }
if( ! defined($args->{debug}) ) { $debug = undef;} else{ $debug = $args->{debug}; }
if( ! defined($args->{type}) ) { $type = "local";} else{ $type = $args->{type};}
Expand All @@ -104,24 +104,24 @@ sub get_config{
if ($type eq "local") {
$path = $run_dir."/".$config_file;
if (-e $path){
dual_print($log, "Using $config_file file found in your working directory.\n", $verbose );
dual_print($log, "=> Using $config_file config file found in your working directory.\n", $verbose );
} else {
$path = undef;
}
}
#otherwise use the standard location ones
if (! $path) {
$path = dist_file('AGAT', $config_file);
dual_print($log, "Using standard $path file\n", $verbose );
dual_print($log, "=> Using standard $path config file\n", $verbose );
}
}
# Config file provided we must load this one !
else{
if (-e $config_file_in){
$path = $config_file_in;
dual_print($log, "Using provided config file $path.\n", $verbose );
dual_print($log, "=> Using provided config file $path.\n", $verbose );
} else{
warn "Config file $config_file_in does not exist! Please check the path!"; exit;
warn "=> Config file $config_file_in does not exist! Please check the path!"; exit;
}
}
return $path;
Expand Down
4 changes: 2 additions & 2 deletions lib/AGAT/OmniscientI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ sub slurp_gff3_file_JD {
}

# +----------------- Print header ------------------+
dual_print ($log, AGAT::AGAT::get_agat_header(), $verbose);
# Printed to screen by get_agat_config at the very beginning so here we just to want to report the header in the log
dual_print ($log, AGAT::AGAT::get_agat_header(), 0);

# +----------------- debug param ------------------+
$debug = $config->{debug};
Expand Down Expand Up @@ -370,7 +371,6 @@ sub slurp_gff3_file_JD {

# -------------- Set progress bar ---------------------
my $nb_line_read=0;
my $progress_bar=undef;
if ( $progress_bar and $nb_line_feature ){
$progress_bar = Term::ProgressBar->new({
name => 'Parsing',
Expand Down

0 comments on commit 6bff76e

Please sign in to comment.