Skip to content

Commit 53d2b60

Browse files
committed
bug fix
1 parent f38e9f1 commit 53d2b60

13 files changed

+3489
-21
lines changed

lib/BioX/Workflow/Command/run/Utils/Attributes.pm

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,6 @@ has 'cached_workflow' => (
6666
6767
=cut
6868

69-
=head3 sample_rule
70-
71-
Rule to find files/samples
72-
73-
=cut
74-
75-
has 'sample_rule' => (
76-
is => 'rw',
77-
isa => 'Str',
78-
default => sub { return "(.*)"; },
79-
clearer => 'clear_sample_rule',
80-
predicate => 'has_sample_rule',
81-
);
8269

8370
=head3 local_rule1
8471

lib/BioX/Workflow/Command/run/Utils/Directives.pm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ has 'INPUT' => (
8181
documentation => q(See OUTPUT)
8282
);
8383

84+
=head3 sample_rule
85+
86+
Rule to find files/samples
87+
88+
=cut
89+
90+
has 'sample_rule' => (
91+
is => 'rw',
92+
isa => 'Str',
93+
default => sub { return "(.*)"; },
94+
clearer => 'clear_sample_rule',
95+
predicate => 'has_sample_rule',
96+
);
97+
8498
=head2 find_sample_bydir
8599
86100
#Previous find_by_dir

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ has 'global_keys' => (
189189
isa => 'ArrayRef',
190190
default => sub { return [] },
191191
handles => {
192-
all_global_keys => 'elements',
193-
has_global_keys => 'count',
192+
all_global_keys => 'elements',
193+
has_global_keys => 'count',
194194
first_index_global_keys => 'first_index',
195195
},
196196
);
@@ -608,6 +608,7 @@ sub in_template_process {
608608
$self->local_attr->sample($sample);
609609
$self->sample($sample);
610610
my $text = $self->eval_process();
611+
611612
# my $log = $self->write_file_log();
612613
# $text .= $log;
613614
push( @{$texts}, $text ) if $self->print_within_rule;
@@ -696,20 +697,17 @@ sub walk_indir_outdir_sample {
696697
my $attr = shift;
697698
my $text = shift;
698699

699-
$DB::single = 2;
700700
my $use_iters = $self->use_iterables;
701701
my $dummy_sample = $self->dummy_sample;
702702

703-
my @samples = @{$attr->samples} if $attr->has_samples;
703+
my @samples = @{ $attr->samples } if $attr->has_samples;
704704

705705
foreach my $sample ( $attr->all_samples ) {
706706
my $new_text = $text;
707707
$new_text =~ s/$dummy_sample/$sample/g;
708-
$DB::single = 2;
709708

710709
if ($use_iters) {
711-
$self->walk_indir_outdir_iters( $use_iters, $attr,
712-
$new_text );
710+
$self->walk_indir_outdir_iters( $use_iters, $attr, $new_text );
713711
}
714712
else {
715713
$new_text = path($new_text)->absolute if $attr->coerce_abs_dir;
@@ -857,15 +855,18 @@ sub check_indir_outdir {
857855
my $self = shift;
858856
my $attr = shift;
859857

858+
$DB::single = 2;
860859
return unless $attr->by_sample_outdir;
861860
return unless $self->has_sample;
862861
return if $attr->override_process;
863862

864863
# If indir/outdir is specified in the local config
865864
# then we don't evaluate it
865+
my %keys = ();
866+
map { $keys{$_} = 1 } @{ $self->local_rule_keys };
866867

867868
foreach my $dir ( ( 'indir', 'outdir' ) ) {
868-
if ( grep /$dir/, @{ $self->local_rule_keys } ) {
869+
if ( exists $keys{$dir} ) {
869870
next;
870871
}
871872

@@ -901,6 +902,7 @@ Outdir should be global_attr->outdir/rule_name
901902
sub carry_directives {
902903
my $self = shift;
903904

905+
$DB::single = 2;
904906
$self->local_attr->outdir(
905907
$self->global_attr->outdir . '/' . $self->rule_name );
906908

0 commit comments

Comments
 (0)