- Workflows should be structured in the following order, with each of the below separated by a blank line:
- Imports.
- Inputs.
- Definition of variables dynamically generated in the workflow itself.
- Calls to tasks.
- Outputs.
- Tasks should be structured in the following order, with each of the below separated by a blank line:
- Inputs.
- Definition of variables dynamically generated in the task itself.
- Command.
- Outputs.
- Runtime settings - default parameters, followed by a select first with the runtime override, then the actual runtime block.
- Inputs should be structured in the following order, with each of the below separated by a blank lines:
- Core input files that will be run through the workflow - e.g. VCFs being annotated, BAMs being analyzed etc (as well as their indexes if applicable). Also the contigs to be run on as well as the prefix.
- Parameters that govern how the file will be processed - e.g. prefixes, modes, input arguments to tools being called, PEDs, metadata files etc.
- Reference files - e.g. reference fasta, their indexes, catalogs used for annotations, etc.
- Runtime-related information that are not of type RuntimeAttr - e.g. docker paths, cores if applicable, sharding information if applicable.
- All RuntimeAttr? inputs - there should be one per task called, with its name reflective of the task's function.
- Workflows should take in an input
prefixthat is passed to every task that creates output files, which should be used in conjunction with a descriptive suffix when creating outputs. - Workflow imports should not be renamed using the
asoperator. - Workflows should never contain any blank comments - e.g.
#########################. - Workflows should never contain be any consecutive blank lines - i.e. they should have a maximum of one blank line at a time.
- Inputs passed to a task should not have blank lines between inputs.
- The order of inputs passed to a task should reflect their order in the inputs on the workflow level.
- Inputs passed to a task should have a space on either side of the
=character. - The inputs section of a task should not have blank lines between inputs.
- Tasks should always have input fields
dockerandruntime_attr_overridedefined, though what is passed to each one of these when calling the task should be explicitly named - e.g.gatk_dockerandruntime_attr_override_svannotaterespectively. - Tasks should also have a prefix input defined, which is passed and set at the workflow level - the outputs from the task should simply use the prefix along with the file type.
- Every command block within a task should begin with
set -euo pipefailfollowed by a blank line. - The default
disk_sizefor a task should be calculated dynamically based on the largest sized input file - or multiple if there are several large inputs, like multiple reference fastas or input catalogs. It should be defined in-line in the default runtime attributes section, unless it is a complicated function in which it can have a dedicated variabledisk_size. - The default
mem_gb,boot_disk_gbandcompute_coresfor a task should be explicitly defined rather than based on an input file - it should be set based on the intensity of compute needed by that task. - The default
preemptible_triesfor a task should always be 2, besides tasks inHelpers.wdlwhich should be 1. - The default
max_retriesfor a task should always be 0. - The names of workflows and tasks should never include a
_character within them - rather, they should always be in Pascal case. - The names of inputs, variables and outputs should include a
_to separate words, and be entirely lowercase unless they refer to a noun that is capitalized (e.g. PALMER or L1MEAID) - i.e. they should always be in snake case. - There should never be any additional indentation in order to better align parts of the code to the length or horizontal/vertical spacing of other components in its section - indentation should only be applied at the start of a line.
- All mentions of
fastashould instead usefa- e.g.ref_fainstead ofref_fasta. - All mentions of
fasta_index,fasta_faiorfa_faishould instead usefai- e.g.ref_faiinstead ofref_fasta_index,ref_fasta_faiorref_fa_fai. - All mentions of
vcf_indexorvcf_tbishould instead usevcf_idx. - All VCFs should have suffix
_vcf, and be coupled with a VCF index file that has a suffix_vcf_idx. - Tasks that can be generalized and used across workflows should live in
Helpers.wdland be imported by consumer workflows, rather than explicitly defined in a standalone workflow itself. - Workflow file names must always match the workflow defined within them.
- Annotation workflows should always output a TSV file rather than a VCF, unless its annotations are done for every single variant in the input VCF or if the underlying workflow is designed to annotate variants in a VCF.
- All code should be formatted in-line with black's formatting, which can be applied via
black .. - All code should be compliant with
flake8.
- Workflows in
wdl/annotation/should begin with Annotate. - Workflows directly run in the pipeline should be in one of
wdl/annotation/,wdl/annotation_utils/orwdl/tools/. - Workflows directly run in the pipelien should have entries in
dockstore.ymlandREADME.md.
- All reference files - i.e. those not specific to an input callset - should be passed in via workspace data.
- All dockers should be passed in via workspace data.