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.

241 line
5.8KB

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