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.

440 lines
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/BQSR.wdl" as BQSR
  6. import "./tasks/Haplotyper.wdl" as Haplotyper
  7. import "./tasks/TNseq.wdl" as TNseq
  8. import "./tasks/bcftools.wdl" as bcftools
  9. import "./tasks/ANNOVAR.wdl" as ANNOVAR
  10. import "./tasks/Manta.wdl" as Manta
  11. import "./tasks/AnnotSV.wdl" as AnnotSV
  12. import "./tasks/CNVkit.wdl" as CNVkit
  13. import "./tasks/MSIsensor.wdl" as MSIsensor
  14. import "./tasks/HRD.wdl" as HRD
  15. import "./tasks/TMB.wdl" as TMB
  16. import "./tasks/fastqc.wdl" as fastqc
  17. import "./tasks/fastqscreen.wdl" as fastqscreen
  18. import "./tasks/qualimap.wdl" as qualimap
  19. import "./tasks/TNscope.wdl" as TNscope
  20. import "./tasks/somatic.wdl" as somatic
  21. import "./tasks/processSomatic.wdl" as processSomatic
  22. import "./tasks/somaticFilter.wdl" as somaticFilter
  23. workflow {{ project_name }} {
  24. String sample_id
  25. File? tumor_fastq_1
  26. File? tumor_fastq_2
  27. File? normal_fastq_1
  28. File? normal_fastq_2
  29. String? duplex_umi
  30. String? read_structure
  31. String SENTIEON_LICENSE
  32. String sentieon_docker
  33. String manta_docker
  34. String bcftools_docker
  35. String annovar_docker
  36. String annotsv_docker
  37. String cnvkit_docker
  38. String sequenza_docker
  39. String msisensor_docker
  40. String tmb_docker
  41. String platform
  42. File ref_dir
  43. String fasta
  44. File dbmills_dir
  45. String db_mills
  46. File dbsnp_dir
  47. String dbsnp
  48. File germline_resource
  49. File germline_resource_tbi
  50. File annovar_database
  51. File annotsv_database
  52. File gc
  53. File baseline
  54. File ref_flat
  55. File? regions
  56. Int? interval_padding
  57. String disk_size
  58. String cluster_2cpu_4gb
  59. String cluster_16cpu_32gb
  60. Boolean qc
  61. String fastqc_docker
  62. String fastqscreen_docker
  63. String qualimap_docker
  64. File screen_ref_dir
  65. File fastq_screen_conf
  66. Boolean multi_caller
  67. String varscan_docker
  68. if (tumor_fastq_1!= "") {
  69. call mapping.mapping as tumor_mapping {
  70. input:
  71. group=sample_id + '.T',
  72. sample=sample_id + '.T',
  73. fastq_1=tumor_fastq_1,
  74. fastq_2=tumor_fastq_2,
  75. SENTIEON_LICENSE=SENTIEON_LICENSE,
  76. duplex_umi=duplex_umi,
  77. read_structure=read_structure,
  78. platform=platform,
  79. fasta=fasta,
  80. ref_dir=ref_dir,
  81. docker=sentieon_docker,
  82. disk_size=disk_size,
  83. cluster_config=cluster_16cpu_32gb
  84. }
  85. call Metrics.Metrics as tumor_Metrics {
  86. input:
  87. SENTIEON_LICENSE=SENTIEON_LICENSE,
  88. sample=sample_id + '.T',
  89. fasta=fasta,
  90. ref_dir=ref_dir,
  91. sorted_bam=tumor_mapping.sorted_bam,
  92. sorted_bam_index=tumor_mapping.sorted_bam_index,
  93. docker=sentieon_docker,
  94. disk_size=disk_size,
  95. cluster_config=cluster_16cpu_32gb
  96. }
  97. call Dedup.Dedup as tumor_Dedup {
  98. input:
  99. SENTIEON_LICENSE=SENTIEON_LICENSE,
  100. sample=sample_id + '.T',
  101. sorted_bam=tumor_mapping.sorted_bam,
  102. sorted_bam_index=tumor_mapping.sorted_bam_index,
  103. docker=sentieon_docker,
  104. disk_size=disk_size,
  105. cluster_config=cluster_16cpu_32gb
  106. }
  107. call deduped_Metrics.deduped_Metrics as tumor_deduped_Metrics {
  108. input:
  109. SENTIEON_LICENSE=SENTIEON_LICENSE,
  110. sample=sample_id + '.T',
  111. fasta=fasta,
  112. ref_dir=ref_dir,
  113. deduped_bam=tumor_Dedup.deduped_bam,
  114. deduped_bam_index=tumor_Dedup.deduped_bam_index,
  115. docker=sentieon_docker,
  116. disk_size=disk_size,
  117. cluster_config=cluster_16cpu_32gb
  118. }
  119. call BQSR.BQSR as tumor_BQSR {
  120. input:
  121. SENTIEON_LICENSE=SENTIEON_LICENSE,
  122. sample=sample_id + '.T',
  123. fasta=fasta,
  124. ref_dir=ref_dir,
  125. deduped_bam=tumor_Dedup.deduped_bam,
  126. deduped_bam_index=tumor_Dedup.deduped_bam_index,
  127. db_mills=db_mills,
  128. dbmills_dir=dbmills_dir,
  129. dbsnp=dbsnp,
  130. dbsnp_dir=dbsnp_dir,
  131. regions=regions,
  132. interval_padding=interval_padding,
  133. docker=sentieon_docker,
  134. disk_size=disk_size,
  135. cluster_config=cluster_16cpu_32gb
  136. }
  137. if (qc){
  138. call fastqc.fastqc as tumor_fastqc {
  139. input:
  140. sample=sample_id + '.T',
  141. read1=tumor_fastq_1,
  142. read2=tumor_fastq_2,
  143. docker=fastqc_docker,
  144. disk_size=disk_size,
  145. cluster_config=cluster_2cpu_4gb
  146. }
  147. call fastqscreen.fastq_screen as tumor_fastqscreen {
  148. input:
  149. sample=sample_id + '.T',
  150. read1=tumor_fastq_1,
  151. read2=tumor_fastq_2,
  152. screen_ref_dir=screen_ref_dir,
  153. fastq_screen_conf=fastq_screen_conf,
  154. docker=fastqscreen_docker,
  155. disk_size=disk_size,
  156. cluster_config=cluster_2cpu_4gb
  157. }
  158. call qualimap.qualimap as tumor_qualimap {
  159. input:
  160. sample=sample_id + '.T',
  161. bam=tumor_Dedup.deduped_bam,
  162. bai=tumor_Dedup.deduped_bam_index,
  163. covered_bed=regions,
  164. docker=qualimap_docker,
  165. disk_size=disk_size,
  166. cluster_config=cluster_16cpu_32gb
  167. }
  168. }
  169. }
  170. if (normal_fastq_1!= "") {
  171. call mapping.mapping as normal_mapping {
  172. input:
  173. group=sample_id + '.N',
  174. sample=sample_id + '.N',
  175. fastq_1=normal_fastq_1,
  176. fastq_2=normal_fastq_2,
  177. SENTIEON_LICENSE=SENTIEON_LICENSE,
  178. duplex_umi=duplex_umi,
  179. read_structure=read_structure,
  180. platform=platform,
  181. fasta=fasta,
  182. ref_dir=ref_dir,
  183. docker=sentieon_docker,
  184. disk_size=disk_size,
  185. cluster_config=cluster_16cpu_32gb
  186. }
  187. call Metrics.Metrics as normal_Metrics {
  188. input:
  189. SENTIEON_LICENSE=SENTIEON_LICENSE,
  190. sample=sample_id + '.N',
  191. fasta=fasta,
  192. ref_dir=ref_dir,
  193. sorted_bam=normal_mapping.sorted_bam,
  194. sorted_bam_index=normal_mapping.sorted_bam_index,
  195. regions=regions,
  196. docker=sentieon_docker,
  197. disk_size=disk_size,
  198. cluster_config=cluster_16cpu_32gb
  199. }
  200. call Dedup.Dedup as normal_Dedup {
  201. input:
  202. SENTIEON_LICENSE=SENTIEON_LICENSE,
  203. sample=sample_id + '.N',
  204. sorted_bam=normal_mapping.sorted_bam,
  205. sorted_bam_index=normal_mapping.sorted_bam_index,
  206. docker=sentieon_docker,
  207. disk_size=disk_size,
  208. cluster_config=cluster_16cpu_32gb
  209. }
  210. call deduped_Metrics.deduped_Metrics as normal_deduped_Metrics {
  211. input:
  212. SENTIEON_LICENSE=SENTIEON_LICENSE,
  213. sample=sample_id + '.N',
  214. fasta=fasta,
  215. ref_dir=ref_dir,
  216. deduped_bam=normal_Dedup.deduped_bam,
  217. deduped_bam_index=normal_Dedup.deduped_bam_index,
  218. regions=regions,
  219. docker=sentieon_docker,
  220. disk_size=disk_size,
  221. cluster_config=cluster_16cpu_32gb
  222. }
  223. call BQSR.BQSR as normal_BQSR {
  224. input:
  225. SENTIEON_LICENSE=SENTIEON_LICENSE,
  226. sample=sample_id + '.N',
  227. fasta=fasta,
  228. ref_dir=ref_dir,
  229. deduped_bam=normal_Dedup.deduped_bam,
  230. deduped_bam_index=normal_Dedup.deduped_bam_index,
  231. db_mills=db_mills,
  232. dbmills_dir=dbmills_dir,
  233. dbsnp=dbsnp,
  234. dbsnp_dir=dbsnp_dir,
  235. regions=regions,
  236. interval_padding=interval_padding,
  237. docker=sentieon_docker,
  238. disk_size=disk_size,
  239. cluster_config=cluster_16cpu_32gb
  240. }
  241. if (qc){
  242. call fastqc.fastqc as normal_fastqc {
  243. input:
  244. sample=sample_id + '.N',
  245. read1=normal_fastq_1,
  246. read2=normal_fastq_2,
  247. docker=fastqc_docker,
  248. disk_size=disk_size,
  249. cluster_config=cluster_2cpu_4gb
  250. }
  251. call fastqscreen.fastq_screen as normal_fastqscreen {
  252. input:
  253. sample=sample_id + '.N',
  254. read1=normal_fastq_1,
  255. read2=normal_fastq_2,
  256. screen_ref_dir=screen_ref_dir,
  257. fastq_screen_conf=fastq_screen_conf,
  258. docker=fastqscreen_docker,
  259. disk_size=disk_size,
  260. cluster_config=cluster_2cpu_4gb
  261. }
  262. call qualimap.qualimap as normal_qualimap {
  263. input:
  264. sample=sample_id + '.N',
  265. bam=normal_Dedup.deduped_bam,
  266. bai=normal_Dedup.deduped_bam_index,
  267. covered_bed=regions,
  268. docker=qualimap_docker,
  269. disk_size=disk_size,
  270. cluster_config=cluster_16cpu_32gb
  271. }
  272. }
  273. }
  274. call TNseq.TNseq as TNseq {
  275. input:
  276. SENTIEON_LICENSE=SENTIEON_LICENSE,
  277. sample=sample_id,
  278. normal_bam=normal_BQSR.recaled_bam,
  279. normal_bam_index=normal_BQSR.recaled_bam_index,
  280. tumor_bam=tumor_BQSR.recaled_bam,
  281. tumor_bam_index=tumor_BQSR.recaled_bam_index,
  282. normal_name=sample_id + ".N",
  283. tumor_name=sample_id + ".T",
  284. fasta=fasta,
  285. ref_dir=ref_dir,
  286. dbsnp=dbsnp,
  287. dbsnp_dir=dbsnp_dir,
  288. regions=regions,
  289. interval_padding=interval_padding,
  290. germline_resource=germline_resource,
  291. germline_resource_tbi=germline_resource_tbi,
  292. docker=sentieon_docker,
  293. cluster_config=cluster_16cpu_32gb,
  294. disk_size=disk_size
  295. }
  296. call bcftools.bcftools as TNseq_bcftools {
  297. input:
  298. vcf=TNseq.vcf,
  299. fasta=fasta,
  300. ref_dir=ref_dir,
  301. docker=bcftools_docker,
  302. cluster_config=cluster_2cpu_4gb,
  303. disk_size=disk_size
  304. }
  305. call ANNOVAR.ANNOVAR as TNseq_ANNOVAR {
  306. input:
  307. vcf=TNseq_bcftools.norm_vcf,
  308. annovar_database=annovar_database,
  309. docker=annovar_docker,
  310. cluster_config=cluster_16cpu_32gb,
  311. disk_size=disk_size
  312. }
  313. call somatic.somatic as somatic {
  314. input:
  315. sample=sample_id,
  316. normal_bam=normal_BQSR.recaled_bam,
  317. normal_bam_index=normal_BQSR.recaled_bam_index,
  318. tumor_bam=tumor_BQSR.recaled_bam,
  319. tumor_bam_index=tumor_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_16cpu_32gb
  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_16cpu_32gb
  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_16cpu_32gb
  348. }
  349. call bcftools.bcftools as VarScan_bcftools {
  350. input:
  351. vcf=somaticFilter.varscan_somatic_filter,
  352. fasta=fasta,
  353. ref_dir=ref_dir,
  354. docker=bcftools_docker,
  355. cluster_config=cluster_2cpu_4gb,
  356. disk_size=disk_size
  357. }
  358. call ANNOVAR.ANNOVAR as VarScan_ANNOVAR {
  359. input:
  360. vcf=VarScan_bcftools.norm_vcf,
  361. annovar_database=annovar_database,
  362. docker=annovar_docker,
  363. cluster_config=cluster_16cpu_32gb,
  364. disk_size=disk_size
  365. }
  366. call TNscope.TNscope as TNscope {
  367. input:
  368. SENTIEON_LICENSE=SENTIEON_LICENSE,
  369. sample=sample_id,
  370. normal_recaled_bam=normal_BQSR.recaled_bam,
  371. normal_recaled_bam_index=normal_BQSR.recaled_bam_index,
  372. tumor_recaled_bam=tumor_BQSR.recaled_bam,
  373. tumor_recaled_bam_index=tumor_BQSR.recaled_bam_index,
  374. normal_name=sample_id + ".N",
  375. tumor_name=sample_id + ".T",
  376. fasta=fasta,
  377. ref_dir=ref_dir,
  378. regions=regions,
  379. interval_padding=interval_padding,
  380. dbsnp=dbsnp,
  381. dbsnp_dir=dbsnp_dir,
  382. docker=sentieon_docker,
  383. cluster_config=cluster_16cpu_32gb,
  384. disk_size=disk_size
  385. }
  386. call bcftools.bcftools as TNscope_bcftools {
  387. input:
  388. vcf=TNscope.TNscope_vcf,
  389. fasta=fasta,
  390. ref_dir=ref_dir,
  391. docker=bcftools_docker,
  392. cluster_config=cluster_2cpu_4gb,
  393. disk_size=disk_size
  394. }
  395. call ANNOVAR.ANNOVAR as TNscope_ANNOVAR {
  396. input:
  397. vcf=TNscope_bcftools.norm_vcf,
  398. annovar_database=annovar_database,
  399. docker=annovar_docker,
  400. cluster_config=cluster_16cpu_32gb,
  401. disk_size=disk_size
  402. }
  403. }