Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call_api task and update sarscov2_illumina_full with task #206

Merged
merged 20 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,8 @@ workflows:
primaryDescriptorPath: /pipes/WDL/workflows/trimal.wdl
testParameterFiles:
- empty.json
- name: update_data_tables
subclass: WDL
primaryDescriptorPath: /pipes/WDL/workflows/update_data_tables.wdl
testParameterFiles:
- empty.json
36 changes: 36 additions & 0 deletions pipes/WDL/tasks/tasks_call_api.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version 1.0

task upload_entities_tsv{
input {
String workspace_name
String terra_project
File tsv_file
Array[String] cleaned_reads_unaligned_bams_string
File meta_by_filename_json

String docker="schaluvadi/pathogen-genomic-surveillance:api-wdl"
Int? machine_mem_gb
}

command {

echo ~{sep="," cleaned_reads_unaligned_bams_string} > cleaned_bam_strings.txt

python3 /projects/cdc-sabeti-covid-19/create_data_tables.py -t ~{tsv_file} \
-p ~{terra_project} \
-w ~{workspace_name} \
-b cleaned_bam_strings.txt \
-j ~{meta_by_filename_json}

}

runtime {
docker: docker
preemptible: 0
memory: select_first([machine_mem_gb, 10]) + " GB"
}

output {
String status = read_string(stdout())
}
}
15 changes: 15 additions & 0 deletions pipes/WDL/workflows/sarscov2_illumina_full.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "../tasks/tasks_read_utils.wdl" as read_utils
import "../tasks/tasks_ncbi.wdl" as ncbi
import "../tasks/tasks_nextstrain.wdl" as nextstrain
import "../tasks/tasks_reports.wdl" as reports
import "../tasks/tasks_call_api.wdl" as fapi_tables

import "demux_deplete.wdl"
import "assemble_refbased.wdl"
Expand Down Expand Up @@ -48,6 +49,9 @@ workflow sarscov2_illumina_full {
String sra_title

Int min_genome_bases = 15000

String workspace_name
String terra_project
}
Int taxid = 2697049
String gisaid_prefix = 'hCoV-19/'
Expand Down Expand Up @@ -232,6 +236,16 @@ workflow sarscov2_illumina_full {
out_name = "gisaid-meta-~{flowcell_id}.tsv"
}

# create data tables with assembly_meta_tsv
call fapi_tables.upload_entities_tsv as data_tables {
input:
workspace_name = workspace_name,
terra_project = terra_project,
tsv_file = assembly_meta_tsv.combined,
cleaned_reads_unaligned_bams_string = demux_deplete.cleaned_reads_unaligned_bams,
meta_by_filename_json = demux_deplete.meta_by_filename_json
}

output {
Array[File] raw_reads_unaligned_bams = demux_deplete.raw_reads_unaligned_bams
Array[File] cleaned_reads_unaligned_bams = demux_deplete.cleaned_reads_unaligned_bams
Expand Down Expand Up @@ -280,5 +294,6 @@ workflow sarscov2_illumina_full {
Int num_submittable = length(select_all(submittable_id))
Int num_failed_annotation = length(select_all(failed_annotation_id))
Int num_samples = length(group_bams_by_sample.sample_names)
String data_table_status = data_tables.status
}
}
28 changes: 28 additions & 0 deletions pipes/WDL/workflows/update_data_tables.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version 1.0

import "../tasks/tasks_call_api.wdl" as update_entities_api

workflow update_data_tables {
meta {
description: "Create data tables in Terra workspace from provided tsv load file."
author: "Broad Viral Genomics"
email: "[email protected]"
}

input {
String workspace_name
String terra_project
File tsv_file
}

call update_entities_api.upload_entities_tsv as create_table {
input:
workspace_name = workspace_name,
terra_project = terra_project,
tsv_file = tsv_file
}

output {
String status_message = create_table.status
}
}