Source incompatible with Sink
0
0
Entering edit mode
3.4 years ago
Levi ▴ 10

csp.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: Workflow

requirements:
  - class: ScatterFeatureRequirement
  - class: SubworkflowFeatureRequirement

inputs:
  pdb_id_array: string[]
  pdb_filename_array: string[]
  pdbH_file_array: string[]
  CS_path_array: string[]
  CS_file_array: string[]
  temp_file_array: string[]
  chain: string
  py_buildPDB: File
  cfg_file: File
  add_hydrogen_script: File
  shift_predict_script: File
  pH_value: float
  temp: float
  outputFormat: string
  cs_predictor: string
  task_insertCS: string
  task_buildPDB: string
outputs:
  output_files:
    type: File[]
    outputSource: subworkflow1/output_files

steps:
  subworkflow1:
    in:
      pdb_id: pdb_id_array
      pdb_filename: pdb_filename_array
      pdbH_file: pdbH_file_array
      CS_path: CS_path_array
      CS_file: CS_file_array
      temp_file: temp_file_array
    scatter: [pdb_id, pdb_filename, pdbH_file, CS_path, CS_file, temp_file]
    out: [output_files]
    run:
      class: Workflow
      requirements:
        - class: ScatterFeatureRequirement
      inputs:
        pdb_id: string
        pdb_filename: string
        chain: string
        py_buildPDB: File
        cfg_file: File
        temp_file: string
        pdbH_file: string
        add_hydrogen_script: File
        CS_path: string
        CS_file: string
        shift_predict_script: File
        pH_value: float
        temp: float
        outputFormat: string
        cs_predictor: string
        task_insertCS: string
        task_buildPDB: string
      outputs:
        output_files:
          type: File[]
          outputSource: [create_pdbFile/pdbFile, protonate/pdbH_File, predictChemShift/CS_file]
      steps:
        create_pdbFile:
          run: buildPDB.cwl
          scatter: [pdbID, pdbFilename]
          scatterMethod: dotproduct
          in:
            pdbID: pdb_id
            pdbFilename: pdb_filename
            Chain: chain
            cfgFile: cfg_file
            pyBuildPDB: py_buildPDB
            taskBuildPDB: task_buildPDB
          out: [pdbFile]
        protonate:
          run: addHydrogen.cwl
          scatter: [tempFile, protonatedPDB]
          scatterMethod: dotproduct
          in:
            addHydrogen_script: add_hydrogen_script
            pdb_to_addHydrogens: create_pdbFile/pdbFile
            protonatedPDB: pdbH_file
            tempFile: temp_file
          out: [pdbH_File]
        predictChemShift:
          run: shiftPredict.cwl
          scatter: [chemical_shiftDir, chemical_shiftName]
          scatterMethod: dotproduct
          in:
            shiftPredict_script: shift_predict_script
            protonated_pdb: protonate/pdbH_File
            chemical_shiftDir: CS_path
            chemical_shiftName: CS_file
            format: outputFormat
            pH: pH_value
            temperature: temp
          out: [CS_file]
        populateDatabase:
          run: populate_database.cwl
          scatter: [pdbID]
          in:
            pyInsertCS: py_buildPDB
            pH: pH_value
            temperature: temp
            csPredictor: cs_predictor
            chemicalShifts: predictChemShift/CS_file
            Chain: chain
            pdbID: pdb_id
            cfgFile: cfg_file
            taskInsertCS: task_insertCS
          out: []

csp.yml

pdb_id: [2TRX, 1UB4]
pdb_filename: [2TRX.pdb, 1UB4.pdb]
chain: A
py_buildPDB:
  class: File
  path: /local/PycharmProjects/CSPworkflow/code/usage/resources/buildPDBfile.py
cfg_file:
  class: File
  path: /local/PycharmProjects/CSPworkflow/code/usage/configs/query.cfg
pdbH_file: [2TRX_protonated.pdb, 1UB4_protonated.pdb]
temp_file: [/local/PycharmProjects/CSPworkflow/code/usage/temp.pdb, /local/PycharmProjects/CSPworkflow/code/usage/temp2.pdb]
add_hydrogen_script:
  class: File
  path: /local/PycharmProjects/CSPworkflow/code/usage/addHydrogen.sh
CS_path: [/local/PycharmProjects/CSPworkflow/code/usage/2TRX_chemicalShift.csv, /local/PycharmProjects/CSPworkflow/code/usage/1UB4_chemicalShift.csv]
CS_file: [2TRX_chemicalShift2.csv, 1UB4_chemicalShift2.csv]
outputFormat: CSV
pH_value: 7.0
temp: 298.0
shift_predict_script:
  class: File
  path: /local/PycharmProjects/CSPworkflow/code/usage/shiftPredict.sh
cs_predictor: shiftx2
task_buildPDB: build_pdb
task_insertCS: insert_cs

buildPDB.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: python3

inputs:
  pyBuildPDB:
    type: File
    inputBinding:
      position: 0
  taskBuildPDB:
    type: string
    inputBinding:
      position: 1
      prefix: --task
  pdbID:
    type: string
    inputBinding:
      position: 2
      prefix: --pdb_id
  Chain:
    type: string
    inputBinding:
      position: 3
      prefix: --chain
  pdbFilename:
    type: string
  cfgFile:
    type: File
    inputBinding:
      position: 4
      prefix: --cfg_file

outputs:
  pdbFile:
    type: File
    outputBinding:
      glob: $(inputs.pdbFilename)

addHydrogen.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: sh

inputs:
  addHydrogen_script:
    type: File
    inputBinding:
      position: 0
  pdb_to_addHydrogens:
    type: File
    inputBinding:
      position: 1
  tempFile:
    type: string
    inputBinding:
      position: 2
  protonatedPDB:
    type: string
    inputBinding:
      position: 3

outputs:
  pdbH_File:
    type: File
    outputBinding:
      glob: $(inputs.protonatedPDB)

shiftPredict.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
#baseCommand: [python, /usr/software/SHIFTX2/shiftx2.py]
#baseCommand: [bash, /home/nmrbox/lcraft/Desktop/caricWorkflow_FM/shiftPredict.sh]
baseCommand: bash

inputs:
  shiftPredict_script:
    type: File
    inputBinding:
      position: 0
  protonated_pdb:
#    type: string
    type: File
    inputBinding:
      position: 1
#      prefix: -i
  chemical_shiftDir:
    type: string
    inputBinding:
      position: 2
#      prefix: -o
  temperature:
    type: float
    inputBinding:
      position: 3
#      prefix: -t
  pH:
    type: float
    inputBinding:
      position: 4
#      prefix: -p
  format:
    type: string
    inputBinding:
      position: 5
#      prefix: -f
  chemical_shiftName:
    type: string
    inputBinding:
      position: 6

#outputs: []
outputs:
  CS_file:
    type: File
    outputBinding:
      glob: $(inputs.chemical_shiftName)

populate_database.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: python3

inputs:
  pyInsertCS:
    type: File
    inputBinding:
      position: 0
  taskInsertCS:
    type: string
    inputBinding:
      position: 1
      prefix: --task
  pdbID:
    type: string
    inputBinding:
      position: 2
      prefix: --pdb_id
  Chain:
    type: string
    inputBinding:
      position: 3
      prefix: --chain
  cfgFile:
    type: File
    inputBinding:
      position: 4
      prefix: --cfg_file
  csPredictor:
    type: string
    inputBinding:
      position: 5
      prefix: --csp_name
  chemicalShifts:
    type: File
    inputBinding:
      position: 6
      prefix: --cs_file
  pH:
    type: float
    inputBinding:
      position: 7
      prefix: --pH
  temperature:
    type: float
    inputBinding:
      position: 8
      prefix: --temp

outputs: []

Error:

usage$ cwl-runner csp_shiftx.cwl csp_shiftx.yml 
csp_shiftx.cwl:57:9:   Source 'CS_path' of type "string" is incompatible
csp_shiftx.cwl:100:13:     with sink 'chemical_shiftDir' of type {"items": "string", "type": "array"}
csp_shiftx.cwl:58:9:   Source 'CS_file' of type "string" is incompatible
csp_shiftx.cwl:101:13:     with sink 'chemical_shiftName' of type {"items": "string", "type": "array"}
csp_shiftx.cwl:92:17:   Source 'pdbH_File' of type {"items": "File", "type": "array"} is incompatible
csp_shiftx.cwl:99:13:     with sink 'protonated_pdb' of type "File"
csp_shiftx.cwl:50:9:   Source 'pdb_filename' of type "string" is incompatible
csp_shiftx.cwl:77:13:     with sink 'pdbFilename' of type {"items": "string", "type": "array"}
csp_shiftx.cwl:49:9:   Source 'pdb_id' of type "string" is incompatible
csp_shiftx.cwl:76:13:     with sink 'pdbID' of type {"items": "string", "type": "array"}
csp_shiftx.cwl:105:17:   Source 'CS_file' of type {"items": "File", "type": "array"} is incompatible
csp_shiftx.cwl:114:13:     with sink 'chemicalShifts' of type "File"
csp_shiftx.cwl:49:9:   Source 'pdb_id' of type "string" is incompatible
csp_shiftx.cwl:116:13:     with sink 'pdbID' of type {"items": "string", "type": "array"}
csp_shiftx.cwl:82:17:   Source 'pdbFile' of type {"items": "File", "type": "array"} is incompatible
csp_shiftx.cwl:89:13:     with sink 'pdb_to_addHydrogens' of type "File"
csp_shiftx.cwl:55:9:   Source 'pdbH_file' of type "string" is incompatible
csp_shiftx.cwl:90:13:     with sink 'protonatedPDB' of type {"items": "string", "type": "array"}
csp_shiftx.cwl:54:9:   Source 'temp_file' of type "string" is incompatible
csp_shiftx.cwl:91:13:     with sink 'tempFile' of type {"items": "string", "type": "array"}
csp_shiftx.cwl:82:17:   Source 'pdbFile' of type {"items": "File", "type": "array"} is incompatible
csp_shiftx.cwl:68:11:     with sink 'output_files' of type {"type": "array", "items": "File"}
csp_shiftx.cwl:68:11:     source has linkMerge method merge_nested
csp_shiftx.cwl:92:17:   Source 'pdbH_File' of type {"items": "File", "type": "array"} is incompatible
csp_shiftx.cwl:68:11:     with sink 'output_files' of type {"type": "array", "items": "File"}
csp_shiftx.cwl:68:11:     source has linkMerge method merge_nested
csp_shiftx.cwl:105:17:   Source 'CS_file' of type {"items": "File", "type": "array"} is incompatible
csp_shiftx.cwl:68:11:     with sink 'output_files' of type {"type": "array", "items": "File"}
csp_shiftx.cwl:68:11:     source has linkMerge method merge_nested
CWL • 743 views
ADD COMMENT
0
Entering edit mode

Hello Levi. Thanks for including all these details. The place to go for CWL support has moved from biostars to https://cwl.discourse.group/

ADD REPLY
1
Entering edit mode

Thank you Michael! Been testing the waters with CWL for the past few months and am now expanding to batch processing. Fingers-crossed I can get over this hump in transitioning.

ADD REPLY

Login before adding your answer.

Traffic: 2046 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6