diff --git a/workflow/main.yaml b/workflow/main.yaml index 4d20c24..e0caae4 100644 --- a/workflow/main.yaml +++ b/workflow/main.yaml @@ -78,7 +78,7 @@ workflow: type: string specimen_type: type: string - tumor_bams: + tumour_bams: type: array items: type: object @@ -146,7 +146,7 @@ workflow: tool: download_files input: normal_bam: normal_bam - tumor_bams: tumor_bams + tumour_bams: tumour_bams vcf_files: associated_vcfs depends_on: null @@ -155,7 +155,7 @@ workflow: input: input_directory: directory@download_files normal_bam: normal_bam - tumor_bams: tumor_bams + tumour_bams: tumour_bams vcf_files: associated_vcfs sv_padding: sv_padding snv_padding: snv_padding @@ -169,7 +169,7 @@ workflow: input: input_directory: directory@download_files normal_bam: normal_bam - tumor_bams: tumor_bams + tumour_bams: tumour_bams experiment: experiment indel_padding: indel_padding snv_padding: snv_padding @@ -209,7 +209,7 @@ tools: input: normal_bam: type: object - tumor_bams: + tumour_bams: type: array vcf_files: type: array @@ -224,7 +224,7 @@ tools: type: string normal_bam: type: object - tumor_bams: + tumour_bams: type: array vcf_files: type: array @@ -245,7 +245,7 @@ tools: type: string normal_bam: type: object - tumor_bams: + tumour_bams: type: array experiment: type: object diff --git a/workflow/tools/download.py b/workflow/tools/download.py index 6d41746..0124a95 100644 --- a/workflow/tools/download.py +++ b/workflow/tools/download.py @@ -26,7 +26,7 @@ def download_file(object_id, out_dir, file_name): file_name = task_dict.get('input').get('normal_bam').get('file_name') download_file(object_id, cwd, file_name) -# Download tumor bam files +# Download tumour bam files for i in range(0,len(task_dict.get('input').get('tumour_bams'))): object_id = task_dict.get('input').get('tumour_bams')[i].get('object_id') file_name = task_dict.get('input').get('tumour_bams')[i].get('file_name') diff --git a/workflow/tools/generate_song_payloads.py b/workflow/tools/generate_song_payloads.py index ad2400b..981cba2 100644 --- a/workflow/tools/generate_song_payloads.py +++ b/workflow/tools/generate_song_payloads.py @@ -18,7 +18,7 @@ input_directory = task_dict.get('input').get('input_directory') normal_bam = task_dict.get('input').get('normal_bam') -tumor_bams = task_dict.get('input').get('tumour_bams') +tumour_bams = task_dict.get('input').get('tumour_bams') experiment = task_dict.get('input').get('experiment') indel_padding = task_dict.get('input').get('indel_padding') snv_padding = task_dict.get('input').get('snv_padding') @@ -73,9 +73,9 @@ def create_payload_json(bam, experiment, input_directory, output_file, associate create_payload_json(normal_bam, experiment, input_directory, os.path.join(input_directory, 'normal_minibam.json'), associated_vcfs) payloads.append('normal_minibam.json') -for i in range(0,len(tumor_bams)): - create_payload_json(tumor_bams[i], experiment, input_directory, os.path.join(input_directory, 'tumor_minibam_'+str(i)+'.json'), associated_vcfs) - payloads.append( 'tumor_minibam_'+str(i)+'.json') +for i in range(0,len(tumour_bams)): + create_payload_json(tumour_bams[i], experiment, input_directory, os.path.join(input_directory, 'tumour_minibam_'+str(i)+'.json'), associated_vcfs) + payloads.append( 'tumour_minibam_'+str(i)+'.json') save_output_json({ 'payloads': payloads diff --git a/workflow/tools/test.py b/workflow/tools/test.py deleted file mode 100644 index c6ef5cd..0000000 --- a/workflow/tools/test.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import argparse -from overture_song.model import ApiConfig -from overture_song.tools import FileUploadClient, FileUploadState - -def main(): - parser = argparse.ArgumentParser(description='Upload payload using SONG') - parser.add_argument('-i', '--input', dest="input", help="Payload file", required=True) - parser.add_argument('-s', '--study', dest="study_id", help="Study ID", required=True) - parser.add_argument('-a', '--access-token', dest="access_token", help="Access Token", default=os.environ.get('ACCESSTOKEN',None),required=True) - parser.add_argument('-d', '--destination-url', dest="server_url", help="Server URL",required=True) - results = parser.parse_args() - - config = ApiConfig(results.server_url, results.study_id, results.access_token, True) - file_upload_client = FileUploadClient(config, results.input, True) - - - - -def upload_file_client(file_upload_client): - file_upload_client.upload() - - if file_upload_client.upload_id is None: - raise ValueError('Upload id is empty') - if not file_upload_client.upload_errors is None: - raise ValueError(file_upload_client.upload_errors[0]) - if not file_upload_client.upload_state is FileUploadState.SUBMITTED: - raise ValueError('Payload has not been uploaded') - - file_upload_client.update_status() - - if not file_upload_client.upload_state is FileUploadState.VALIDATED: - raise ValueError('Payload validation failed') - if not file_upload_client.upload_errors is None: - raise ValueError(file_upload_client.upload_errors[0]) - - file_upload_client.save() - - if not file_upload_client is FileUploadState.SAVED: - raise ValueError('Payload has not been saved') - if not file_upload_client.upload_errors is None: - raise ValueError(file_upload_client.upload_errors[0]) - if file_upload_client.analysis_id is None: - raise ValueError('An error occured while saving the payload') - - -if __name__ == "__main__": - main() \ No newline at end of file