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.

429 lines
13KB

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