Skip to content
Snippets Groups Projects
Commit 508945fb authored by Cats's avatar Cats
Browse files

add scatter reorder task

parent 9c978d3a
No related branches found
No related tags found
1 merge request!70Some new tasks and memory setting changes
......@@ -200,6 +200,34 @@ task FastqSync {
}
}
task ReorderGlobbedScatters {
input {
Array[File]+ scatters
String scatterDir
}
command <<<
python << CODE
from os.path import basename
scatters = ['~{sep="','" scatters}']
splitext = [basename(x).split(".") for x in scatters]
splitnum = [x.split("-") + [y] for x,y in splitext]
ordered = sorted(splitnum, key=lambda x: int(x[1]))
merged = ["~{scatterDir}/{}-{}.{}".format(x[0],x[1],x[2]) for x in ordered]
for x in merged:
print(x)
CODE
>>>
output {
Array[String] reorderedScatters = read_lines(stdout())
}
runtime {
memory: 1
}
}
task ScatterRegions {
input {
String? preCommand
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment