2.19. Specifying Software Requirements#

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"

In this example, the software requirement being described is InterProScan version 5.21-60.

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

Depending on your CWL runner, these hints may be used to check that the required software is installed and available before the job is run. To enable these checks with the reference implementation, use the dependency resolvers configuration.

As well as a version number, a unique resource identifier (URI) for the tool is given in the form of an RRID. Resources with RRIDs can be looked up in the SciCrunch registry, which provides a portal for finding, tracking, and referring to scientific resources consistently. If you want to specify a tool as a SoftwareRequirement, search for the tool on SciCrunch and use the RRID that it has been assigned in the registry. (Follow this Adding a Resource Tutorial to add a tool to SciCrunch). You can use this RRID to refer to the tool (via identifiers.org) in the specs field of your requirement description. Other good choices, in order of preference, are to include the DOI for the main tool citation and the URL to the tool.