翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
HealthOmics ワークフロー定義のタスク出力
ワークフロー定義でタスク出力を指定します。デフォルトでは、ワークフローが完了すると HealthOmics はすべての中間タスクファイルを破棄します。中間ファイルをエクスポートするには、出力として定義します。
コールキャッシュを使用する場合、HealthOmics は出力として定義した中間ファイルを含め、タスク出力をキャッシュに保存します。
以下のトピックでは、各ワークフロー定義言語のタスク定義の例を示します。
WDL のタスク出力
WDL で記述されたワークフロー定義については、最上位のワークフローoutputsセクションで出力を定義します。
Omics
STDOUT のタスク出力
この例では、STDOUT コンテンツをタスク出力ファイルにエコーSayHello
する という名前のタスクを作成します。WDL stdout関数は、STDOUT コンテンツ (この例では、入力文字列 Hello World!) をファイル にキャプチャしますstdout_file。
HealthOmics はすべての STDOUT コンテンツのログを作成するため、出力はタスクの他の STDERR ログ情報とともに CloudWatch Logs にも表示されます。
version 1.0 workflow HelloWorld { input { String message = "Hello, World!" String ubuntu_container = "123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04" } call SayHello { input: message = message, container = ubuntu_container } output { File stdout_file = SayHello.stdout_file } } task SayHello { input { String message String container } command <<< echo "~{message}" echo "Current date: $(date)" echo "This message was printed to STDOUT" >>> runtime { docker: container cpu: 1 memory: "2 GB" } output { File stdout_file = stdout() } }
STDERR のタスク出力
この例では、STDERR コンテンツをタスク出力ファイルにエコーSayHello
する という名前のタスクを作成します。WDL stderr関数は、STDERR コンテンツ (この例では、入力文字列 Hello World!) をファイル にキャプチャしますstderr_file。
HealthOmics はすべての STDERR コンテンツのログを作成するため、出力はタスクの他の STDERR ログ情報とともに CloudWatch Logs に表示されます。
version 1.0 workflow HelloWorld { input { String message = "Hello, World!" String ubuntu_container = "123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04" } call SayHello { input: message = message, container = ubuntu_container } output { File stderr_file = SayHello.stderr_file } } task SayHello { input { String message String container } command <<< echo "~{message}" >&2 echo "Current date: $(date)" >&2 echo "This message was printed to STDERR" >&2 >>> runtime { docker: container cpu: 1 memory: "2 GB" } output { File stderr_file = stderr() } }
ファイルへのタスク出力
この例では、SayHello タスクは 2 つのファイル (message.txt と info.txt) を作成し、これらのファイルを名前付き出力 (message_file と info_file) として明示的に宣言します。
version 1.0 workflow HelloWorld { input { String message = "Hello, World!" String ubuntu_container = "123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04" } call SayHello { input: message = message, container = ubuntu_container } output { File message_file = SayHello.message_file File info_file = SayHello.info_file } } task SayHello { input { String message String container } command <<< # Create message file echo "~{message}" > message.txt # Create info file with date and additional information echo "Current date: $(date)" > info.txt echo "This message was saved to a file" >> info.txt >>> runtime { docker: container cpu: 1 memory: "2 GB" } output { File message_file = "message.txt" File info_file = "info.txt" } }
ファイルの配列へのタスク出力
この例では、GenerateGreetings
タスクはファイルの配列をタスク出力として生成します。タスクは、入力配列 のメンバーごとに 1 つの挨拶ファイルを動的に生成しますnames
。ファイル名はランタイムまでわからないため、出力定義は WDL glob() 関数を使用してパターン に一致するすべてのファイルを出力します*_greeting.txt
。
version 1.0 workflow HelloArray { input { Array[String] names = ["World", "Friend", "Developer"] String ubuntu_container = "123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04" } call GenerateGreetings { input: names = names, container = ubuntu_container } output { Array[File] greeting_files = GenerateGreetings.greeting_files } } task GenerateGreetings { input { Array[String] names String container } command <<< # Create a greeting file for each name for name in ~{sep=" " names}; do echo "Hello, $name!" > ${name}_greeting.txt done >>> runtime { docker: container cpu: 1 memory: "2 GB" } output { Array[File] greeting_files = glob("*_greeting.txt") } }
Nextflow のタスク出力
Nextflow で記述されたワークフロー定義の場合、タスクコンテンツを出力 Amazon S3 バケットにエクスポートする publishDir ディレクティブを定義します。publishDir 値を に設定します/mnt/workflow/pubdir
。
HealthOmics がファイルを Amazon S3 にエクスポートするには、ファイルがこのディレクトリにある必要があります。
タスクが後続のタスクへの入力として使用する出力ファイルのグループを生成する場合は、これらのファイルをディレクトリにグループ化し、そのディレクトリをタスク出力として出力することをお勧めします。個々のファイルを列挙すると、基盤となるファイルシステムで I/O ボトルネックが発生する可能性があります。例:
process my_task { ... // recommended output "output-folder/", emit: output // not recommended // output "output-folder/**", emit: output ... }
CWL のタスク出力
CWL で記述されたワークフロー定義では、タスクを使用してCommandLineTool
タスク出力を指定できます。以下のセクションでは、さまざまなタイプの出力を定義するCommandLineTool
タスクの例を示します。
STDOUT のタスク出力
この例では、STDOUT コンテンツを という名前のテキスト出力ファイルにエコーするCommandLineTool
タスクを作成しますoutput.txt。たとえば、次の入力を指定すると、結果のタスク出力は output.txt ファイル内の Hello World! になります。
{ "message": "Hello World!" }
outputs
ディレクティブは、出力名を example_outに、タイプを に指定しますstdout
。ダウンストリームタスクがこのタスクの出力を消費するには、出力を と呼びますexample_out
。
HealthOmics はすべての STDERR および STDOUT コンテンツのログを作成するため、出力はタスクの他の STDERR ログ情報とともに CloudWatch Logs にも表示されます。
cwlVersion: v1.2 class: CommandLineTool baseCommand: echo stdout: output.txt inputs: message: type: string inputBinding: position: 1 outputs: example_out: type: stdout requirements: DockerRequirement: dockerPull: 123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04 ResourceRequirement: ramMin: 2048 coresMin: 1
STDERR のタスク出力
この例では、STDERR コンテンツを という名前のテキスト出力ファイルにエコーするCommandLineTool
タスクを作成しますstderr.txt。タスクは、 が (STDOUT ではなく) STDERR にecho
書き込むbaseCommand
ように を変更します。
outputs
ディレクティブは、出力名を stderr_outに、タイプを に指定しますstderr
。
HealthOmics はすべての STDERR および STDOUT コンテンツのログを作成するため、出力はタスクの他の STDERR ログ情報とともに CloudWatch Logs に表示されます。
cwlVersion: v1.2 class: CommandLineTool baseCommand: [bash, -c] stderr: stderr.txt inputs: message: type: string inputBinding: position: 1 shellQuote: true valueFrom: "echo $(self) >&2" outputs: stderr_out: type: stderr requirements: DockerRequirement: dockerPull: 123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04 ResourceRequirement: ramMin: 2048 coresMin: 1
ファイルへのタスク出力
この例では、入力ファイルから圧縮された tar アーカイブを作成するCommandLineTool
タスクを作成します。アーカイブの名前を入力パラメータ (archive_name) として指定します。
outputs ディレクティブは、archive_file
出力タイプが であることを指定しFile
、入力パラメータへの参照を使用して出力ファイルにarchive_name
バインドします。
cwlVersion: v1.2 class: CommandLineTool baseCommand: [tar, cfz] inputs: archive_name: type: string inputBinding: position: 1 input_files: type: File[] inputBinding: position: 2 outputs: archive_file: type: File outputBinding: glob: "$(inputs.archive_name)" requirements: DockerRequirement: dockerPull: 123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04 ResourceRequirement: ramMin: 2048 coresMin: 1
ファイルの配列へのタスク出力
この例では、CommandLineTool
タスクは touch
コマンドを使用してファイルの配列を作成します。コマンドは、files-to-create
入力パラメータの文字列を使用してファイルに名前を付けます。コマンドはファイルの配列を出力します。配列には、glob
パターンに一致する作業ディレクトリ内のすべてのファイルが含まれます。この例では、すべてのファイルに一致するワイルドカードパターン (「*」) を使用しています。
cwlVersion: v1.2 class: CommandLineTool baseCommand: touch inputs: files-to-create: type: type: array items: string inputBinding: position: 1 outputs: output-files: type: type: array items: File outputBinding: glob: "*" requirements: DockerRequirement: dockerPull: 123456789012.dkr.ecr.us-east-1.amazonaws.com/dockerhub/library/ubuntu:20.04 ResourceRequirement: ramMin: 2048 coresMin: 1