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.

427 line
12KB

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