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.

411 line
11KB

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