common-workflow-language / common-workflow-language/cwl-utils

CWL steps given in alphabetical order rather than the order in the CWL file

Open
#326 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
43
Forks
28
Avg merge
4h 7m
Merged PRs (30d)
4

Description

If I load a CWL workflow using `load_document_by_uri` then the object .steps are in alphabetical order rather than the order they were given in the file.

For example parsing the attached file

``` python
cwl_obj = load_document_by_uri(cwl_filename)
for step in cwl_obj.steps:
print( step.id.split("#")[-1])
```

will output
`'ProteinProphet_02', 'StPeter_04', 'XTandem_01', 'XTandem_03'`
instead of
`'XTandem_01', 'ProteinProphet_02', 'XTandem_03', 'StPeter_04'`

File contents:
``` yaml

# WorkflowNo_22
# This workflow is generated by APE (https://github.com/sanctuuary/APE).
cwlVersion: v1.2
class: Workflow

label: WorkflowNo_22
doc: A workflow including the tool(s) XTandem, ProteinProphet, XTandem, StPeter.

inputs:
input_1:
type: File
format: "http://edamontology.org/format_3244" # mzML
input_2:
type: File
format: "http://edamontology.org/format_1929" # FASTA
steps:
XTandem_01:
run: https://raw.githubusercontent.com/Workflomics/tools-and-domains/main/cwl-tools/xtandem/xtandem.cwl
in:
XTandem_in_1: input_1
XTandem_in_2: input_2
out: [XTandem_out_1]
ProteinProphet_02:
run: https://raw.githubusercontent.com/Workflomics/tools-and-domains/main/cwl-tools/proteinprophet/proteinprophet.cwl
in:
ProteinProphet_in_1: XTandem_01/XTandem_out_1
ProteinProphet_in_2: input_2
out: [ProteinProphet_out_1, ProteinProphet_out_2]
XTandem_03:
run: https://raw.githubusercontent.com/Workflomics/tools-and-domains/main/cwl-tools/xtandem/xtandem.cwl
in:
XTandem_in_1: input_1
XTandem_in_2: input_2
out: [XTandem_out_1]
StPeter_04:
run: https://raw.githubusercontent.com/Workflomics/tools-and-domains/main/cwl-tools/stpeter/stpeter.cwl
in:
StPeter_in_1: ProteinProphet_02/ProteinProphet_out_1
StPeter_in_2: XTandem_03/XTandem_out_1
StPeter_in_3: input_1
out: [StPeter_out_1]
outputs:
output_1:
type: File
format: "http://edamontology.org/format_3747" # protXML
outputSource: StPeter_04/StPeter_out_1

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the supplied CWL workflow and tracing load_document_by_uri while it builds cwl_obj.steps. Compare the resulting step sequence with the order in the file; done when the object preserves that source order rather than alphabetical order.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.