Name

BioX::Workflow::Command::run::Utils::Rules

Description

Role for Rules

Command Line Options

filter_rule_keys

First option is to use --use_timestamps The user can also override the timestamps with --select_* --omit_*

Use the --select_rules and --omit_rules options to choose rules.

By default all rules are selected

set_rule_names

Iterate over the rule names and add them to our array

set_rule_keys

If we have any select_* or select_match, get those rules before we start processing

check_select

See if the the current rule_name exists in either select_* or omit_*

process_rule

This function is just a placeholder for the other functions we need to process a rule

1. Do a sanity check of the rule - it could be yaml/json friendly but not biox friendly 2. Clone the local attr 3. Check for carrying indir/outdir INPUT/OUTPUT 4. Apply the local attr - Add all the local: keys to our attr 5. Get the keys of the rule 6. Finally, process the template, or the process: key

sanity_check_rule

Check the rule to make sure it only has 1 key

carry_directives

At the beginning of each rule the previous outdir should be the new indir, and the previous OUTPUT should be the new INPUT

Stash should be carried over

Outdir should be global_attr->outdir/rule_name

template_process

Do the actual processing of the rule->process

Decide if we print the rule

There are 3 main decision trees

1. User specifies --select_* 2. User specified --omit_* 3. User specified --use_timestamps

select_* and omit_* take precedence over use_timestamps

check_indir_outdir

If by_sample_outdir we pop the last dirname, append {$sample} to the base dir, and then add back on the popped value

There are 2 cases we do not do this

1. The indir of the first rule 2. If the user specifies indir/outdir in the local vars