Skip to content

Commit 72f1e63

Browse files
committed
bug fix for stats with --select_rules
1 parent 099006b commit 72f1e63

File tree

4 files changed

+28
-32
lines changed

4 files changed

+28
-32
lines changed

lib/BioX/Workflow/Command/run/Rules/Rules.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ sub walk_indir_outdir {
695695

696696
my $text = $attr->interpol_directive( $attr->outdir );
697697

698-
$DB::single = 2;
698+
# $DB::single = 2;
699699
$self->walk_indir_outdir_sample( $attr, $text );
700700
}
701701

@@ -846,7 +846,7 @@ sub check_indir_outdir {
846846
my $self = shift;
847847
my $attr = shift;
848848

849-
$DB::single = 2;
849+
# $DB::single = 2;
850850
return unless $attr->by_sample_outdir;
851851
return unless $self->has_sample;
852852
return if $attr->override_process;
@@ -893,7 +893,7 @@ Outdir should be global_attr->outdir/rule_name
893893
sub carry_directives {
894894
my $self = shift;
895895

896-
$DB::single = 2;
896+
# $DB::single = 2;
897897
$self->local_attr->outdir(
898898
$self->global_attr->outdir . '/' . $self->rule_name );
899899

lib/BioX/Workflow/Command/run/Utils/Files/ResolveDeps.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ sub add_graph {
4444
my $self = shift;
4545
my $cond = shift;
4646

47+
return unless $self->files;
48+
return unless $self->has_files;
49+
4750
for my $file ( $self->all_files ) {
4851
if ( !exists $self->rule_deps->{ $self->rule_name }->{$cond}->{$file} )
4952
{

lib/BioX/Workflow/Command/run/Utils/Files/TrackChanges.pm

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ Files just for this rule
1717
##TODO Make this a hash?
1818
=cut
1919

20-
# has 'files' => (
21-
# traits => ['Hash'],
22-
# is => 'rw',
23-
# isa => 'HashRef',
24-
# default => sub { {} },
25-
# handles => {
26-
# files_pairs => 'kv',
27-
# clear_files => 'clear',
28-
# },
29-
# );
30-
3120
has 'files' => (
3221
traits => ['Array'],
3322
is => 'rw',
@@ -87,7 +76,9 @@ sub walk_INPUT {
8776
return unless $ref_name;
8877
return unless $ref_name eq 'Path::Tiny';
8978

90-
$self->push_files( $ref->absolute );
79+
my $file = $ref->absolute;
80+
$file = "$file";
81+
$self->push_files( $file );
9182
}
9283

9384
1;

lib/BioX/Workflow/Command/stats.pm

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,25 @@ has 'app_log_file' => (
4747
return $log_file;
4848
}
4949
);
50-
51-
has '+app_log' => (
50+
has 'app_log' => (
51+
is => 'rw',
5252
default => sub {
53-
my $self = shift;
54-
my $app_log_file = $self->app_log_file;
55-
my $log_conf = <<EOF;
56-
log4perl.category = DEBUG, LOGFILE
57-
log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
58-
log4perl.appender.LOGFILE.filename=$app_log_file
59-
EOF
60-
61-
$log_conf .= <<'EOF';
62-
log4perl.appender.LOGFILE.mode=append
63-
log4perl.appender.LOGFILE.layout=PatternLayout
64-
log4perl.appender.LOGFILE.layout.ConversionPattern=[%d] %m %n
65-
EOF
66-
67-
Log::Log4perl->init( \$log_conf );
53+
my $self = shift;
54+
Log::Log4perl->init( \ <<'EOT');
55+
log4perl.category = FATAL, Screen
56+
log4perl.appender.Screen = \
57+
Log::Log4perl::Appender::ScreenColoredLevels
58+
log4perl.appender.Screen.layout = \
59+
Log::Log4perl::Layout::PatternLayout
60+
log4perl.appender.Screen.layout.ConversionPattern = \
61+
[%d] %m %n
62+
EOT
6863
return get_logger();
6964
},
65+
lazy => 1,
7066
);
7167

68+
7269
has 'table_log' => (
7370
is => 'rw',
7471
default => sub {
@@ -120,6 +117,11 @@ around 'pre_FILES' => sub {
120117

121118
$self->$orig( $attr, $cond );
122119

120+
return unless $self->has_files;
121+
return unless $self->files;
122+
123+
$DB::single=2;
124+
123125
for my $file ( $self->all_files ) {
124126
$self->preprocess_row( $file, $cond );
125127
}

0 commit comments

Comments
 (0)