Skip to content

Commit

Permalink
Merge pull request #105 from PacificBiosciences/hotfix/paraphase-edge…
Browse files Browse the repository at this point in the history
…-case

fix: Handle missing output for paraphase.
  • Loading branch information
williamrowell authored Dec 15, 2023
2 parents f92576b + 4999887 commit 5d55f4e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion wdl-ci.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
},
"paraphase": {
"key": "paraphase",
"digest": "p36f7pt2tghztqhtdgreyxohbjjndg3i",
"digest": "xme5pugrmhvnys5vas6jfagm65eac4hz",
"tests": [
{
"inputs": {
Expand Down
2 changes: 1 addition & 1 deletion workflows/main.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ workflow humanwgs {
# per sample paraphase outputs
Array[File] paraphase_output_jsons = sample_analysis.paraphase_output_json
Array[IndexData] paraphase_realigned_bams = sample_analysis.paraphase_realigned_bam
Array[File] paraphase_vcfs = sample_analysis.paraphase_vcfs
Array[File?] paraphase_vcfs = sample_analysis.paraphase_vcfs

# per sample hificnv outputs
Array[IndexData] hificnv_vcfs = sample_analysis.hificnv_vcf
Expand Down
12 changes: 7 additions & 5 deletions workflows/sample_analysis/sample_analysis.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ workflow sample_analysis {
# per sample paraphase outputs
File paraphase_output_json = paraphase.output_json
IndexData paraphase_realigned_bam = {"data": paraphase.realigned_bam, "data_index": paraphase.realigned_bam_index}
File paraphase_vcfs = paraphase.paraphase_vcfs
File? paraphase_vcfs = paraphase.paraphase_vcfs

# per sample hificnv outputs
IndexData hificnv_vcf = {"data": hificnv.cnv_vcf, "data_index": hificnv.cnv_vcf_index}
Expand Down Expand Up @@ -639,16 +639,18 @@ task paraphase {
--reference ~{reference} \
--out ~{out_directory}
cd ~{out_directory} \
&& tar zcvf ~{out_directory}.tar.gz ~{sample_id}_vcfs/*.vcf \
&& mv ~{out_directory}.tar.gz ../
if ls ~{out_directory}/~{sample_id}_vcfs/*.vcf &> /dev/null; then
cd ~{out_directory} \
&& tar zcvf ~{out_directory}.tar.gz ~{sample_id}_vcfs/*.vcf \
&& mv ~{out_directory}.tar.gz ../
fi
>>>
output {
File output_json = "~{out_directory}/~{sample_id}.json"
File realigned_bam = "~{out_directory}/~{sample_id}_realigned_tagged.bam"
File realigned_bam_index = "~{out_directory}/~{sample_id}_realigned_tagged.bam.bai"
File paraphase_vcfs = "~{out_directory}.tar.gz"
File? paraphase_vcfs = "~{out_directory}.tar.gz"
}

runtime {
Expand Down

0 comments on commit 5d55f4e

Please sign in to comment.