Germline & Somatic short variant discovery (SNVs + Indels) for WGS & WES.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

478 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/BQSR.wdl" as BQSR
  6. import "./tasks/Haplotyper.wdl" as Haplotyper
  7. import "./tasks/TNseq.wdl" as TNseq
  8. import "./tasks/TNscope.wdl" as TNscope
  9. import "./tasks/somatic.wdl" as somatic
  10. import "./tasks/processSomatic.wdl" as processSomatic
  11. import "./tasks/somaticFilter.wdl" as somaticFilter
  12. import "./tasks/ANNOVAR.wdl" as ANNOVAR
  13. import "./tasks/VEP.wdl" as VEP
  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. File? tumor_deduped_bam
  21. File? tumor_deduped_bam_index
  22. File? normal_deduped_bam
  23. File? normal_deduped_bam_index
  24. String SENTIEON_INSTALL_DIR
  25. String SENTIEON_LICENSE
  26. String sentieon_docker
  27. String varscan_docker
  28. String annovar_docker
  29. String vep_docker
  30. File ref_dir
  31. String fasta
  32. File dbmills_dir
  33. String db_mills
  34. File dbsnp_dir
  35. String dbsnp
  36. File germline_resource
  37. File germline_resource_tbi
  38. String hg
  39. File annovar_database
  40. File? regions
  41. Int? interval_padding
  42. File? tnseq_pon
  43. File? tnscope_pon
  44. String vep_path
  45. File cache
  46. String species
  47. String vcf2maf_path
  48. String disk_size
  49. String cluster_config
  50. Boolean haplotyper
  51. Boolean tnseq
  52. Boolean tnscope
  53. Boolean varscan
  54. Boolean annovar
  55. Boolean vep
  56. Boolean only_pass
  57. if (tumor_fastq_1!= "") {
  58. call mapping.mapping as tumor_mapping {
  59. input:
  60. group=sample_id + '_tumor',
  61. sample=sample_id + '_tumor',
  62. fastq_1=tumor_fastq_1,
  63. fastq_2=tumor_fastq_2,
  64. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  65. SENTIEON_LICENSE=SENTIEON_LICENSE,
  66. pl="ILLUMINAL",
  67. fasta=fasta,
  68. ref_dir=ref_dir,
  69. docker=sentieon_docker,
  70. disk_size=disk_size,
  71. cluster_config=cluster_config
  72. }
  73. call Metrics.Metrics as tumor_Metrics {
  74. input:
  75. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  76. SENTIEON_LICENSE=SENTIEON_LICENSE,
  77. fasta=fasta,
  78. ref_dir=ref_dir,
  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 Dedup.Dedup as tumor_Dedup {
  87. input:
  88. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  89. SENTIEON_LICENSE=SENTIEON_LICENSE,
  90. sorted_bam=tumor_mapping.sorted_bam,
  91. sorted_bam_index=tumor_mapping.sorted_bam_index,
  92. sample=sample_id + '_tumor',
  93. docker=sentieon_docker,
  94. disk_size=disk_size,
  95. cluster_config=cluster_config
  96. }
  97. call deduped_Metrics.deduped_Metrics as tumor_deduped_Metrics {
  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. sample=sample_id + '_tumor',
  106. docker=sentieon_docker,
  107. disk_size=disk_size,
  108. cluster_config=cluster_config
  109. }
  110. call BQSR.BQSR as tumor_BQSR {
  111. input:
  112. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  113. SENTIEON_LICENSE=SENTIEON_LICENSE,
  114. fasta=fasta,
  115. ref_dir=ref_dir,
  116. deduped_bam=tumor_Dedup.deduped_bam,
  117. deduped_bam_index=tumor_Dedup.deduped_bam_index,
  118. db_mills=db_mills,
  119. dbmills_dir=dbmills_dir,
  120. dbsnp=dbsnp,
  121. dbsnp_dir=dbsnp_dir,
  122. sample=sample_id + '_tumor',
  123. docker=sentieon_docker,
  124. disk_size=disk_size,
  125. cluster_config=cluster_config
  126. }
  127. }
  128. if (tumor_deduped_bam != ""){
  129. call BQSR.BQSR as tumor_BQSR {
  130. input:
  131. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  132. SENTIEON_LICENSE=SENTIEON_LICENSE,
  133. fasta=fasta,
  134. ref_dir=ref_dir,
  135. deduped_bam=tumor_deduped_bam,
  136. deduped_bam_index=tumor_deduped_bam_index,
  137. db_mills=db_mills,
  138. dbmills_dir=dbmills_dir,
  139. dbsnp=dbsnp,
  140. dbsnp_dir=dbsnp_dir,
  141. sample=sample_id + '_tumor',
  142. docker=sentieon_docker,
  143. disk_size=disk_size,
  144. cluster_config=cluster_config
  145. }
  146. }
  147. if (normal_fastq_1!= "") {
  148. call mapping.mapping as normal_mapping {
  149. input:
  150. group=sample_id + '_normal',
  151. sample=sample_id + '_normal',
  152. fastq_1=normal_fastq_1,
  153. fastq_2=normal_fastq_2,
  154. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  155. SENTIEON_LICENSE=SENTIEON_LICENSE,
  156. pl="ILLUMINAL",
  157. fasta=fasta,
  158. ref_dir=ref_dir,
  159. docker=sentieon_docker,
  160. disk_size=disk_size,
  161. cluster_config=cluster_config
  162. }
  163. call Metrics.Metrics as normal_Metrics {
  164. input:
  165. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  166. SENTIEON_LICENSE=SENTIEON_LICENSE,
  167. fasta=fasta,
  168. ref_dir=ref_dir,
  169. sorted_bam=normal_mapping.sorted_bam,
  170. sorted_bam_index=normal_mapping.sorted_bam_index,
  171. sample=sample_id + '_normal',
  172. regions=regions,
  173. docker=sentieon_docker,
  174. disk_size=disk_size,
  175. cluster_config=cluster_config
  176. }
  177. call Dedup.Dedup as normal_Dedup {
  178. input:
  179. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  180. SENTIEON_LICENSE=SENTIEON_LICENSE,
  181. sorted_bam=normal_mapping.sorted_bam,
  182. sorted_bam_index=normal_mapping.sorted_bam_index,
  183. sample=sample_id + '_normal',
  184. docker=sentieon_docker,
  185. disk_size=disk_size,
  186. cluster_config=cluster_config
  187. }
  188. call deduped_Metrics.deduped_Metrics as normal_deduped_Metrics {
  189. input:
  190. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  191. SENTIEON_LICENSE=SENTIEON_LICENSE,
  192. fasta=fasta,
  193. ref_dir=ref_dir,
  194. deduped_bam=normal_Dedup.deduped_bam,
  195. deduped_bam_index=normal_Dedup.deduped_bam_index,
  196. sample=sample_id + '_normal',
  197. regions=regions,
  198. docker=sentieon_docker,
  199. disk_size=disk_size,
  200. cluster_config=cluster_config
  201. }
  202. call BQSR.BQSR as normal_BQSR {
  203. input:
  204. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  205. SENTIEON_LICENSE=SENTIEON_LICENSE,
  206. fasta=fasta,
  207. ref_dir=ref_dir,
  208. deduped_bam=normal_Dedup.deduped_bam,
  209. deduped_bam_index=normal_Dedup.deduped_bam_index,
  210. db_mills=db_mills,
  211. dbmills_dir=dbmills_dir,
  212. dbsnp=dbsnp,
  213. dbsnp_dir=dbsnp_dir,
  214. sample=sample_id + '_normal',
  215. docker=sentieon_docker,
  216. disk_size=disk_size,
  217. cluster_config=cluster_config
  218. }
  219. }
  220. if (normal_deduped_bam != ""){
  221. call BQSR.BQSR as normal_BQSR {
  222. input:
  223. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  224. SENTIEON_LICENSE=SENTIEON_LICENSE,
  225. fasta=fasta,
  226. ref_dir=ref_dir,
  227. deduped_bam=normal_deduped_bam,
  228. deduped_bam_index=normal_deduped_bam_index,
  229. db_mills=db_mills,
  230. dbmills_dir=dbmills_dir,
  231. dbsnp=dbsnp,
  232. dbsnp_dir=dbsnp_dir,
  233. sample=sample_id + '_normal',
  234. docker=sentieon_docker,
  235. disk_size=disk_size,
  236. cluster_config=cluster_config
  237. }
  238. }
  239. if (haplotyper) {
  240. call Haplotyper.Haplotyper as Haplotyper {
  241. input:
  242. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  243. SENTIEON_LICENSE=SENTIEON_LICENSE,
  244. sample=sample_id + '_normal',
  245. fasta=fasta,
  246. ref_dir=ref_dir,
  247. deduped_bam=normal_Dedup.deduped_bam,
  248. deduped_bam_index=normal_Dedup.deduped_bam_index,
  249. recal_table=normal_BQSR.recal_table,
  250. dbsnp=dbsnp,
  251. dbsnp_dir=dbsnp_dir,
  252. regions=regions,
  253. docker=sentieon_docker,
  254. disk_size=disk_size,
  255. cluster_config=cluster_config
  256. }
  257. }
  258. if (tnseq) {
  259. call TNseq.TNseq as TNseq {
  260. input:
  261. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  262. SENTIEON_LICENSE=SENTIEON_LICENSE,
  263. sample=sample_id,
  264. normal_deduped_bam=normal_Dedup.deduped_bam,
  265. normal_deduped_bam_index=normal_Dedup.deduped_bam_index,
  266. normal_recal_table=normal_BQSR.recal_table,
  267. tumor_deduped_bam=tumor_Dedup.deduped_bam,
  268. tumor_deduped_bam_index=tumor_Dedup.deduped_bam_index,
  269. tumor_recal_table=tumor_BQSR.recal_table,
  270. normal_name=sample_id + "_normal",
  271. tumor_name=sample_id + "_tumor",
  272. fasta=fasta,
  273. ref_dir=ref_dir,
  274. regions=regions,
  275. interval_padding=interval_padding,
  276. germline_resource=germline_resource,
  277. germline_resource_tbi=germline_resource_tbi,
  278. pon_vcf=tnseq_pon,
  279. docker=sentieon_docker,
  280. cluster_config=cluster_config,
  281. disk_size=disk_size
  282. }
  283. if (annovar) {
  284. call ANNOVAR.ANNOVAR as TNseq_annovar {
  285. input:
  286. vcf=TNseq.TNseq_vcf,
  287. hg=hg,
  288. only_pass=only_pass,
  289. annovar_database=annovar_database,
  290. docker=annovar_docker,
  291. cluster_config=cluster_config,
  292. disk_size=disk_size
  293. }
  294. }
  295. if (vep) {
  296. call VEP.VEP as TNseq_VEP {
  297. input:
  298. vcf=TNseq.TNseq_vcf,
  299. hg=hg,
  300. only_pass=only_pass,
  301. sample_id=sample_id,
  302. tumor_id=sample_id + "_tumor",
  303. normal_id=sample_id + "_normal",
  304. ref_dir=ref_dir,
  305. fasta=fasta,
  306. vep_path=vep_path,
  307. cache=cache,
  308. species=species,
  309. vcf2maf_path=vcf2maf_path,
  310. docker=vep_docker,
  311. cluster_config=cluster_config,
  312. disk_size=disk_size
  313. }
  314. }
  315. }
  316. if (tnscope) {
  317. call TNscope.TNscope as TNscope {
  318. input:
  319. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  320. SENTIEON_LICENSE=SENTIEON_LICENSE,
  321. sample=sample_id,
  322. normal_deduped_bam=normal_Dedup.deduped_bam,
  323. normal_deduped_bam_index=normal_Dedup.deduped_bam_index,
  324. normal_recal_table=normal_BQSR.recal_table,
  325. tumor_deduped_bam=tumor_Dedup.deduped_bam,
  326. tumor_deduped_bam_index=tumor_Dedup.deduped_bam_index,
  327. tumor_recal_table=tumor_BQSR.recal_table,
  328. normal_name=sample_id + "_normal",
  329. tumor_name=sample_id + "_tumor",
  330. fasta=fasta,
  331. ref_dir=ref_dir,
  332. regions=regions,
  333. interval_padding=interval_padding,
  334. dbsnp=dbsnp,
  335. dbsnp_dir=dbsnp_dir,
  336. pon_vcf=tnscope_pon,
  337. docker=sentieon_docker,
  338. cluster_config=cluster_config,
  339. disk_size=disk_size
  340. }
  341. if (annovar) {
  342. call ANNOVAR.ANNOVAR as TNscope_annovar {
  343. input:
  344. vcf=TNscope.TNscope_vcf,
  345. hg=hg,
  346. only_pass=only_pass,
  347. annovar_database=annovar_database,
  348. docker=annovar_docker,
  349. cluster_config=cluster_config,
  350. disk_size=disk_size
  351. }
  352. }
  353. if (vep) {
  354. call VEP.VEP as TNscope_VEP {
  355. input:
  356. vcf=TNscope.TNscope_vcf,
  357. hg=hg,
  358. only_pass=only_pass,
  359. sample_id=sample_id,
  360. tumor_id=sample_id + "_tumor",
  361. normal_id=sample_id + "_normal",
  362. ref_dir=ref_dir,
  363. fasta=fasta,
  364. vep_path=vep_path,
  365. cache=cache,
  366. species=species,
  367. vcf2maf_path=vcf2maf_path,
  368. docker=vep_docker,
  369. cluster_config=cluster_config,
  370. disk_size=disk_size
  371. }
  372. }
  373. }
  374. if (varscan) {
  375. call somatic.somatic as somatic {
  376. input:
  377. sample=sample_id,
  378. tumor_bam=tumor_Dedup.deduped_bam,
  379. tumor_bam_index=tumor_Dedup.deduped_bam_index,
  380. normal_bam=normal_Dedup.deduped_bam,
  381. normal_bam_index=normal_Dedup.deduped_bam_index,
  382. ref_dir=ref_dir,
  383. fasta=fasta,
  384. docker=varscan_docker,
  385. disk_size=disk_size,
  386. cluster_config=cluster_config
  387. }
  388. call processSomatic.processSomatic as processSomatic {
  389. input:
  390. sample=sample_id,
  391. varscan_snp=somatic.varscan_snp,
  392. varscan_indel=somatic.varscan_indel,
  393. docker=varscan_docker,
  394. disk_size=disk_size,
  395. cluster_config=cluster_config
  396. }
  397. call somaticFilter.somaticFilter as somaticFilter {
  398. input:
  399. sample=sample_id,
  400. varscan_snp_somatic_hc=processSomatic.varscan_snp_somatic_hc,
  401. varscan_snp_germline_hc=processSomatic.varscan_snp_germline_hc,
  402. varscan_snp_loh_hc=processSomatic.varscan_snp_loh_hc,
  403. varscan_indel_somatic_hc=processSomatic.varscan_indel_somatic_hc,
  404. varscan_indel_germline_hc=processSomatic.varscan_indel_germline_hc,
  405. varscan_indel_loh_hc=processSomatic.varscan_indel_loh_hc,
  406. varscan_indel=somatic.varscan_indel,
  407. docker=varscan_docker,
  408. disk_size=disk_size,
  409. cluster_config=cluster_config
  410. }
  411. if (annovar) {
  412. call ANNOVAR.ANNOVAR as VarScan_annovar {
  413. input:
  414. vcf=somaticFilter.varscan_somatic_filter,
  415. hg=hg,
  416. only_pass=only_pass,
  417. annovar_database=annovar_database,
  418. docker=annovar_docker,
  419. cluster_config=cluster_config,
  420. disk_size=disk_size
  421. }
  422. }
  423. if (vep) {
  424. call VEP.VEP as VarScan_VEP {
  425. input:
  426. vcf=VarScan.VarScan_vcf,
  427. hg=hg,
  428. only_pass=only_pass,
  429. sample_id=sample_id,
  430. tumor_id=sample_id + "_tumor",
  431. normal_id=sample_id + "_normal",
  432. ref_dir=ref_dir,
  433. fasta=fasta,
  434. vep_path=vep_path,
  435. cache=cache,
  436. species=species,
  437. vcf2maf_path=vcf2maf_path,
  438. docker=vep_docker,
  439. cluster_config=cluster_config,
  440. disk_size=disk_size
  441. }
  442. }
  443. }
  444. }