Germline & Somatic short variant discovery (SNVs + Indels) for WGS & WES.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

workflow.wdl 12KB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. import "./tasks/mapping.wdl" as mapping
  2. import "./tasks/Metrics.wdl" as Metrics
  3. import "./tasks/Dedup.wdl" as Dedup
  4. import "./tasks/deduped_Metrics.wdl" as deduped_Metrics
  5. import "./tasks/Realigner.wdl" as Realigner
  6. import "./tasks/BQSR.wdl" as BQSR
  7. import "./tasks/Haplotyper.wdl" as Haplotyper
  8. import "./tasks/TNseq.wdl" as TNseq
  9. import "./tasks/TNscope.wdl" as TNscope
  10. import "./tasks/somatic.wdl" as somatic
  11. import "./tasks/processSomatic.wdl" as processSomatic
  12. import "./tasks/somaticFilter.wdl" as somaticFilter
  13. import "./tasks/annovar.wdl" as annovar
  14. workflow {{ project_name }} {
  15. String sample_id
  16. File? tumor_fastq_1
  17. File? tumor_fastq_2
  18. File normal_fastq_1
  19. File normal_fastq_2
  20. String SENTIEON_INSTALL_DIR
  21. String SENTIEON_LICENSE
  22. String sentieon_docker
  23. String varscan_docker
  24. String annovar_docker
  25. File ref_dir
  26. String fasta
  27. File dbmills_dir
  28. String db_mills
  29. File dbsnp_dir
  30. String dbsnp
  31. File germline_resource
  32. File germline_resource_tbi
  33. String hg
  34. File database
  35. File? regions
  36. Int? interval_padding
  37. File? tnseq_pon
  38. File? tnscope_pon
  39. String disk_size
  40. String cluster_config
  41. Boolean haplotyper
  42. Boolean tnseq
  43. Boolean tnscope
  44. Boolean varscan
  45. if (tumor_fastq_1!= "") {
  46. call mapping.mapping as tumor_mapping {
  47. input:
  48. group=sample_id + '_tumor',
  49. sample=sample_id + '_tumor',
  50. fastq_1=tumor_fastq_1,
  51. fastq_2=tumor_fastq_2,
  52. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  53. SENTIEON_LICENSE=SENTIEON_LICENSE,
  54. pl="ILLUMINAL",
  55. fasta=fasta,
  56. ref_dir=ref_dir,
  57. docker=sentieon_docker,
  58. disk_size=disk_size,
  59. cluster_config=cluster_config
  60. }
  61. call Metrics.Metrics as tumor_Metrics {
  62. input:
  63. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  64. SENTIEON_LICENSE=SENTIEON_LICENSE,
  65. fasta=fasta,
  66. ref_dir=ref_dir,
  67. sorted_bam=tumor_mapping.sorted_bam,
  68. sorted_bam_index=tumor_mapping.sorted_bam_index,
  69. sample=sample_id + '_tumor',
  70. docker=sentieon_docker,
  71. disk_size=disk_size,
  72. cluster_config=cluster_config
  73. }
  74. call Dedup.Dedup as tumor_Dedup {
  75. input:
  76. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  77. SENTIEON_LICENSE=SENTIEON_LICENSE,
  78. sorted_bam=tumor_mapping.sorted_bam,
  79. sorted_bam_index=tumor_mapping.sorted_bam_index,
  80. sample=sample_id + '_tumor',
  81. docker=sentieon_docker,
  82. disk_size=disk_size,
  83. cluster_config=cluster_config
  84. }
  85. call deduped_Metrics.deduped_Metrics as tumor_deduped_Metrics {
  86. input:
  87. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  88. SENTIEON_LICENSE=SENTIEON_LICENSE,
  89. fasta=fasta,
  90. ref_dir=ref_dir,
  91. deduped_bam=tumor_Dedup.deduped_bam,
  92. deduped_bam_index=tumor_Dedup.deduped_bam_index,
  93. sample=sample_id + '_tumor',
  94. docker=sentieon_docker,
  95. disk_size=disk_size,
  96. cluster_config=cluster_config
  97. }
  98. call Realigner.Realigner as tumor_Realigner {
  99. input:
  100. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  101. SENTIEON_LICENSE=SENTIEON_LICENSE,
  102. fasta=fasta,
  103. ref_dir=ref_dir,
  104. deduped_bam=tumor_Dedup.deduped_bam,
  105. deduped_bam_index=tumor_Dedup.deduped_bam_index,
  106. db_mills=db_mills,
  107. dbmills_dir=dbmills_dir,
  108. sample=sample_id + '_tumor',
  109. docker=sentieon_docker,
  110. disk_size=disk_size,
  111. cluster_config=cluster_config
  112. }
  113. call BQSR.BQSR as tumor_BQSR {
  114. input:
  115. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  116. SENTIEON_LICENSE=SENTIEON_LICENSE,
  117. fasta=fasta,
  118. ref_dir=ref_dir,
  119. realigned_bam=tumor_Realigner.realigner_bam,
  120. realigned_bam_index=tumor_Realigner.realigner_bam_index,
  121. db_mills=db_mills,
  122. dbmills_dir=dbmills_dir,
  123. dbsnp=dbsnp,
  124. dbsnp_dir=dbsnp_dir,
  125. sample=sample_id + '_tumor',
  126. docker=sentieon_docker,
  127. disk_size=disk_size,
  128. cluster_config=cluster_config
  129. }
  130. }
  131. call mapping.mapping as normal_mapping {
  132. input:
  133. group=sample_id + '_normal',
  134. sample=sample_id + '_normal',
  135. fastq_1=normal_fastq_1,
  136. fastq_2=normal_fastq_2,
  137. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  138. SENTIEON_LICENSE=SENTIEON_LICENSE,
  139. pl="ILLUMINAL",
  140. fasta=fasta,
  141. ref_dir=ref_dir,
  142. docker=sentieon_docker,
  143. disk_size=disk_size,
  144. cluster_config=cluster_config
  145. }
  146. call Metrics.Metrics as normal_Metrics {
  147. input:
  148. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  149. SENTIEON_LICENSE=SENTIEON_LICENSE,
  150. fasta=fasta,
  151. ref_dir=ref_dir,
  152. sorted_bam=normal_mapping.sorted_bam,
  153. sorted_bam_index=normal_mapping.sorted_bam_index,
  154. sample=sample_id + '_normal',
  155. regions=regions,
  156. docker=sentieon_docker,
  157. disk_size=disk_size,
  158. cluster_config=cluster_config
  159. }
  160. call Dedup.Dedup as normal_Dedup {
  161. input:
  162. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  163. SENTIEON_LICENSE=SENTIEON_LICENSE,
  164. sorted_bam=normal_mapping.sorted_bam,
  165. sorted_bam_index=normal_mapping.sorted_bam_index,
  166. sample=sample_id + '_normal',
  167. docker=sentieon_docker,
  168. disk_size=disk_size,
  169. cluster_config=cluster_config
  170. }
  171. call deduped_Metrics.deduped_Metrics as normal_deduped_Metrics {
  172. input:
  173. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  174. SENTIEON_LICENSE=SENTIEON_LICENSE,
  175. fasta=fasta,
  176. ref_dir=ref_dir,
  177. deduped_bam=normal_Dedup.deduped_bam,
  178. deduped_bam_index=normal_Dedup.deduped_bam_index,
  179. sample=sample_id + '_normal',
  180. regions=regions,
  181. docker=sentieon_docker,
  182. disk_size=disk_size,
  183. cluster_config=cluster_config
  184. }
  185. call Realigner.Realigner as normal_Realigner {
  186. input:
  187. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  188. SENTIEON_LICENSE=SENTIEON_LICENSE,
  189. fasta=fasta,
  190. ref_dir=ref_dir,
  191. deduped_bam=normal_Dedup.deduped_bam,
  192. deduped_bam_index=normal_Dedup.deduped_bam_index,
  193. db_mills=db_mills,
  194. dbmills_dir=dbmills_dir,
  195. sample=sample_id + '_normal',
  196. docker=sentieon_docker,
  197. disk_size=disk_size,
  198. cluster_config=cluster_config
  199. }
  200. call BQSR.BQSR as normal_BQSR {
  201. input:
  202. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  203. SENTIEON_LICENSE=SENTIEON_LICENSE,
  204. fasta=fasta,
  205. ref_dir=ref_dir,
  206. realigned_bam=normal_Realigner.realigner_bam,
  207. realigned_bam_index=normal_Realigner.realigner_bam_index,
  208. db_mills=db_mills,
  209. dbmills_dir=dbmills_dir,
  210. dbsnp=dbsnp,
  211. dbsnp_dir=dbsnp_dir,
  212. sample=sample_id + '_normal',
  213. docker=sentieon_docker,
  214. disk_size=disk_size,
  215. cluster_config=cluster_config
  216. }
  217. if (haplotyper) {
  218. call Haplotyper.Haplotyper as Haplotyper {
  219. input:
  220. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  221. SENTIEON_LICENSE=SENTIEON_LICENSE,
  222. sample=sample_id + '_normal',
  223. fasta=fasta,
  224. ref_dir=ref_dir,
  225. recaled_bam=normal_BQSR.recaled_bam,
  226. recaled_bam_index=normal_BQSR.recaled_bam_index,
  227. recal_table=normal_BQSR.recal_table,
  228. dbsnp=dbsnp,
  229. dbsnp_dir=dbsnp_dir,
  230. regions=regions,
  231. docker=sentieon_docker,
  232. disk_size=disk_size,
  233. cluster_config=cluster_config
  234. }
  235. }
  236. if (tnseq) {
  237. call TNseq.TNseq as TNseq {
  238. input:
  239. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  240. SENTIEON_LICENSE=SENTIEON_LICENSE,
  241. sample=sample_id,
  242. normal_recaled_bam=normal_BQSR.recaled_bam,
  243. normal_recaled_bam_index=normal_BQSR.recaled_bam_index,
  244. normal_recal_table=normal_BQSR.recal_table,
  245. tumor_recaled_bam=tumor_BQSR.recaled_bam,
  246. tumor_recaled_bam_index=tumor_BQSR.recaled_bam_index,
  247. tumor_recal_table=tumor_BQSR.recal_table,
  248. normal_name=sample_id + "_normal",
  249. tumor_name=sample_id + "_tumor",
  250. fasta=fasta,
  251. ref_dir=ref_dir,
  252. regions=regions,
  253. interval_padding=interval_padding,
  254. germline_resource=germline_resource,
  255. germline_resource_tbi=germline_resource_tbi,
  256. pon_vcf=tnseq_pon,
  257. docker=sentieon_docker,
  258. cluster_config=cluster_config,
  259. disk_size=disk_size
  260. }
  261. call annovar.annovar as TNseq_annovar {
  262. input:
  263. sample=sample_id,
  264. vcf=TNseq.TNseq_vcf,
  265. hg=hg,
  266. database=database,
  267. docker=annovar_docker,
  268. cluster_config=cluster_config,
  269. disk_size=disk_size
  270. }
  271. }
  272. if (tnscope) {
  273. call TNscope.TNscope as TNscope {
  274. input:
  275. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  276. SENTIEON_LICENSE=SENTIEON_LICENSE,
  277. sample=sample_id,
  278. normal_deduped_bam=normal_Dedup.deduped_bam,
  279. normal_deduped_bam_index=normal_Dedup.deduped_bam_index,
  280. normal_recal_table=normal_BQSR.recal_table,
  281. tumor_deduped_bam=tumor_Dedup.deduped_bam,
  282. tumor_deduped_bam_index=tumor_Dedup.deduped_bam_index,
  283. tumor_recal_table=tumor_BQSR.recal_table,
  284. normal_name=sample_id + "_normal",
  285. tumor_name=sample_id + "_tumor",
  286. fasta=fasta,
  287. ref_dir=ref_dir,
  288. regions=regions,
  289. interval_padding=interval_padding,
  290. dbsnp=dbsnp,
  291. dbsnp_dir=dbsnp_dir,
  292. pon_vcf=tnscope_pon,
  293. docker=sentieon_docker,
  294. cluster_config=cluster_config,
  295. disk_size=disk_size
  296. }
  297. call annovar.annovar as TNscope_annovar {
  298. input:
  299. sample=sample_id,
  300. vcf=TNscope.TNscope_vcf,
  301. hg=hg,
  302. database=database,
  303. docker=annovar_docker,
  304. cluster_config=cluster_config,
  305. disk_size=disk_size
  306. }
  307. }
  308. if (varscan) {
  309. call somatic.somatic as somatic {
  310. input:
  311. sample=sample_id,
  312. tumor_bam=tumor_BQSR.recaled_bam,
  313. tumor_bam_index=tumor_BQSR.recaled_bam_index,
  314. normal_bam=normal_BQSR.recaled_bam,
  315. normal_bam_index=normal_BQSR.recaled_bam_index,
  316. ref_dir=ref_dir,
  317. fasta=fasta,
  318. docker=varscan_docker,
  319. disk_size=disk_size,
  320. cluster_config=cluster_config
  321. }
  322. call processSomatic.processSomatic as processSomatic {
  323. input:
  324. sample=sample_id,
  325. varscan_snp=somatic.varscan_snp,
  326. varscan_indel=somatic.varscan_indel,
  327. docker=varscan_docker,
  328. disk_size=disk_size,
  329. cluster_config=cluster_config
  330. }
  331. call somaticFilter.somaticFilter as somaticFilter {
  332. input:
  333. sample=sample_id,
  334. varscan_snp_somatic_hc=processSomatic.varscan_snp_somatic_hc,
  335. varscan_snp_germline_hc=processSomatic.varscan_snp_germline_hc,
  336. varscan_snp_loh_hc=processSomatic.varscan_snp_loh_hc,
  337. varscan_indel_somatic_hc=processSomatic.varscan_indel_somatic_hc,
  338. varscan_indel_germline_hc=processSomatic.varscan_indel_germline_hc,
  339. varscan_indel_loh_hc=processSomatic.varscan_indel_loh_hc,
  340. varscan_indel=somatic.varscan_indel,
  341. docker=varscan_docker,
  342. disk_size=disk_size,
  343. cluster_config=cluster_config
  344. }
  345. call annovar.annovar as snp_somatic_annovar {
  346. input:
  347. sample=sample_id,
  348. vcf=somaticFilter.varscan_snp_somatic_filter,
  349. database=database,
  350. docker=annovar_docker,
  351. cluster_config=cluster_config,
  352. disk_size=disk_size
  353. }
  354. call annovar.annovar as snp_loh_annovar {
  355. input:
  356. sample=sample_id,
  357. vcf=somaticFilter.varscan_snp_loh_filter,
  358. database=database,
  359. docker=annovar_docker,
  360. cluster_config=cluster_config,
  361. disk_size=disk_size
  362. }
  363. call annovar.annovar as indel_somatic_annovar {
  364. input:
  365. sample=sample_id,
  366. vcf=somaticFilter.varscan_indel_somatic_filter,
  367. database=database,
  368. docker=annovar_docker,
  369. cluster_config=cluster_config,
  370. disk_size=disk_size
  371. }
  372. call annovar.annovar as indel_loh_annovar {
  373. input:
  374. sample=sample_id,
  375. vcf=somaticFilter.varscan_indel_loh_filter,
  376. database=database,
  377. docker=annovar_docker,
  378. cluster_config=cluster_config,
  379. disk_size=disk_size
  380. }
  381. }
  382. }