common-workflow-library / legacy

Deprecated
https://github.com/common-workflow-library/bio-cwl-tools
Apache License 2.0
100 stars 62 forks source link

organization of community maintained tool & workflow descriptions #4

Open mr-c opened 9 years ago

mr-c commented 9 years ago

One file per tool. Incomplete descriptions are welcome as long as they are usable. General encouragement to share early & often

mr-c commented 9 years ago

"standing pull requests" are to be encouraged

tetron commented 9 years ago

Suggest adding this to the README

seandavi commented 8 years ago

Is there a standard for the metadata to include for later parsing into RDF and Sparql?

pgrosu commented 8 years ago

@seandavi You mean something like this via the --print-rdf argument through cwltool?

$ cwltool --print-rdf metadata-custom.cwl
@prefix CommandLineBinding: <https://w3id.org/cwl/cwl#CommandLineBinding/> .
@prefix CommandLineTool: <https://w3id.org/cwl/cwl#CommandLineTool/> .
@prefix CommandOutputBinding: <https://w3id.org/cwl/cwl#CommandOutputBinding/> .
@prefix Dirent: <https://w3id.org/cwl/cwl#Dirent/> .
@prefix DockerRequirement: <https://w3id.org/cwl/cwl#DockerRequirement/> .
@prefix EnvVarRequirement: <https://w3id.org/cwl/cwl#EnvVarRequirement/> .
@prefix EnvironmentDef: <https://w3id.org/cwl/cwl#EnvironmentDef/> .
@prefix ExpressionTool: <https://w3id.org/cwl/cwl#ExpressionTool/> .
@prefix File: <https://w3id.org/cwl/cwl#File/> .
@prefix InlineJavascriptRequirement: <https://w3id.org/cwl/cwl#InlineJavascriptRequirement/> .
@prefix LinkMergeMethod: <https://w3id.org/cwl/cwl#LinkMergeMethod/> .
@prefix Parameter: <https://w3id.org/cwl/cwl#Parameter/> .
@prefix ResourceRequirement: <https://w3id.org/cwl/cwl#ResourceRequirement/> .
@prefix ScatterMethod: <https://w3id.org/cwl/cwl#ScatterMethod/> .
@prefix SchemaDefRequirement: <https://w3id.org/cwl/cwl#SchemaDefRequirement/> .
@prefix SoftwarePackage: <https://w3id.org/cwl/cwl#SoftwarePackage/> .
@prefix SoftwareRequirement: <https://w3id.org/cwl/cwl#SoftwareRequirement/> .
@prefix Workflow: <https://w3id.org/cwl/cwl#Workflow/> .
@prefix cwl: <https://w3id.org/cwl/cwl#> .
@prefix ns1: <rdfs:> .
@prefix ns2: <http://xmlns.com/foaf/0.1/> .
@prefix ns3: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sld: <https://w3id.org/cwl/salad#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<file:///home/pgrosu/storage/metadata-custom.cwl> a cwl:CommandLineTool ;
    ns3:creator <http://orcid.org/0000-0003-3566-7705> ;
    cwl:baseCommand ( "cat" ) ;
    cwl:cwlVersion cwl:v1.0 ;
    cwl:hints [ a cwl:DockerRequirement ;
            DockerRequirement:dockerPull "debian:wheezy" ] ;
    cwl:inputs <file:///home/pgrosu/storage/metadata-custom.cwl#file1>,
        <file:///home/pgrosu/storage/metadata-custom.cwl#numbering> ;
    ns1:comment "Print the contents of a file to stdout using 'cat' running in a docker container." .

<file:///home/pgrosu/storage/metadata-custom.cwl#file1> cwl:inputBinding [ CommandLineBinding:position 1 ] ;
    sld:type cwl:File .

<file:///home/pgrosu/storage/metadata-custom.cwl#numbering> cwl:inputBinding [ CommandLineBinding:position 0 ;
            CommandLineBinding:prefix "-n" ] ;
    sld:type xsd:boolean,
        sld:null .

<http://orcid.org/0000-0003-3566-7705> ns2:mbox "mailto:peter.amstutz@curoverse.com" ;
    ns2:name "Peter Amstutz" .

$

The above was generated using the 1.0 version of cwltool, and with the following files:

$ wget https://raw.githubusercontent.com/RDFLib/rdflib/master/examples/foaf.rdf
$ wget https://raw.githubusercontent.com/common-workflow-language/cwltool/fafbdb5c077a67567c97bb89abd005732e458a7f/cwltool/schemas/v1.0/v1.0/dcterms.rdf
$ cat metadata-custom.cwl
#!/usr/bin/env cwl-runner
$namespaces:
  dct: http://purl.org/dc/terms/
  foaf: http://xmlns.com/foaf/0.1/
$schemas:
  - foaf.rdf
  - dcterms.rdf

cwlVersion: v1.0
class: CommandLineTool
doc: "Print the contents of a file to stdout using 'cat' running in a docker container."

dct:creator:
  id: "http://orcid.org/0000-0003-3566-7705"
  foaf:name: Peter Amstutz
  foaf:mbox: "mailto:peter.amstutz@curoverse.com"

hints:
  DockerRequirement:
    dockerPull: debian:wheezy
inputs:
  file1:
    type: File
    inputBinding: {position: 1}
  numbering:
    type: boolean?
    inputBinding:
      position: 0
      prefix: -n
outputs: []
baseCommand: cat

Hope it helps, ~p

seandavi commented 8 years ago

Yep. That is what I had in mind. Just need to digest all that now. Thanks, @pgrosu.