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

filter: Statementstmt 13.7% 64 / 467 Branchbran 0.0% 0 / 124 Conditioncond 0.0% 0 / 16 MC/DCmcdc 0.0% 0 / 9 Subroutinesub 21.7% 15 / 69 Podpod 38.7% 12 / 31 totaltotal 12.7% 91 / 716 CC 81 SCAR 42.1
CC
81
Cov
11%
set_rule_keys
380.0
apply_data_loop
90.0
check_indir_outdir
90.0
CRAP 67.6
« lib/BioX/Workflow/Command/run/Rules/Directives.pm ↑ Summary lib/BioX/Workflow/Command/run/Rules/Directives/Interpolate/Text.pm »
1 package BioX::Workflow::Command::run::Rules::Rules;
2  
3 1 ▶use MooseX::App::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Storable qw(dclone);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 #use Data::Merger qw(merger);
8 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use File::Path qw(make_path remove_tree);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use MCE::Map;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Algorithm::Loops qw(NestedLoops);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use BioSAILs::Utils::Traits qw(ArrayRefOfStrs);
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use MCE::Shared;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use MCE::Shared::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use BioX::Workflow::Command::run::Rules::Exceptions::KeyDeclaration;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use BioX::Workflow::Command::run::Rules::Exceptions::OneRuleName;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 1 with 'BioX::Workflow::Command::run::Rules::Directives::Inspect';
23  
24 1 tie my %stash, 'MCE::Shared', { module => 'MCE::Shared::Cache' };
25  
26 =head1 Name
27  
28 BioX::Workflow::Command::run::Rules::Rules
29  
30 =head2 Description
31  
32 Role for Rules
33  
34 =cut
35  
36 =head2 Command Line Options
37  
38 =cut
39  
40 option 'select_rules' => (
41 traits => [ 'Array' ],
42 is => 'rw',
43 required => 0,
44 isa => ArrayRefOfStrs,
45 documentation => 'Select rules to process',
46 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
47 1 cmd_split => qr/,/,
48 handles => {
49 all_select_rules => 'elements',
50 has_select_rules => 'count',
51 join_select_rules => 'join',
52 },
53 cmd_aliases => [ 'sr' ],
54 );
55  
56 1 option 'select_after' => (
57 is => 'rw',
58 isa => 'Str',
59 required => 0,
60 predicate => 'has_select_after',
61 clearer => 'clear_select_after',
62 documentation => 'Select rules after and including a particular rule.',
63 cmd_aliases => [ 'sa' ],
64 );
65  
66 1 option 'select_before' => (
67 is => 'rw',
68 isa => 'Str',
69 required => 0,
70 predicate => 'has_select_before',
71 clearer => 'clear_select_before',
72 documentation => 'Select rules before and including a particular rule.',
73 cmd_aliases => [ 'sb' ],
74 );
75  
76 option 'select_between' => (
77 traits => [ 'Array' ],
78 is => 'rw',
79 isa => ArrayRefOfStrs,
80 documentation => 'select rules to process',
81 cmd_split => qr/,/,
82 required => 0,
83 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
84 1 documentation => 'Select sets of rules. Ex: rule1-rule2,rule4-rule5',
85 cmd_aliases => [ 'sbtwn' ],
86 handles => {
87 all_select_between => 'elements',
88 has_select_between => 'count',
89 join_select_between => 'join',
90 },
91 );
92  
93 option 'omit_rules' => (
94 traits => [ 'Array' ],
95 is => 'rw',
96 required => 0,
97 isa => ArrayRefOfStrs,
98 documentation => 'Omit rules to process',
99 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
100 1 cmd_split => qr/,/,
101 handles => {
102 all_omit_rules => 'elements',
103 has_omit_rules => 'count',
104 join_omit_rules => 'join',
105 },
106 cmd_aliases => [ 'or' ],
107 );
108  
109 1 option 'omit_after' => (
110 is => 'rw',
111 isa => 'Str',
112 required => 0,
113 predicate => 'has_omit_after',
114 clearer => 'clear_omit_after',
115 documentation => 'Omit rules after and including a particular rule.',
116 cmd_aliases => [ 'oa' ],
117 );
118  
119 1 option 'omit_before' => (
120 is => 'rw',
121 isa => 'Str',
122 required => 0,
123 predicate => 'has_omit_before',
124 clearer => 'clear_omit_before',
125 documentation => 'Omit rules before and including a particular rule.',
126 cmd_aliases => [ 'ob' ],
127 );
128  
129 option 'omit_between' => (
130 traits => [ 'Array' ],
131 is => 'rw',
132 isa => ArrayRefOfStrs,
133 documentation => 'omit rules to process',
134 cmd_split => qr/,/,
135 required => 0,
136 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
137 1 documentation => 'Omit sets of rules. Ex: rule1-rule2,rule4-rule5',
138 cmd_aliases => [ 'obtwn' ],
139 handles => {
140 all_omit_between => 'elements',
141 has_omit_between => 'count',
142 join_omit_between => 'join',
143 },
144 );
145  
146 option 'select_match' => (
147 traits => [ 'Array' ],
148 is => 'rw',
149 required => 0,
150 isa => ArrayRefOfStrs,
151 documentation => 'Match rules to select',
152 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
153 1 cmd_split => qr/,/,
154 handles => {
155 all_select_match => 'elements',
156 has_select_match => 'count',
157 join_select_match => 'join',
158 },
159 cmd_aliases => [ 'sm' ],
160 );
161  
162 option 'omit_match' => (
163 traits => [ 'Array' ],
164 is => 'rw',
165 required => 0,
166 isa => ArrayRefOfStrs,
167 documentation => 'Match rules to omit',
168 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
169 1 cmd_split => qr/,/,
170 handles => {
171 all_omit_match => 'elements',
172 has_omit_match => 'count',
173 join_omit_match => 'join',
174 },
175 cmd_aliases => [ 'om' ],
176 );
177  
178 # TODO Change this to rules?
179 has 'rule_keys' => (
180 is => 'rw',
181 isa => 'ArrayRef',
182 0 ▶ default => sub {return []},
Subroutine __ANON__: not called CC=1 SCAR=6.9
183 1 );
184  
185 has 'local_rule_keys' => (
186 traits => [ 'Array' ],
187 is => 'rw',
188 isa => 'ArrayRef',
189 0 ▶ default => sub {return []},
Subroutine __ANON__: not called CC=1 SCAR=6.9
190 1 handles => {
191 all_local_rule_keys => 'elements',
192 has_local_rule_keys => 'count',
193 },
194 );
195  
196 has 'global_keys' => (
197 traits => [ 'Array' ],
198 is => 'rw',
199 isa => 'ArrayRef',
200 0 ▶ default => sub {return []},
Subroutine __ANON__: not called CC=1 SCAR=6.9
201 1 handles => {
202 all_global_keys => 'elements',
203 has_global_keys => 'count',
204 first_index_global_keys => 'first_index',
205 },
206 );
207  
208 1 has [ 'select_effect', 'omit_effect' ] => (
209 is => 'rw',
210 isa => 'Bool',
211 default => 0,
212 );
213  
214 1 has 'dummy_sample' => (
215 is => 'rw',
216 isa => 'Str',
217 default => '__DUMMYSAMPLE123456789__'
218 );
219  
220 1 has 'dummy_iterable' => (
221 is => 'rw',
222 isa => 'Str',
223 default => '__DUMMYITER123456789__'
224 );
225  
226 #This should be in its own role
227 0 ▶sub iterate_rules {
Subroutine iterate_rules: not called CC=3 SCAR=24.8
Pod undocumented
228 0 my $self = shift;
229  
230 0 $self->set_rule_names;
231 0 my $rules = $self->workflow_data->{rules};
232  
233 0 $self->filter_rule_keys;
234  
235 0 foreach my $rule (@$rules) {
236 0 $self->local_rule($rule);
237 0 my $except = $self->process_rule;
238 0 ▶ next if $except;
Branch: 1 branch
BranchTrueFalseTotal
if $except 0 0 0
239 0 $self->p_rule_name($self->rule_name);
240 0 $self->p_local_attr(dclone($self->local_attr));
241 }
242 }
243  
244 =head3 filter_rule_keys
245  
246 First option is to use --use_timestamps
247 The user can also override the timestamps with --select_* --omit_*
248  
249 Use the --select_rules and --omit_rules options to choose rules.
250  
251 By default all rules are selected
252  
253 =cut
254  
255 0 ▶sub filter_rule_keys {
Subroutine filter_rule_keys: not called CC=1 SCAR=6.9
Pod documented
256 0 my $self = shift;
257  
258 0 $self->select_rule_keys(dclone($self->rule_names));
259  
260 0 $self->set_rule_keys('select');
261 0 $self->set_rule_keys('omit');
262  
263 $self->app_log->info('Selected rules:' . "\t"
264 0 . join(', ', @{$self->select_rule_keys})
265 . "\n");
266 }
267  
268 =head3 set_rule_names
269  
270 Iterate over the rule names and add them to our array
271  
272 =cut
273  
274 0 ▶sub set_rule_names {
Subroutine set_rule_names: not called CC=1 SCAR=6.9
Pod documented
275 0 my $self = shift;
276 0 my $rules = $self->workflow_data->{rules};
277  
278 0 my @rule_names = map {my ($key) = keys %{$_};
279 0 $key} @{$rules};
280 0 @rule_names = map {my $t = $_;
281 0 $t =~ s/^\s+|\s+$//g;
282 0 $t} @rule_names;
283 0 $self->rule_names(\@rule_names);
284 0 $self->app_log->info('Found rules:' . "\t" . join(', ', @rule_names));
285 }
286  
287 #TODO This is confusing change names
288  
289 =head3 set_rule_keys
290  
291 If we have any select_* or select_match, get those rules before we start processing
292  
293 =cut
294  
295 0 ▶sub set_rule_keys {
Subroutine set_rule_keys: not called CC=19 SCAR=59.4
Pod documented
296 0 my $self = shift;
297 0 ▶ my $cond = shift || 'select';
Condition0%0/2
shift() || 'select'
l!l
00
MC/DC0%0/1
shift() || 'select'
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
298  
299 0 my @rules = ();
300 0 my $rule_exists = 1;
301 0 my @rule_name_exists = ();
302  
303 0 my $effect = $cond . '_effect';
304  
305 my ($has_rules, $has_bf, $has_af, $has_btw, $has_match) =
306 0 map {'has_' . $cond . '_' . $_}
307 ('rules', 'before', 'after', 'between', 'match');
308  
309 0 my ($bf, $af) = ($cond . '_before', $cond . '_after');
310  
311 my ($btw, $all_rules, $all_matches) =
312 0 map {'all_' . $cond . '_' . $_} ('between', 'rules', 'match');
313  
314 0 my ($rule_keys) = ($cond . '_rule_keys');
315  
316 0 ▶ if ($self->$has_rules) {
Branch: 5 branches
BranchTrueFalseTotal
if ($self->$has_rules) { } 0 0 0
elsif ($self->$has_bf) { } 0 0 0
elsif ($self->$has_af) { } 0 0 0
elsif ($self->$has_btw) { } 0 0 0
elsif ($self->$has_match) { } 0 0 0
317 0 $self->$effect(1);
318 0 foreach my $r ($self->$all_rules) {
319 0 ▶ if ($self->first_index_rule_names(sub {$_ eq $r}) != -1) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if ($self->first_index_rule_names(sub { $_ eq $r; } ) != -1) { } 0 0 0
320 0 push(@rules, $r);
321 }
322 else {
323 0 $self->app_log->warn(
324 "You selected a rule $r that does not exist");
325 0 $rule_exists = 0;
326 0 push(@rule_name_exists, $r);
327 }
328 }
329 }
330 elsif ($self->$has_bf) {
331 0 $self->$effect(1);
332 0 ▶ my $index = $self->first_index_rule_names(sub {$_ eq $self->$bf});
Subroutine __ANON__: not called CC=1 SCAR=6.9
333 0 ▶ if ($index == -1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($index == -1) 0 0 0
334 0 $self->app_log->warn("You "
335 . $cond
336 . "ed a rule "
337 . $self->$bf
338 . " that does not exist");
339 0 $rule_exists = 0;
340 0 push(@rule_name_exists, $self->$bf);
341 }
342 0 ▶ for (my $x = 0; $x <= $index; $x++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($x <= $index) 0 0 0
343 0 push(@rules, $self->rule_names->[$x]);
344 }
345 }
346 elsif ($self->$has_af) {
347 0 $self->$effect(1);
348 0 ▶ my $index = $self->first_index_rule_names(sub {$_ eq $self->$af});
Subroutine __ANON__: not called CC=1 SCAR=6.9
349 0 ▶ if ($index == -1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($index == -1) 0 0 0
350 0 $self->app_log->warn("You "
351 . $cond
352 . "ed a rule "
353 . $self->$af
354 . " that does not exist");
355 0 $rule_exists = 0;
356 0 push(@rule_name_exists, $self->$af);
357 }
358 0 ▶ for (my $x = $index; $x < $self->has_rule_names; $x++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($x < $self->has_rule_names) 0 0 0
359 0 push(@rules, $self->rule_names->[$x]);
360 }
361 }
362 elsif ($self->$has_btw) {
363 0 $self->$effect(1);
364 0 foreach my $rule ($self->$btw) {
365 0 my (@array) = split('-', $rule);
366  
367 my $index1 =
368 0 ▶ $self->first_index_rule_names(sub {$_ eq $array[0]});
Subroutine __ANON__: not called CC=1 SCAR=6.9
369 my $index2 =
370 0 ▶ $self->first_index_rule_names(sub {$_ eq $array[1]});
Subroutine __ANON__: not called CC=1 SCAR=6.9
371  
372 0 ▶ if ($index1 == -1 || $index2 == -1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($index1 == -1 or $index2 == -1) 0 0 0
Condition0%0/3
$index1 == -1 or $index2 == -1
l!l&&r!l&&!r
000
MC/DC0%0/2
$index1 == -1 or $index2 == -1
$index1 == -1 $index2 == -1
Truth table0%0/3
A or B
A= $index1 == -1B= $index2 == -1
ABresult
1X1
011
000
373 0 $self->app_log->warn("You "
374 . $cond
375 . "ed a set of rules "
376 . join(',', $self->$btw)
377 . " that does not exist");
378 0 $rule_exists = 0;
379 0 push(@rule_name_exists, $rule);
380 }
381  
382 0 ▶ for (my $x = $index1; $x <= $index2; $x++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($x <= $index2) 0 0 0
383 0 push(@rules, $self->rule_names->[$x]);
384 }
385 }
386 }
387 elsif ($self->$has_match) {
388 0 $self->$effect(1);
389 0 foreach my $match_rule ($self->$all_matches) {
390 0 ▶ my @t_rules = $self->grep_rule_names(sub {/$match_rule/});
Subroutine __ANON__: not called CC=1 SCAR=6.9
391 0 map {push(@rules, $_)} @t_rules;
392 }
393 }
394  
395 0 ▶ $self->$rule_keys(\@rules) if @rules;
Branch: 1 branch
BranchTrueFalseTotal
if @rules 0 0 0
396  
397 # return ( $rule_exists, @rule_name_exists );
398 }
399  
400 =head3 check_select
401  
402 See if the the current rule_name exists in either select_* or omit_*
403  
404 =cut
405  
406 0 ▶sub check_select {
Subroutine check_select: not called CC=3 SCAR=24.8
Pod documented
407 0 my $self = shift;
408 0 ▶ my $cond = shift || 'select';
Condition0%0/2
shift() || 'select'
l!l
00
MC/DC0%0/1
shift() || 'select'
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
409  
410 0 my $findex = 'first_index_' . $cond . '_rule_keys';
411 0 ▶ my $index = $self->$findex(sub {$_ eq $self->rule_name});
Subroutine __ANON__: not called CC=1 SCAR=6.9
412  
413 0 ▶ return 0 if $index == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $index == -1 0 0 0
414 0 return 1;
415 }
416  
417 =head3 process_rule
418  
419 This function is just a placeholder for the other functions we need to process a rule
420  
421 1. Do a sanity check of the rule - it could be yaml/json friendly but not biox friendly
422 2. Clone the local attr
423 3. Check for carrying indir/outdir INPUT/OUTPUT
424 4. Apply the local attr - Add all the local: keys to our attr
425 5. Get the keys of the rule
426 6. Finally, process the template, or the process: key
427  
428 =cut
429  
430 0 ▶sub process_rule {
Subroutine process_rule: not called CC=2 SCAR=17.9
Pod documented
431 0 my $self = shift;
432  
433 0 my $except = $self->sanity_check_rule;
434 0 ▶ return $except if $except;
Branch: 1 branch
BranchTrueFalseTotal
if $except 0 0 0
435  
436 0 $self->local_attr(dclone($self->global_attr));
437  
438 0 $self->carry_directives;
439  
440 0 $self->apply_local_attr;
441  
442 0 $self->get_keys;
443 0 $self->template_process;
444 0 return 0;
445 }
446  
447 =head3 sanity_check_rule
448  
449 Check the rule to make sure it only has 1 key
450  
451 =cut
452  
453 #TODO make this into a type Instead
454  
455 0 ▶sub sanity_check_rule {
Subroutine sanity_check_rule: not called CC=5 SCAR=34.0
Pod documented
456 0 my $self = shift;
457  
458 0 my $except;
459  
460 0 $except = $self->sanity_check_rule_one_rule_name;
461 0 ▶ return $except if $except;
Branch: 1 branch
BranchTrueFalseTotal
if $except 0 0 0
462  
463 0 ▶ if (!exists $self->local_rule->{ $self->rule_name }->{process}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->local_rule->{$self->rule_name}{"process"}) 0 0 0
464 0 $self->local_rule->{ $self->rule_name }->{process} = '';
465 0 $self->app_log->warn(
466 'Rule does not have a process. If you have registered a namespace please ignore this error.'
467 );
468 }
469  
470 0 ▶ if (!exists $self->local_rule->{ $self->rule_name }->{local}) {
Branch: 1 branch
BranchTrueFalseTotal
if (not exists $self->local_rule->{$self->rule_name}{'local'}) { } 0 0 0
471 0 $self->local_rule->{ $self->rule_name }->{local} = [];
472 }
473 else {
474 0 $except = $self->sanity_check_rule_local_structure;
475 0 ▶ return $except if $except;
Branch: 1 branch
BranchTrueFalseTotal
if $except 0 0 0
476 }
477  
478 0 $self->app_log->info(
479 'Rule: ' . $self->rule_name . ' passes sanity check');
480 0 return 0;
481 }
482  
483 0 ▶sub sanity_check_rule_one_rule_name {
Subroutine sanity_check_rule_one_rule_name: not called CC=4 SCAR=30.0
Pod undocumented
484 0 my $self = shift;
485  
486 0 my @keys = keys %{$self->local_rule};
487 0 $self->rule_name($keys[0]);
488  
489 0 ▶ return if $#keys == 0;
Branch: 1 branch
BranchTrueFalseTotal
if $#keys == 0 0 0 0
490  
491 0 my $except =
492 BioX::Workflow::Command::run::Rules::Exceptions::OneRuleName->new();
493 0 $self->app_log->info('Rule: ' . $self->rule_name . ' fails sanity check');
494 0 ▶ if (exists $self->local_rule->{process}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->local_rule->{"process"}) 0 0 0
495 0 $self->app_log->warn('\'Process\' found at same indentation as rule name. Increase the indentation for this key!');
496 }
497 0 ▶ if (exists $self->local_rule->{local}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->local_rule->{"local"}) 0 0 0
498 0 $self->app_log->warn('\'Local\' found at same indentation as rule name. Increase the indentation for this key!');
499 }
500  
501 0 $except->warn($self->app_log);
502 0 $self->sanity_check_fail;
503  
504 $self->inspect_obj->{errors}->{rules}->{ $self->rule_name }->{structure} =
505 0 'OneRuleName';
506 0 return $except;
507 }
508  
509 0 ▶sub sanity_check_rule_local_structure {
Subroutine sanity_check_rule_local_structure: not called CC=2 SCAR=17.9
Pod undocumented
510 0 my $self = shift;
511 0 my $ref = $self->local_rule->{ $self->rule_name }->{local};
512  
513 0 ▶ return if ref($ref) eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
if ref $ref eq "ARRAY" 0 0 0
514  
515 0 my $except =
516 BioX::Workflow::Command::run::Rules::Exceptions::KeyDeclaration->new();
517 0 $self->app_log->info('Rule: ' . $self->rule_name . ' fails sanity check');
518 0 $except->warn($self->app_log);
519 0 $self->sanity_check_fail;
520 $self->inspect_obj->{errors}->{rules}->{ $self->rule_name }->{structure} =
521 0 'KeyDeclaration';
522  
523 0 return $except;
524 }
525  
526 =head3 template_process
527  
528 Do the actual processing of the rule->process
529  
530 =cut
531  
532 0 ▶sub template_process {
Subroutine template_process: not called CC=1 SCAR=6.9
Pod documented
533 0 my $self = shift;
534 # my $texts = [];
535  
536 0 $self->process_obj->{ $self->rule_name } = {};
537  
538 ##TODO Getting rid of dummy text
539 # my $dummy_sample = $self->dummy_sample;
540 # my $dummy_texts = $self->check_iterables( $dummy_sample, [] );
541 0 my $texts = $self->check_iterables('', []);
542  
543 0 $self->process_obj->{ $self->rule_name }->{text} = $texts;
544 $self->process_obj->{ $self->rule_name }->{run_stats} =
545 0 $self->local_attr->run_stats;
546 # if ( !$self->local_attr->override_process ) {
547 # foreach my $sample ( $self->all_samples ) {
548 # foreach my $text ( @{$dummy_texts} ) {
549 # my $new_text = $text;
550 # $new_text =~ s/$dummy_sample/$sample/g;
551 # push( @$texts, $new_text );
552 # }
553 # }
554 # $self->process_obj->{ $self->rule_name }->{text} = $texts;
555 # $self->process_obj->{ $self->rule_name }->{run_stats} =
556 # $self->local_attr->run_stats;
557 # }
558 # else {
559 # $self->process_obj->{ $self->rule_name }->{text} = $dummy_texts;
560 # }
561  
562 $self->process_obj->{ $self->rule_name }->{meta} =
563 0 $self->write_rule_meta('before_meta');
564 }
565  
566 =head3 use_iterables
567  
568 This is deprecated and will be removed in the next version!
569  
570 Check the global and local keys to see if we are using any iterables
571  
572 use_chroms: 1
573 use_chunks: 1
574  
575 This is still here, but its use is discouraged
576  
577 Instead check out the Mustache Template for easier loops
578  
579 =cut
580  
581 0 ▶sub use_iterables {
Subroutine use_iterables: not called CC=5 SCAR=34.0
Pod documented
582 0 my $self = shift;
583  
584 0 my $iter = '';
585 0 my $use_iter = 0;
586 0 my @use = ();
587 map {
588 0 ▶ if ($_ =~ m/^use_/) {push(@use, $_)}
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^use_/) 0 0 0
589 0 } @{$self->rule_keys};
590 map {
591 0 ▶ if ($_ =~ m/^use_/) {push(@use, $_)}
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^use_/) 0 0 0
592 0 } @{$self->local_rule_keys};
593  
594 0 my $use = pop(@use);
595  
596 0 ▶ return 0 if !$use;
Branch: 1 branch
BranchTrueFalseTotal
unless $use 0 0 0
597  
598 0 my $base = $use;
599 0 $base =~ s/use_//;
600  
601 0 my $no = 'no_' . $base;
602  
603 0 ▶ return 0 if $self->local_attr->$no;
Branch: 1 branch
BranchTrueFalseTotal
if $self->local_attr->$no 0 0 0
604  
605 0 my $elem = $base;
606 0 $elem =~ s/s$//;
607 0 my $all = 'all_' . $elem . '_lists';
608  
609 0 return [ $all, $elem ];
610 }
611  
612 0 ▶sub check_iterables {
Subroutine check_iterables: not called CC=2 SCAR=17.9
Pod undocumented
613 0 my $self = shift;
614  
615 0 ▶ if ($self->local_attr->override_process) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->local_attr->override_process) { } 0 0 0
616 0 $self->render_rule_override_process;
617 }
618 else {
619 0 $self->render_rule_no_override_process;
620 }
621 }
622  
623 0 ▶sub render_rule_override_process {
Subroutine render_rule_override_process: not called CC=1 SCAR=6.9
Pod undocumented
624 0 my $self = shift;
625 0 my $attr = dclone($self->local_attr);
626 0 my $text = $self->eval_process($attr);
627 0 return [ $text ];
628 }
629  
630 0 ▶sub render_rule_no_override_process {
Subroutine render_rule_no_override_process: not called CC=3 SCAR=24.8
Pod undocumented
631 0 my $self = shift;
632 ##TODO Add some checking in here
633 0 my @keys = ();
634 0 my @things = ();
635  
636 ## This is all only if override_process: 0
637 ## If its 1, just give to as is
638 0 foreach my $loop (@{$self->local_attr->data_loop}) {
639 0 push(@keys, $loop->{key});
640 0 ▶ if (!ref($self->local_attr->{$loop->{value}})) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $self->local_attr->{$loop->{"value"}}) 0 0 0
641 ##Try to interpolate the string
642 0 $self->local_attr->process_directive($loop->{value}, $self->local_attr->{$loop->{value}});
643 }
644 0 push(@things, $self->local_attr->{$loop->{value}});
645 }
646  
647 ##This is all possible combinations of all the nested things
648 my @terms = NestedLoops(\@things,
649 0 ▶ sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
650 0 my @new_things = @_;
651 0 my $values = [];
652 0 ▶ for (my $x = 0; $x <= $#new_things; $x++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($x <= $#new_things) 0 0 0
653 0 my $key = $keys[$x];
654 0 push(@{$values}, { key => $key, value => $new_things[$x] });
655 }
656 0 return $values;
657 0 });
658  
659 ##TODO optionally no for loop
660 0 my $texts = $self->mce_apply_data_loop(\@terms);
661  
662 # my @texts = map {$self->apply_data_loop($_)} @terms;
663 # return \@texts;
664 0 $self->local_attr->stash(\%stash);
665 # $self->local_attr->stash(\%stash);
666 0 return $texts;
667 }
668  
669 =head3
670  
671 To speed things we use mce map
672 If, however, you do not wish to speed things,
673 and instead be a sucker who runs things sequentially
674 use this directly
675  
676 =cut
677  
678 0 ▶sub apply_data_loop {
Subroutine apply_data_loop: not called CC=9 SCAR=45.0
Pod undocumented
679 0 my $self = shift;
680 0 my $data_list = shift;
681  
682 0 ▶ return unless $data_list;
Branch: 1 branch
BranchTrueFalseTotal
unless $data_list 0 0 0
683 0 ▶ return unless scalar @{$data_list};
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @{$data_list;} 0 0 0
684  
685 0 my $attr = dclone($self->local_attr);
686 0 foreach my $data (@{$data_list}) {
687 0 ▶ next unless $data;
Branch: 1 branch
BranchTrueFalseTotal
unless $data 0 0 0
688 0 ▶ next unless exists $data->{key};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $data->{"key"} 0 0 0
689 0 ▶ next unless exists $data->{value};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $data->{"value"} 0 0 0
690 0 my $data_key = $data->{key};
691 0 my $value = $data->{value};
692  
693 0 ▶ next unless defined $data_key;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data_key 0 0 0
694 0 ▶ next unless defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 0 0
695  
696 0 $self->{$data_key} = $value;
697 0 $self->local_attr->{$data_key} = $value;
698 0 $attr->{$data_key} = $value;
699 }
700  
701 0 my $text = $self->eval_process($attr);
702 0 return $text;
703 }
704  
705 0 ▶sub mce_apply_data_loop {
Subroutine mce_apply_data_loop: not called CC=3 SCAR=24.8
Pod undocumented
706 0 my $self = shift;
707 0 my $terms = shift;
708  
709 0 ▶ MCE::Map::init {chunk_size => 1, max_workers => $ENV{MAX_THREADS} || 'auto'};
Condition0%0/2
$ENV{'MAX_THREADS'} || 'auto'
l!l
00
MC/DC0%0/1
$ENV{'MAX_THREADS'} || 'auto'
$ENV{'MAX_THREADS'}
Truth table0%0/2
A
A= $ENV{'MAX_THREADS'}
Aresult
11
00
710 ## This is a hack having to do with this bug
711 ## https://github.com/marioroy/mce-perl/issues/12
712 0 ▶ if (scalar @{$terms}) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$terms;}) 0 0 0
713 0 push(@{$terms}, [])
714 }
715 0 ▶ my @texts = mce_map {$self->apply_data_loop($_)} @{$terms};
Subroutine __ANON__: not called CC=1 SCAR=6.9
716 0 return \@texts;
717 }
718  
719 0 ▶sub walk_attr {
Subroutine walk_attr: not called CC=1 SCAR=6.9
Pod undocumented
720 0 my $self = shift;
721 0 my $attr = shift;
722  
723 0 $self->check_indir_outdir($attr);
724 0 $attr->walk_process_data($self->rule_keys);
725  
726 0 return $attr;
727 }
728  
729 =head2
730  
731 =cut
732  
733 0 ▶sub eval_process {
Subroutine eval_process: not called CC=2 SCAR=17.9
Pod undocumented
734 0 my $self = shift;
735 0 my $attr = shift;
736  
737 0 $self->check_indir_outdir($attr);
738 0 $attr->walk_process_data($self->rule_keys);
739 0 $self->walk_indir_outdir($attr);
740  
741 0 my $text = $self->eval_rule($attr);
742 0 $text = clean_text($text);
743  
744 0 $self->walk_FILES($attr);
745 0 $self->clear_files;
746  
747 0 $self->return_rule_as_obj($attr);
748  
749 0 ▶ if ($text =~ m/The following errors/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($text =~ /The following errors/) 0 0 0
750 $self->app_log->warn('Error for \'process\' Line #: '
751 . $self->inspect_obj->{line_numbers}->{rules}
752 0 ->{ $self->rule_name }->{process}->{line});
753 $self->inspect_obj->{errors}->{rules}->{ $self->rule_name }->{process}
754 0 ->{msg} = $text;
755  
756 $self->inspect_obj->{errors}->{rules}->{ $self->rule_name }->{process}
757 0 ->{error_types} = $self->get_error_types('process', $text);
758 }
759  
760 ##Have to add the MCE Shared stash back to the local attr
761 0 %stash = %{dclone($attr->stash)};
762 0 $self->local_attr->stash(\%stash);
763 # $self->local_attr->stash(\%stash);
764  
765 0 return $text;
766 }
767  
768 =head3 eval_rule
769  
770 Check to see if there is a custom method registered.
771  
772 Otherwise process the template as normal.
773  
774 =cut
775  
776 0 ▶sub eval_rule {
Subroutine eval_rule: not called CC=3 SCAR=24.8
Pod documented
777 0 my $self = shift;
778 0 my $attr = shift;
779  
780 0 my $process = $self->local_rule->{ $self->rule_name }->{process};
781 0 my $text;
782  
783 0 my $eval_rule = 'eval_rule_' . $self->rule_name;
784 0 ▶ if ($attr->can($eval_rule)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($attr->can($eval_rule)) { } 0 0 0
785 0 ▶ try {
Subroutine __ANON__: not called CC=1 SCAR=6.9
786 0 $text = $attr->$eval_rule($process);
787 }
788 0 ▶ catch {
Subroutine __ANON__: not called CC=1 SCAR=6.9
789 0 $self->app_log->warn(
790 'There was a problem evaluating rule. Error is:');
791 0 $self->app_log->warn($_);
792 0 };
793 }
794 else {
795 0 $text = $attr->interpol_directive($process);
796 }
797  
798 0 ▶ if ($attr->_ERROR == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($attr->_ERROR == 1) 0 0 0
799 0 $self->app_log->warn(
800 'There were 1 or more errors evaluating rule: '
801 . $self->rule_name . '. '
802 . 'Please check the output file for details.'
803 . "\n");
804 }
805 0 $attr->_ERROR(0);
806  
807 0 return $text;
808 }
809  
810 0 ▶sub get_global_keys {
Subroutine get_global_keys: not called CC=1 SCAR=6.9
Pod undocumented
811 0 my $self = shift;
812 0 my @global_keys = ();
813  
814 0 map {my ($key) = keys %{$_};
815 0 push(@global_keys, $key)}
816 0 @{$self->workflow_data->{global}};
817  
818 0 $self->global_keys(\@global_keys);
819 }
820  
821 0 ▶sub get_keys {
Subroutine get_keys: not called CC=4 SCAR=30.0
Pod undocumented
822 0 my $self = shift;
823  
824 0 my %seen = ();
825 0 my @local_keys = map {my ($key) = keys %{$_};
826 0 $seen{$key} = 1;
827 0 $key}
828 0 @{$self->local_rule->{ $self->rule_name }->{local}};
829  
830 0 my @global_keys = ();
831 0 map {my ($key) = keys %{$_};
832 0 ▶ push(@global_keys, $key) if !$seen{$key}}
Branch: 1 branch
BranchTrueFalseTotal
if not $seen{$key} 0 0 0
833 0 @{$self->workflow_data->{global}};
834  
835 0 $self->local_rule_keys(dclone(\@local_keys));
836  
837 0 my @special_keys = ('indir', 'outdir', 'INPUT', 'OUTPUT');
838 0 foreach my $key (@special_keys) {
839 0 ▶ if (!$seen{$key}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($seen{$key}) 0 0 0
840 0 unshift(@local_keys, $key);
841 }
842 }
843  
844 0 map {push(@global_keys, $_)} @local_keys;
845  
846 0 $self->rule_keys(\@global_keys);
847 }
848  
849 ##TODO Write more tests
850 0 ▶sub walk_indir_outdir {
Subroutine walk_indir_outdir: not called CC=1 SCAR=6.9
Pod undocumented
851 0 my $self = shift;
852 0 my $attr = shift;
853  
854 0 my $text = $attr->interpol_directive($attr->outdir);
855 0 $self->walk_indir_outdir_sample($attr, $text);
856 }
857  
858 0 ▶sub walk_indir_outdir_sample {
Subroutine walk_indir_outdir_sample: not called CC=4 SCAR=30.0
Pod undocumented
859 0 my $self = shift;
860 0 my $attr = shift;
861 0 my $text = shift;
862  
863 0 foreach my $sample ($attr->all_samples) {
864 0 my $new_text = $text;
865 0 ▶ $new_text = path($new_text)->absolute if $attr->coerce_abs_dir;
Branch: 1 branch
BranchTrueFalseTotal
if $attr->coerce_abs_dir 0 0 0
866 0 ▶ $new_text = path($new_text) if !$attr->coerce_abs_dir;
Branch: 1 branch
BranchTrueFalseTotal
unless $attr->coerce_abs_dir 0 0 0
867 0 $self->decide_create_outdir($attr, $new_text);
868 }
869 }
870  
871 #sub walk_indir_outdir_iters {
872 # my $self = shift;
873 # my $use_iters = shift;
874 # my $attr = shift;
875 # my $text = shift;
876 #
877 # return unless $use_iters;
878 #
879 # my $all = $use_iters->[0];
880 # my $elem = $use_iters->[1];
881 #
882 # my $dummy_iter = $self->dummy_iterable;
883 # $attr->$elem($dummy_iter);
884 #
885 # foreach my $chunk ( $self->local_attr->$all ) {
886 # my $new_text = $text;
887 # $new_text =~ s/$dummy_iter/$chunk/g;
888 # $new_text = path($new_text)->absolute if $attr->coerce_abs_dir;
889 # $new_text = path($new_text) if !$attr->coerce_abs_dir;
890 # $self->decide_create_outdir( $attr, $new_text );
891 # }
892 #}
893  
894 0 ▶sub decide_create_outdir {
Subroutine decide_create_outdir: not called CC=3 SCAR=24.8
Pod undocumented
895 0 my $self = shift;
896 0 my $attr = shift;
897 0 my $dir = shift;
898  
899 0 ▶ return unless $attr->create_outdir;
Branch: 1 branch
BranchTrueFalseTotal
unless $attr->create_outdir 0 0 0
900 0 ▶ return unless $dir;
Branch: 1 branch
BranchTrueFalseTotal
unless $dir 0 0 0
901  
902 0 ▶ try {
Subroutine __ANON__: not called CC=1 SCAR=6.9
903 0 $dir->mkpath;
904 }
905 0 ▶ catch {
Subroutine __ANON__: not called CC=1 SCAR=6.9
906 0 $self->app_log->fatal("We were not able to make the directory.\n\t"
907 . $attr->outdir
908 . "\n\tError: $!");
909 0 };
910 }
911  
912 0 ▶sub clean_text {
Subroutine clean_text: not called CC=3 SCAR=24.8
Pod undocumented
913 0 my $text = shift;
914 0 my @text = split("\n", $text);
915 0 my @new_text = ();
916  
917 0 foreach my $t (@text) {
918 0 $t =~ s/^\s+|\s+$//g;
919 0 ▶ if ($t !~ /^\s*$/) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($t =~ /^\s*$/) 0 0 0
920 0 push(@new_text, $t);
921 }
922 }
923  
924 0 $text = join("\n", @new_text);
925 0 return $text;
926 }
927  
928 =head3 print_rule
929  
930 Decide if we print the rule
931  
932 There are 3 main decision trees
933  
934 1. User specifies --select_*
935 2. User specified --omit_*
936 3. User specified --use_timestamps
937  
938 select_* and omit_* take precedence over use_timestamps
939  
940 =cut
941  
942 0 ▶sub print_rule {
Subroutine print_rule: not called CC=4 SCAR=30.0
Pod documented
943 0 my $self = shift;
944 0 my $print_rule = 1;
945  
946 0 my $select_index = $self->check_select('select');
947 0 my $omit_index = $self->check_select('omit');
948  
949 0 ▶ if (!$select_index) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($select_index) 0 0 0
950 0 $self->app_log->info(
951 'Select rules in place. Skipping rule ' . $self->rule_name);
952 0 $print_rule = 0;
953 }
954  
955 0 ▶ if ($omit_index) {
Branch: 1 branch
BranchTrueFalseTotal
if ($omit_index) 0 0 0
956 0 $self->app_log->info(
957 'Omit rules in place. Skipping rule ' . $self->rule_name);
958 0 $print_rule = 0;
959 }
960  
961 0 ▶ $self->app_log->info('Processing rule ' . $self->rule_name . "\n")
Branch: 1 branch
BranchTrueFalseTotal
if $print_rule 0 0 0
962 if $print_rule;
963  
964 0 return $print_rule;
965 }
966  
967 ##This is not necessary without the use_timestamps
968 ##But I will leave it in as a placeholder
969 0 ▶sub print_within_rule {
Subroutine print_within_rule: not called CC=1 SCAR=6.9
Pod undocumented
970 0 my $self = shift;
971  
972 #TODO May not need this without use_timestamps
973 0 my $select_index = $self->check_select('select');
974  
975 0 return 1;
976 }
977  
978 =head3 check_indir_outdir
979  
980 If by_sample_outdir we pop the last dirname, append {$sample} to the base dir, and then add back on the popped value
981  
982 There are 2 cases we do not do this
983  
984 1. The indir of the first rule
985 2. If the user specifies indir/outdir in the local vars
986  
987 =cut
988  
989 0 ▶sub check_indir_outdir {
Subroutine check_indir_outdir: not called CC=9 SCAR=45.0
Pod documented
990 0 my $self = shift;
991 0 my $attr = shift;
992  
993 # $DB::single = 2;
994 0 ▶ return unless $attr->by_sample_outdir;
Branch: 1 branch
BranchTrueFalseTotal
unless $attr->by_sample_outdir 0 0 0
995 0 ▶ return unless $self->has_sample;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_sample 0 0 0
996 0 ▶ return if $attr->override_process;
Branch: 1 branch
BranchTrueFalseTotal
if $attr->override_process 0 0 0
997  
998 # If indir/outdir is specified in the local config
999 # then we don't evaluate it
1000 0 my %keys = ();
1001 0 map {$keys{$_} = 1} @{$self->local_rule_keys};
1002  
1003 0 foreach my $dir (('indir', 'outdir')) {
1004 0 ▶ if (exists $keys{$dir}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $keys{$dir}) 0 0 0
1005 0 next;
1006 }
1007  
1008 0 ▶ if ($dir eq 'indir' && !$self->has_p_rule_name) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dir eq "indir" and not $self->has_p_rule_name) 0 0 0
Condition0%0/3
$dir eq "indir" and not $self->has_p_rule_name
!ll&&!rl&&r
000
MC/DC0%0/2
$dir eq "indir" and not $self->has_p_rule_name
$dir eq "indir" not $self->has_p_rule_name
Truth table0%0/3
A and not(B)
A= $dir eq "indir"B= not $self->has_p_rule_name
ABresult
0X0
100
111
1009 0 my $new_dir = File::Spec->catdir($attr->$dir, $attr->sample_var);
1010 0 $attr->$dir($new_dir);
1011 0 next;
1012 }
1013  
1014 0 my @dirs = File::Spec->splitdir($attr->$dir);
1015 0 my $last = '';
1016 0 ▶ if ($#dirs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($#dirs) 0 0 0
1017 0 $last = pop(@dirs);
1018 }
1019  
1020 0 my $base_dir = File::Spec->catdir(@dirs);
1021 0 my $new_dir = File::Spec->catdir($base_dir, $attr->sample_var, $last);
1022 0 $attr->$dir($new_dir);
1023 }
1024 }
1025  
1026 =head3 carry_directives
1027  
1028 At the beginning of each rule the previous outdir should be the new indir, and the previous OUTPUT should be the new INPUT
1029  
1030 Stash should be carried over
1031  
1032 Outdir should be global_attr->outdir/rule_name
1033  
1034 =cut
1035  
1036 0 ▶sub carry_directives {
Subroutine carry_directives: not called CC=4 SCAR=30.0
Pod documented
1037 0 my $self = shift;
1038  
1039 ##TODO File Spec This!
1040 0 $self->local_attr->outdir(
1041 $self->global_attr->outdir . '/' . $self->rule_name);
1042  
1043 0 ▶ return unless $self->has_p_rule_name;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_p_rule_name 0 0 0
1044  
1045 0 $self->local_attr->indir(dclone($self->p_local_attr->outdir));
1046  
1047 0 ▶ if ($self->p_local_attr->has_OUTPUT) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->p_local_attr->has_OUTPUT) 0 0 0
1048 0 ▶ if (ref($self->p_local_attr->OUTPUT)) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self->p_local_attr->OUTPUT) { } 0 0 0
1049 0 $self->local_attr->INPUT(dclone($self->p_local_attr->OUTPUT));
1050 }
1051 else {
1052 0 $self->local_attr->INPUT($self->p_local_attr->OUTPUT);
1053 }
1054 }
1055  
1056 0 $self->local_attr->merge_stash(dclone($self->p_local_attr->stash));
1057 }
1058  
1059 0 ▶sub sanity_check_fail {
Subroutine sanity_check_fail: not called CC=1 SCAR=6.9
Pod undocumented
1060 0 my $self = shift;
1061  
1062 0 my $rule_example = <<EOF;
1063 global:
1064 - indir: data/raw
1065 - outdir: data/processed
1066 - sample_rule: (sample.*)\$
1067 - by_sample_outdir: 1
1068 - find_sample_bydir: 1
1069 - copy1:
1070 local:
1071 - indir: '{\$my_dir}'
1072 - INPUT: '{\$indir}/{\$sample}.csv'
1073 - HPC:
1074 - mem: '40GB'
1075 - walltime: '40GB'
1076 process: |
1077 echo 'MyDir on {\$my_dir}'
1078 echo 'Indir on {\$indir}'
1079 echo 'Outdir on {\$outdir}'
1080 echo 'INPUT on {\$INPUT}'
1081 EOF
1082 0 $self->app_log->fatal('Skipping this rule.');
1083 0 $self->app_log->fatal(
1084 'Here is an example workflow. For more information please see biox new --help.'
1085 );
1086 0 $self->app_log->fatal($rule_example);
1087 }
1088  
1089 0 ▶sub print_process_workflow {
Subroutine print_process_workflow: not called CC=5 SCAR=34.0
Pod undocumented
1090 0 my $self = shift;
1091  
1092 0 $self->app_log->info('Post processing rules and printing workflow...');
1093 0 foreach my $rule ($self->all_rule_names) {
1094  
1095 #TODO This should be named select_rule_names
1096 0 ▶ my $index = $self->first_index_select_rule_keys(sub {$_ eq $rule});
Subroutine __ANON__: not called CC=1 SCAR=6.9
1097 0 ▶ next if $index == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $index == -1 0 0 0
1098  
1099 0 ▶ my $meta = $self->process_obj->{$rule}->{meta} || [];
Condition0%0/2
$self->process_obj->{$rule}{'meta'} || []
l!l
00
MC/DC0%0/1
$self->process_obj->{$rule}{'meta'} || []
$self->process_obj->{$rule}{'meta'}
Truth table0%0/2
A
A= $self->process_obj->{$rule}{'meta'}
Aresult
11
00
1100 0 ▶ my $text = $self->process_obj->{$rule}->{text} || [];
Condition0%0/2
$self->process_obj->{$rule}{'text'} || []
l!l
00
MC/DC0%0/1
$self->process_obj->{$rule}{'text'} || []
$self->process_obj->{$rule}{'text'}
Truth table0%0/2
A
A= $self->process_obj->{$rule}{'text'}
Aresult
11
00
1101  
1102 0 map {$self->fh->say($_)} @{$meta};
1103 0 $self->fh->say('');
1104 0 map {$self->fh->say($_);
1105 0 $self->fh->say('')} @{$text};
1106  
1107 0 $self->print_stats_rules($rule);
1108  
1109 }
1110 }
1111  
1112  
1113 1 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
1114  
1115 1 1;
« lib/BioX/Workflow/Command/run/Rules/Directives.pm ↑ Summary lib/BioX/Workflow/Command/run/Rules/Directives/Interpolate/Text.pm »