-
Notifications
You must be signed in to change notification settings - Fork 0
/
cellranger_VDJ_makeReference_1.0.0.wdl
90 lines (72 loc) · 2.05 KB
/
cellranger_VDJ_makeReference_1.0.0.wdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
version 1.0
workflow cellranger_vdj_create_reference {
input {
File input_fasta
File input_gtf
String genome
File cellranger_tar_gz
String disk_space = "100 GB"
String memory = "32 GB"
Int num_cpu = 8
}
call run_cellranger_vdj_create_reference {
input:
cellranger_tar_gz = cellranger_tar_gz,
disk_space = disk_space,
memory = memory,
num_cpu = num_cpu,
input_fasta = input_fasta,
input_gtf = input_gtf,
genome = genome
}
output {
File output_reference = run_cellranger_vdj_create_reference.output_reference
}
}
task run_cellranger_vdj_create_reference {
input {
File cellranger_tar_gz
String disk_space
String memory
Int num_cpu
File input_fasta
File input_gtf
String genome
}
command <<<
set -e
export TMPDIR=/tmp
mkdir cellranger
tar -zxf "~{cellranger_tar_gz}" -C cellranger --strip-components 1
mkdir reference
mkdir results
python3 <<CODE
import os
import subprocess
cellranger_path = os.path.join(os.getcwd(), 'cellranger')
os.environ["PATH"] = "{}:{}".format(cellranger_path, os.environ["PATH"])
def run_command(command):
print("Executing: " + ' '.join(command))
subprocess.check_call(command)
fasta_path = "~{input_fasta}"
gtf_path = "~{input_gtf}"
mkvdjref_cmd = [
"cellranger", "mkvdjref",
"--genome=" + "~{genome}",
"--fasta=" + fasta_path,
"--genes=" + gtf_path
]
run_command(mkvdjref_cmd)
CODE
tar -czf "~{genome}_ref.tar.gz" "~{genome}"
>>>
output {
File output_reference = "~{genome}_ref.tar.gz"
}
runtime {
docker: "python:3.9.19-slim-bullseye"
cpu: num_cpu
memory: memory
disk: disk_space
}
}