2.19. ソフトウェア要求事項の指定#

多くの場合、ツール定義はソフトウェアの特定のバージョン用に書かれます。他の人があなたの説明を使いやすくするために、hints セクションに SoftwareRequirement フィールドを含めることができます。これは、ツール定義がどのツールのどのバージョン用に書かれたかについての混乱を避けるのにも役立ちます。

#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool

label: "InterProScan: protein sequence classifier"

doc: |
      Version 5.21-60 can be downloaded here:
      https://interproscan-docs.readthedocs.io/en/latest/HowToDownload.html

      Documentation on how to run InterProScan 5 can be found here:
      https://interproscan-docs.readthedocs.io/en/latest/HowToRun.html

requirements:
  ResourceRequirement:
    ramMin: 10240
    coresMin: 3
  SchemaDefRequirement:
    types:
      - $import: InterProScan-apps.yml

hints:
  SoftwareRequirement:
    packages:
      interproscan:
        specs: [ "https://identifiers.org/rrid/RRID:SCR_005829" ]
        version: [ "5.21-60" ]

inputs:
  proteinFile:
    type: File
    inputBinding:
      prefix: --input
  applications:
    type: InterProScan-apps.yml#apps[]?
    inputBinding:
      itemSeparator: ','
      prefix: --applications

baseCommand: interproscan.sh

arguments:
 - valueFrom: $(inputs.proteinFile.nameroot).i5_annotations
   prefix: --outfile
 - valueFrom: TSV
   prefix: --formats
 - --disable-precalc
 - --goterms
 - --pathways
 - valueFrom: $(runtime.tmpdir)
   prefix: --tempdir


outputs:
  i5Annotations:
    type: File
    format: iana:text/tab-separated-values
    outputBinding:
      glob: $(inputs.proteinFile.nameroot).i5_annotations

$namespaces:
 iana: https://www.iana.org/assignments/media-types/
 s: https://schema.org/
$schemas:
 - https://schema.org/version/latest/schemaorg-current-http.rdf

s:license: https://spdx.org/licenses/Apache-2.0
s:copyrightHolder: "EMBL - European Bioinformatics Institute"

この例では、定義されるソフトウェア要件はInterProScanバージョン5.21-60です。

hints:
  SoftwareRequirement:
    packages:
      interproscan:
        specs: [ "https://identifiers.org/rrid/RRID:SCR_005829" ]
        version: [ "5.21-60" ]

CWL runnerによっては、これらのヒントを使用して、ジョブの実行前に必要なソフトウェアがインストールされ、利用可能であることをチェックできます。リファレンス実装でこれらのチェックを有効にするには、依存性解決のための設定 を使用します。

バージョン番号だけでなく、ツールの一意なリソース識別子(URI)がRRIDの形で与えられます。RRIDを持つリソースはSciCrunchレジストリで検索することができ、科学リソースを一貫して検索、追跡、参照するためのポータルを提供します。ツールを SoftwareRequirement として指定したい場合は、SciCrunch でツールを検索し、レジストリで割り当てられた RRID を使用してください。(ツールを SciCrunch に追加するには リソースの追加チュートリアル を参照してください)。この RRID を使って、(identifiers.org 経由で)要件説明の specs フィールドでツールを参照できます。他の良い選択としては、優先順位の高い順に、メインのツールの引用のためのDOIとツールのURLを含めることです。