The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

BioX::Workflow::Command::run::Rules::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

template_process

Do the actual processing of the rule->process

use_iterables

Check the global and local keys to see if we are using any iterables

  use_chroms: 1
  use_chunks: 1

This is still here, but its use is discouraged

Instead check out the Mustache Template for easier loops

eval_rule

Check to see if there is a custom method registered.

Otherwise process the template as normal.

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

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