-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into BenchmarkCNV
- Loading branch information
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |