AWS HealthOmics variant stores and annotation stores will no longer be open to new customers starting November 7th, 2025. If you would like to use variant stores or annotation stores, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see AWS HealthOmics variant store and annotation store availability change.
Nextflow workflow definition specifics
HealthOmics suppports Nextflow DSL1 and DSL2. For details, see Nextflow version support.
Nextflow DSL2 is based on the Groovy programming language, so parameters are dynamic
and type coercion is possible using the same rules as Groovy. Parameters and values
supplied by the input JSON are available in the parameters (params
) map of
the workflow.
Topics
Using nf-schema and nf-validation plugins
Note
Summary of HealthOmics support for plugins:
v22.04 – no support for plugins
v23.10 – supports
nf-schema
andnf-validation
v24.10 – supports
nf-schema
HealthOmics provides the following support for Nextflow plugins:
-
For Nextflow v23.10, HealthOmics pre-installs the nf-validation@1.1.1 plugin.
-
For Nextflow v23.10 and later, HealthOmics pre-installs the nf-schema@2.3.0 plugin.
-
You cannot retrieve additional plugins during a workflow run. HealthOmics ignores any other plugin versions that you specify in the
nextflow.config
file. -
For Nextflow v24 and higher,
nf-schema
is the new version of the deprecatednf-validation
plugin. For more information, see nf-schemain the Nextflow GitHub repository.
Specifying storage URIs
When an Amazon S3 or HealthOmics URI is used to construct a Nextflow file or path object, it makes the matching object available to the workflow, as long as read access is granted. The use of prefixes or directories is allowed for Amazon S3 URIs. For examples, see Amazon S3 input parameter formats.
HealthOmics supports the use of glob patterns in Amazon S3 URIs or HealthOmics Storage URIs.
Use Glob patterns in the
workflow definition for the creation of path
or file
channels.
Setting maximum task duration using time directives
HealthOmics provides an adjustable quota (see HealthOmics service quotas) to specify the maximum duration for a run. For Nextflow v23 and v24 workflows, you can also specify maximum task durations using Nextflow time directives.
During new workflow development, setting maximum task duration helps you catch runaway tasks and long-running tasks.
For more information about the Nextflow time directive, see time directive
HealthOmics provides the following support for Nextflow time directives:
-
HealthOmics supports 1 minute granularity for the time directive. You can specify a value between 60 seconds and the maximum run duration value.
-
If you enter a value less than 60, HealthOmics rounds it up to 60 seconds. For values above 60, HealthOmics rounds down to the nearest minute.
-
If the workflow supports retries for a task, HealthOmics retries the task if it times out.
-
If a task times out (or the last retry times out), HealthOmics cancels the task. This operation can have a duration of one to two minutes.
-
On task timeout, HealthOmics sets the run and task status to failed, and it cancels the other tasks in the run (for tasks in Starting, Pending, or Running status). HealthOmics exports the outputs from tasks that it completed before the timeout to your designated S3 output location.
-
Time that a task spends in pending status does not count toward the task duration.
-
If the run is part of a run group and the run group times out sooner than the task timer, the run and task transition to failed status.
Specify the timeout duration using one or more of the following units: ms
, s
,
m
,h
, or d
. You can specify time directives in the Nextflow config file
and in the workflow definition. The following list shows order of precedence, from lowest to highest
priority:
-
Global configuration in the config file.
-
Task section of the workflow definition.
-
Task-specific selectors in the config file.
The following example shows how to specify global configuration in the Nextflow config file. It sets a global timeout of 1 hour and 30 minutes:
process { time = '1h30m' }
The following example shows how to specify a time directive in the task section of the workflow definition.
This example sets a timeout of 3 days, 5 hours, and 4 minutes. This value takes precedence over the global value
in the config file, but doesn't take precedence over a task-specific time directive for my_label
in
the config file:
process myTask { label 'my_label' time '3d5h4m' script: """ your-command-here """ }
The following example shows how to specify task-specific time directives in the Nextflow config file, based
on the name or label selectors. This example sets a global task timeout value of 30 minutes. It sets a value of
2 hours for task myTask
and sets a value of 3 hours for tasks with label my_label
. For
tasks that match the selector, these values take precedence over the global value and the value in the workflow
definition:
process { time = '30m' withLabel: 'my_label' { time = '3h' } withName: 'myTask' { time = '2h' } }
Exporting task content
For workflows written in Nextflow, define a publishDir directive to export task content
to your output Amazon S3 bucket. As shown in the following example, set the publishDir value to
/mnt/workflow/pubdir
. To export files to Amazon S3, the files must be in this directory.
nextflow.enable.dsl=2 workflow { CramToBamTask(params.ref_fasta, params.ref_fasta_index, params.ref_dict, params.input_cram, params.sample_name) ValidateSamFile(CramToBamTask.out.outputBam) } process CramToBamTask { container "<account>.dkr.ecr.us-west-2.amazonaws.com/genomes-in-the-cloud" publishDir "/mnt/workflow/pubdir" input: path ref_fasta path ref_fasta_index path ref_dict path input_cram val sample_name output: path "${sample_name}.bam", emit: outputBam path "${sample_name}.bai", emit: outputBai script: """ set -eo pipefail samtools view -h -T $ref_fasta $input_cram | samtools view -b -o ${sample_name}.bam - samtools index -b ${sample_name}.bam mv ${sample_name}.bam.bai ${sample_name}.bai """ } process ValidateSamFile { container "<account>.dkr.ecr.us-west-2.amazonaws.com/genomes-in-the-cloud" publishDir "/mnt/workflow/pubdir" input: file input_bam output: path "validation_report" script: """ java -Xmx3G -jar /usr/gitc/picard.jar \ ValidateSamFile \ INPUT=${input_bam} \ OUTPUT=validation_report \ MODE=SUMMARY \ IS_BISULFITE_SEQUENCED=false """ }