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.

239 lines
5.8KB

  1. import "./tasks/BQSR.wdl" as Sentieon_BQSR
  2. import "./tasks/TNseq.wdl" as TNseq
  3. import "./tasks/TNscope.wdl" as TNscope
  4. import "./tasks/manta.wdl" as manta_calling
  5. import "./tasks/strelka.wdl" as strelka_calling
  6. import "./tasks/bcftools.wdl" as bcftools
  7. import "./tasks/bcftools_concat.wdl" as bcftools_concat
  8. import "./tasks/annovar.wdl" as annovar
  9. workflow {{ project_name }} {
  10. #sample info
  11. File? normal_deduped_bam
  12. File? normal_deduped_bam_bai
  13. File? tumor_deduped_bam
  14. File? tumor_deduped_bam_bai
  15. String sample_id
  16. String Seq_platform
  17. #reference fasta
  18. String ref_fasta
  19. File ref_fasta_dir
  20. File annot_gff
  21. File dbsnp_dir
  22. File dbmills_dir
  23. String dbsnp
  24. String db_mills
  25. File germline_resource
  26. File germline_resource_tbi
  27. File annovar_database
  28. #docker
  29. String docker_fastp
  30. String docker_sentieon
  31. String SENTIEON_LICENSE
  32. String docker_qualimap
  33. String docker_manta
  34. String docker_strelka
  35. String docker_bcftools
  36. String docker_annovar
  37. #config
  38. String cluster_config
  39. String disk_size
  40. Boolean? fastqc
  41. Boolean bamqc
  42. Boolean Annovar
  43. if (normal_deduped_bam != ""){
  44. call Sentieon_BQSR.Sentieon_BQSR as Sentieon_BQSR_normal{
  45. input:
  46. ref_dir=ref_fasta_dir,
  47. dbsnp_dir=dbsnp_dir,
  48. dbmills_dir = dbmills_dir,
  49. sample_id=sample_id+'_N',
  50. ref_fasta=ref_fasta,
  51. dbsnp=dbsnp,
  52. db_mills=db_mills,
  53. deduped_bam=normal_deduped_bam,
  54. deduped_bam_index=normal_deduped_bam_bai,
  55. docker=docker_sentieon,
  56. cluster_config=cluster_config,
  57. disk_size=disk_size,
  58. SENTIEON_LICENSE=SENTIEON_LICENSE
  59. }
  60. }
  61. if (tumor_deduped_bam != ""){
  62. call Sentieon_BQSR.Sentieon_BQSR as Sentieon_BQSR_tumor{
  63. input:
  64. ref_dir=ref_fasta_dir,
  65. dbsnp_dir=dbsnp_dir,
  66. dbmills_dir = dbmills_dir,
  67. sample_id=sample_id+'_T',
  68. ref_fasta=ref_fasta,
  69. dbsnp=dbsnp,
  70. db_mills=db_mills,
  71. deduped_bam=tumor_deduped_bam,
  72. deduped_bam_index=tumor_deduped_bam_bai,
  73. docker=docker_sentieon,
  74. cluster_config=cluster_config,
  75. disk_size=disk_size,
  76. SENTIEON_LICENSE=SENTIEON_LICENSE
  77. }
  78. }
  79. call TNseq.sentieon_TNseq as sentieon_TNseq{
  80. input:
  81. sample_id = sample_id,
  82. tumor_bam = Sentieon_BQSR_tumor.recaled_bam,
  83. tumor_bam_bai = Sentieon_BQSR_tumor.recaled_bam_index,
  84. normal_bam = Sentieon_BQSR_normal.recaled_bam,
  85. normal_bam_bai = Sentieon_BQSR_normal.recaled_bam_index,
  86. tumor_name = sample_id+'_T',
  87. normal_name = sample_id+'_N',
  88. ref_dir = ref_fasta_dir,
  89. ref_fasta = ref_fasta,
  90. germline_resource = germline_resource,
  91. germline_resource_tbi = germline_resource_tbi,
  92. docker = docker_sentieon,
  93. cluster_config = cluster_config,
  94. disk_size = disk_size,
  95. SENTIEON_LICENSE = SENTIEON_LICENSE
  96. }
  97. call bcftools.bcftools as TNseq_bcftools {
  98. input:
  99. vcf=sentieon_TNseq.vcf,
  100. fasta=ref_fasta,
  101. ref_dir=ref_fasta_dir,
  102. docker=docker_bcftools,
  103. cluster_config=cluster_config,
  104. disk_size=disk_size
  105. }
  106. call TNscope.sentieon_TNscope as sentieon_TNscope{
  107. input:
  108. sample_id = sample_id,
  109. tumor_bam = tumor_deduped_bam,
  110. tumor_bam_bai = tumor_deduped_bam_bai,
  111. normal_bam = normal_deduped_bam,
  112. normal_bam_bai = normal_deduped_bam_bai,
  113. tumor_name = sample_id+'_T',
  114. normal_name = sample_id+'_N',
  115. tumor_recall_data = Sentieon_BQSR_tumor.recal_table,
  116. normal_recall_data = Sentieon_BQSR_normal.recal_table,
  117. ref_dir = ref_fasta_dir,
  118. ref_fasta = ref_fasta,
  119. dbsnp_dir = dbsnp_dir,
  120. dbsnp = dbsnp,
  121. # excute env
  122. docker = docker_sentieon,
  123. cluster_config = cluster_config,
  124. disk_size = disk_size,
  125. SENTIEON_LICENSE = SENTIEON_LICENSE
  126. }
  127. call bcftools.bcftools as TNscope_bcftools {
  128. input:
  129. vcf=sentieon_TNscope.vcf,
  130. fasta=ref_fasta,
  131. ref_dir=ref_fasta_dir,
  132. docker=docker_bcftools,
  133. cluster_config=cluster_config,
  134. disk_size=disk_size
  135. }
  136. call manta_calling.manta_calling as manta_calling{
  137. input:
  138. tumor_bam = Sentieon_BQSR_tumor.recaled_bam,
  139. tumor_bam_bai = Sentieon_BQSR_tumor.recaled_bam_index,
  140. normal_bam = Sentieon_BQSR_normal.recaled_bam,
  141. normal_bam_bai = Sentieon_BQSR_normal.recaled_bam_index,
  142. ref_fasta = ref_fasta,
  143. ref_dir = ref_fasta_dir,
  144. sample_id = sample_id,
  145. docker = docker_manta,
  146. cluster_config = cluster_config,
  147. disk_size = disk_size
  148. }
  149. call strelka_calling.strelka_calling as strelka_calling{
  150. input:
  151. tumor_bam = Sentieon_BQSR_tumor.recaled_bam,
  152. tumor_bam_bai = Sentieon_BQSR_tumor.recaled_bam_index,
  153. normal_bam = Sentieon_BQSR_normal.recaled_bam,
  154. normal_bam_bai = Sentieon_BQSR_normal.recaled_bam_index,
  155. ref_fasta = ref_fasta,
  156. ref_dir = ref_fasta_dir,
  157. sample_id = sample_id,
  158. manta_indel_vcf = manta_calling.manta_indel_vcf,
  159. manta_indel_vcf_index = manta_calling.manta_indel_vcf_index,
  160. docker=docker_strelka,
  161. cluster_config=cluster_config,
  162. disk_size=disk_size
  163. }
  164. call bcftools_concat.bcftools as bcftools_concat{
  165. input:
  166. ref_dir=ref_fasta_dir,
  167. fasta=ref_fasta,
  168. vcf_indels=strelka_calling.indel_vcf,
  169. vcf_snvs=strelka_calling.snv_vcf,
  170. sample_id=sample_id,
  171. docker=docker_bcftools,
  172. cluster_config=cluster_config,
  173. disk_size=disk_size
  174. }
  175. call bcftools.bcftools as strelka_bcftools {
  176. input:
  177. vcf=bcftools_concat.concat_vcf,
  178. fasta=ref_fasta,
  179. ref_dir=ref_fasta_dir,
  180. docker=docker_bcftools,
  181. cluster_config=cluster_config,
  182. disk_size=disk_size
  183. }
  184. if (Annovar){
  185. call annovar.ANNOVAR as TNseq_ANNOVAR {
  186. input:
  187. vcf=TNseq_bcftools.norm_vcf,
  188. annovar_database=annovar_database,
  189. docker=docker_annovar,
  190. cluster_config=cluster_config,
  191. disk_size=disk_size
  192. }
  193. call annovar.ANNOVAR as TNscope_ANNOVAR {
  194. input:
  195. vcf=TNscope_bcftools.norm_vcf,
  196. annovar_database=annovar_database,
  197. docker=docker_annovar,
  198. cluster_config=cluster_config,
  199. disk_size=disk_size
  200. }
  201. call annovar.ANNOVAR as strelka_ANNOVAR {
  202. input:
  203. vcf=strelka_bcftools.norm_vcf,
  204. annovar_database=annovar_database,
  205. docker=docker_annovar,
  206. cluster_config=cluster_config,
  207. disk_size=disk_size
  208. }
  209. }
  210. }