2.19. 指定软件需求#
Often, tool descriptions will be written for a specific version of a software. To
make it easier for others to use your descriptions, you can include a
SoftwareRequirement
field in the hints
section.
This may also help to avoid confusion about which version of a tool the
description was written for.
#!/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"
本例中描述的软件要求为 5.21-60 版本的 InterProScan.
hints:
SoftwareRequirement:
packages:
interproscan:
specs: [ "https://identifiers.org/rrid/RRID:SCR_005829" ]
version: [ "5.21-60" ]
您的 CWL 运行程序有可能支持在运行作业前根据提示检查所需软件是否已安装就绪。如果要让参考实现启用此类检查,请使用依赖项解析配置。
此处我们不仅给出了工具的版本号,还以 RRID 的形式给出了该工具的统一资源标识符 (URI) 。查找以 RRID 标识的资源可以使用 SciCrunch 注册表。该信息门户网站可供查询、跟踪和一致引用科学资源。如果要将工具指定为 SoftwareRequirement
,请在 SciCrunch 上找到该工具并使用该注册表中为其分配的 RRID(如需将工具添加到 SciCrunch 请参考 添加资源教程 )。您可以使用此 RRID, 通过 identifiers.org 在需求描述的 specs
字段中引用该工具。此外,加入主要工具参考文献的 DOI 以及工具的 URL, 也是合适的选择。