Skip to content

Commit

Permalink
Merge branch 'master' into BenchmarkCNV
Browse files Browse the repository at this point in the history
  • Loading branch information
yueyaog authored Apr 14, 2023
2 parents 989492b + 0c2ce7b commit 5e64b7f
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,10 @@ workflows:
subclass: WDL
primaryDescriptorPath: /BenchmarkCNV/BenchmarkCNV/BenchmarkCNV.wdl
testParameterFiles:
- /BenchmarkCNV/BenchmarkCNV/BenchmarkCNV.inputs.json
- /BenchmarkCNV/BenchmarkCNV/BenchmarkCNV.inputs.json
- name: checkBaitSetName_dev
subclass: WDL
primaryDescriptorPath: /checkBaitSetName/checkBaitSetName.dev.wdl
testParameterFiles:
- /checkBaitSetName/checkBaitSetName.dev.inputs.json

6 changes: 6 additions & 0 deletions checkBaitSetName/checkBaitSetName.dev.inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"checkBaitSetName.compareBaitSetName.target_intervals": "File",
"checkBaitSetName.compareBaitSetName.bait_intervals": "File? (optional)",
"checkBaitSetName.compareBaitSetName.fail_task": "Boolean",
"checkBaitSetName.compareBaitSetName.bait_set": "String"
}
54 changes: 54 additions & 0 deletions checkBaitSetName/checkBaitSetName.dev.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
workflow checkBaitSetName{
call compareBaitSetName

output {
String mismatch_message = compareBaitSetName.mismatch_message
Int? bait_mismatch = compareBaitSetName.bait_mismatch
}
}

task compareBaitSetName {
String bait_set
Boolean fail_task
File target_intervals
File? bait_intervals
String target_intervals_name = basename(target_intervals)
String bait_intervals_name = if defined(bait_intervals) then basename(select_first([bait_intervals])) else bait_set + "."

command <<<
python <<CODE
import sys
target_correct = "${target_intervals_name}".startswith("${bait_set}.")
bait_correct = "${bait_intervals_name}".startswith("${bait_set}.")
if not target_correct and not bait_correct:
print("Bait and target intervals do not match the bait_set.")
open("set_mismatch.txt", 'w').write("1")
sys.stderr.write("1")
elif not target_correct:
print("Target intervals do not match the bait_set.")
open("set_mismatch.txt", 'w').write("1")
sys.stderr.write("1")
elif not bait_correct:
print("Bait intervals do not match the bait_set.")
open("set_mismatch.txt", 'w').write("1")
sys.stderr.write("1")
else:
print("bait_set matches the provided intervals.")
open("set_mismatch.txt", 'w').write("0")
CODE
>>>

output {
String mismatch_message = read_string(stdout())
Int bait_mismatch = read_int("set_mismatch.txt")
}

runtime {
docker: "python:3"
memory: "2 GB"
disks: "local-disk 10 HDD"
preemptible: 1
maxRetries: 0
failOnStderr: fail_task
}
}

0 comments on commit 5e64b7f

Please sign in to comment.