Skip to content

Commit 543f194

Browse files
committed
Sync Kallisto extract WDL contract
1 parent e2b8519 commit 543f194

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

pipes/WDL/tasks/tasks_metagenomics.wdl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ task kallisto_read_summary {
850850
category: "required"
851851
}
852852
sample_id: {
853-
description: "Optional sample identifier to stamp into summary.tsv. Defaults to the input reads basename with common BAM/FASTQ extensions removed.",
853+
description: "Optional sample identifier to stamp into the Kallisto summary TSV. Defaults to the input reads basename with common BAM/FASTQ extensions removed.",
854854
category: "common"
855855
}
856856
target_ids: {
@@ -863,7 +863,7 @@ task kallisto_read_summary {
863863
category: "common"
864864
}
865865
id_to_taxon_map: {
866-
description: "Optional CSV/TSV mapping Kallisto hit IDs to taxonomy columns. When provided, taxonomy lineage and selected taxonomy name are added to summary.tsv.",
866+
description: "Optional CSV/TSV mapping Kallisto hit IDs to taxonomy columns. When provided, taxonomy lineage and selected taxonomy name are added to the Kallisto summary TSV.",
867867
patterns: ["*.csv", "*.tsv", "*.csv.gz", "*.tsv.gz"],
868868
category: "common"
869869
}
@@ -896,6 +896,7 @@ task kallisto_read_summary {
896896
String out_basename = sub(sub(sub(sub(sub(basename(reads_bam), "\\.bam$", ""), "\\.fastq\\.gz$", ""), "\\.fq\\.gz$", ""), "\\.fastq$", ""), "\\.fq$", "")
897897
String output_sample_id = select_first([sample_id, out_basename])
898898
String extract_dir = out_basename + ".kallisto_extract"
899+
String summary_tsv_filename = output_sample_id + ".kallisto_summary.tsv"
899900
Int disk_size = ceil((8 * size(reads_bam, "GB") + 2 * size(kallisto_index, "GB") + size(t2g, "GB") + size(h5ad_file, "GB") + size(id_to_taxon_map, "GB") + 100) / 375.0) * 375
900901

901902
command <<<
@@ -932,18 +933,19 @@ task kallisto_read_summary {
932933
--out_dir "~{extract_dir}" \
933934
~{true="--protein" false="" protein} \
934935
--sample-id "~{output_sample_id}" \
935-
--summary-tsv "~{extract_dir}/summary.tsv" \
936936
"${TAXONOMY_ARGS[@]}" \
937937
--taxonomy-level "~{taxonomy_level}" \
938938
--threads "~{cpu}" \
939939
"${TARGET_ARGS[@]}" \
940940
--loglevel=DEBUG
941941
942+
cp "~{extract_dir}/summary.tsv" "~{summary_tsv_filename}"
943+
942944
{ if [ -f /sys/fs/cgroup/memory.peak ]; then cat /sys/fs/cgroup/memory.peak; elif [ -f /sys/fs/cgroup/memory/memory.max_usage_in_bytes ]; then cat /sys/fs/cgroup/memory/memory.max_usage_in_bytes; else echo "0"; fi } > MEM_BYTES
943945
>>>
944946

945947
output {
946-
File summary_tsv = "~{extract_dir}/summary.tsv"
948+
File summary_tsv = "~{summary_tsv_filename}"
947949
Int max_ram_gb = ceil(read_float("MEM_BYTES")/1000000000)
948950
String viralngs_version = read_string("VERSION")
949951
}

pipes/WDL/workflows/classify_kallisto.wdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ workflow classify_kallisto {
4646
category: "required"
4747
}
4848
sample_id: {
49-
description: "Optional sample identifier to stamp into Kallisto count and summary TSV outputs. Defaults to the input reads basename with common BAM/FASTQ extensions removed.",
49+
description: "Optional sample identifier to stamp into Kallisto count and summary TSV outputs, and to name the summary output as <sample_id>.kallisto_summary.tsv. Defaults to the input reads basename with common BAM/FASTQ extensions removed.",
5050
category: "common"
5151
}
5252
id_to_taxon_map: {
53-
description: "Optional CSV/TSV mapping Kallisto hit IDs to taxonomy columns. When provided, taxonomy lineage and selected taxonomy name are added to summary.tsv.",
53+
description: "Optional CSV/TSV mapping Kallisto hit IDs to taxonomy columns. When provided, taxonomy lineage and selected taxonomy name are added to the Kallisto summary TSV.",
5454
patterns: ["*.csv", "*.tsv", "*.csv.gz", "*.tsv.gz"],
5555
category: "common"
5656
}

0 commit comments

Comments
 (0)