Skip to content

Commit 87ad1b6

Browse files
authored
Fix parsing analysis workflow id (#55)
Get the first subworkflow id from the analysis output path, which corresponds to the analysis workflow id.
1 parent 1345340 commit 87ad1b6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pipeline_tools/get_analysis_metadata.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ def get_workflow_id(analysis_output_path):
1616
workflow_id (str): string giving Cromwell UUID of the workflow.
1717
"""
1818
url = analysis_output_path
19-
hash_end = url.rfind("/call-")
20-
hash_start = url.rfind('/', 0, hash_end) + 1
21-
workflow_id = url[hash_start:hash_end]
19+
calls = url.split('/call-')
20+
workflow_id = calls[1].split('/')[-1]
2221
with open('workflow_id.txt', 'w') as f:
2322
f.write(workflow_id)
2423
return workflow_id

pipeline_tools/tests/test_get_analysis_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def setUp(self):
1919
self.cromwell_url = '{}/{}/metadata?expandSubWorkflows=true'.format(base_url, self.workflow_id)
2020
self.caas_url = '{}/{}/metadata?expandSubWorkflows=true'.format(caas_base_url, self.workflow_id)
2121

22-
@unittest.skip('Skipping until get_worflow_id correctly parses the analysis subworkflow id')
2322
def test_get_workflow_id(self):
2423
analysis_output_path = 'gs://broad-dsde-mint-dev-cromwell-execution/cromwell-executions/AdapterSmartSeq2SingleCell/workflow_id/call-analysis/SmartSeq2SingleCell/analysis_subworkflow_id/call-qc/RunHisat2Pipeline/qc_workflow_id/call-Hisat2/12345_qc.hisat2.met.txt'
2524
result = get_analysis_metadata.get_workflow_id(analysis_output_path)

0 commit comments

Comments
 (0)