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.

264 lines
6.3KB

  1. import "./tasks/fastp.wdl" as fastp
  2. import "./tasks/fastqTobam.wdl" as fastqTobam
  3. import "./tasks/qualimap.wdl" as qualimap
  4. import "./tasks/BQSR.wdl" as Sentieon_BQSR
  5. import "./tasks/TNseq.wdl" as TNseq
  6. import "./tasks/TNscope.wdl" as TNscope
  7. import "./tasks/manta.wdl" as manta_calling
  8. import "./tasks/strelka.wdl" as strelka_calling
  9. workflow {{ project_name }} {
  10. #sample info
  11. File? normal_in1
  12. File? normal_in2
  13. File? tumor_in1
  14. File? tumor_in2
  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? regions
  26. Int? interval_padding
  27. File germline_resource
  28. File germline_resource_tbi
  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. #config
  37. String cluster_config
  38. String disk_size
  39. Boolean fastqc=false
  40. Boolean bamqc=false
  41. if (normal_in1 != ""){
  42. if (fastqc){
  43. call fastp.fastp as fastp_normal{
  44. input:
  45. in1=normal_in1,
  46. in2=normal_in2,
  47. sample_id=sample_id+'_N',
  48. docker=docker_fastp,
  49. cluster_config=cluster_config,
  50. disk_size=disk_size
  51. }
  52. if (!fastqc){
  53. call fastqTobam.SentieonFastqToBam as SentieonFastqToBam_normal{
  54. input:
  55. fastq1=normal_in1,
  56. fastq2=normal_in2,
  57. sample_id=sample_id+'_N',
  58. Seq_platform=Seq_platform,
  59. ref_fasta=ref_fasta,
  60. ref_fasta_dir=ref_fasta_dir,
  61. SENTIEON_LICENSE=SENTIEON_LICENSE,
  62. docker=docker_sentieon,
  63. cluster_config=cluster_config,
  64. disk_size=disk_size
  65. }
  66. if (bamqc){
  67. call qualimap.qualimap as qualimap_normal{
  68. input:
  69. sample_id=sample_id+'_N',
  70. bam_file=SentieonFastqToBam_normal.deduped_bam,
  71. bam_bai=SentieonFastqToBam_normal.deduped_bam_bai,
  72. annot_gff=annot_gff,
  73. docker=docker_qualimap,
  74. cluster_config=cluster_config,
  75. disk_size=disk_size
  76. }
  77. }
  78. call Sentieon_BQSR.Sentieon_BQSR as Sentieon_BQSR_normal{
  79. input:
  80. ref_dir=ref_fasta_dir,
  81. dbsnp_dir=dbsnp_dir,
  82. dbmills_dir = dbmills_dir,
  83. sample_id=sample_id+'_N',
  84. ref_fasta=ref_fasta,
  85. dbsnp=dbsnp,
  86. db_mills=db_mills,
  87. deduped_bam=SentieonFastqToBam_normal.deduped_bam,
  88. deduped_bam_index=SentieonFastqToBam_normal.deduped_bam_bai,
  89. regions=regions,
  90. interval_padding=interval_padding,
  91. docker=docker_sentieon,
  92. cluster_config=cluster_config,
  93. disk_size=disk_size,
  94. SENTIEON_LICENSE=SENTIEON_LICENSE
  95. }
  96. }
  97. }
  98. }
  99. if (tumor_in1 != ""){
  100. if (fastqc){
  101. call fastp.fastp as fastp_tumor{
  102. input:
  103. in1=tumor_in1,
  104. in2=tumor_in2,
  105. sample_id=sample_id+'_T',
  106. docker=docker_fastp,
  107. cluster_config=cluster_config,
  108. disk_size=disk_size
  109. }
  110. if (!fastqc){
  111. call fastqTobam.SentieonFastqToBam as SentieonFastqToBam_tumor{
  112. input:
  113. fastq1=tumor_in1,
  114. fastq2=tumor_in2,
  115. sample_id=sample_id+'_T',
  116. Seq_platform=Seq_platform,
  117. ref_fasta=ref_fasta,
  118. ref_fasta_dir=ref_fasta_dir,
  119. SENTIEON_LICENSE=SENTIEON_LICENSE,
  120. docker=docker_sentieon,
  121. cluster_config=cluster_config,
  122. disk_size=disk_size
  123. }
  124. if (bamqc){
  125. call qualimap.qualimap as qualimap_tumor{
  126. input:
  127. sample_id=sample_id+'_T',
  128. bam_file=SentieonFastqToBam_tumor.deduped_bam,
  129. bam_bai=SentieonFastqToBam_tumor.deduped_bam_bai,
  130. annot_gff=annot_gff,
  131. docker=docker_qualimap,
  132. cluster_config=cluster_config,
  133. disk_size=disk_size
  134. }
  135. }
  136. call Sentieon_BQSR.Sentieon_BQSR as Sentieon_BQSR_tumor{
  137. input:
  138. ref_dir=ref_fasta_dir,
  139. dbsnp_dir=dbsnp_dir,
  140. dbmills_dir = dbmills_dir,
  141. sample_id=sample_id+'_T',
  142. ref_fasta=ref_fasta,
  143. dbsnp=dbsnp,
  144. db_mills=db_mills,
  145. deduped_bam=SentieonFastqToBam_normal.deduped_bam,
  146. deduped_bam_index=SentieonFastqToBam_normal.deduped_bam_bai,
  147. regions=regions,
  148. interval_padding=interval_padding,
  149. docker=docker_sentieon,
  150. cluster_config=cluster_config,
  151. disk_size=disk_size,
  152. SENTIEON_LICENSE=SENTIEON_LICENSE
  153. }
  154. }
  155. }
  156. }
  157. call TNseq.sentieon_TNseq as sentieon_TNseq{
  158. input:
  159. sample_id = sample_id,
  160. tumor_bam = Sentieon_BQSR_tumor.recaled_bam,
  161. tumor_bam_bai = Sentieon_BQSR_tumor.recaled_bam_index,
  162. normal_bam = Sentieon_BQSR_normal.recaled_bam,
  163. normal_bam_bai = Sentieon_BQSR_normal.recaled_bam_index,
  164. tumor_name = sample_id+'_T',
  165. normal_name = sample_id+'_N',
  166. ref_dir = ref_fasta_dir,
  167. ref_fasta = ref_fasta,
  168. germline_resource = germline_resource,
  169. germline_resource_tbi = germline_resource_tbi,
  170. docker = docker_sentieon,
  171. cluster_config = cluster_config,
  172. disk_size = disk_size,
  173. SENTIEON_LICENSE = SENTIEON_LICENSE
  174. }
  175. call TNscope.sentieon_TNscope as sentieon_TNscope{
  176. input:
  177. sample_id = sample_id,
  178. tumor_bam = Sentieon_BQSR_tumor.recaled_bam,
  179. tumor_bam_bai = Sentieon_BQSR_tumor.recaled_bam_index,
  180. normal_bam = Sentieon_BQSR_normal.recaled_bam,
  181. normal_bam_bai = Sentieon_BQSR_normal.recaled_bam_index,
  182. tumor_name = sample_id+'_T',
  183. normal_name = sample_id+'_N',
  184. tumor_recall_data = Sentieon_BQSR_normal.recaled_bam,
  185. normal_recall_data = Sentieon_BQSR_normal.recaled_bam_index,
  186. ref_dir = ref_fasta_dir,
  187. ref_fasta = ref_fasta,
  188. regions = regions,
  189. interval_padding = interval_padding,
  190. dbsnp_dir = dbsnp_dir,
  191. dbsnp = dbsnp,
  192. # excute env
  193. docker = docker_sentieon,
  194. cluster_config = cluster_config,
  195. disk_size = disk_size,
  196. SENTIEON_LICENSE = SENTIEON_LICENSE
  197. }
  198. call manta_calling.manta_calling as manta_calling{
  199. input:
  200. tumor_bam = Sentieon_BQSR_tumor.recaled_bam,
  201. tumor_bam_bai = Sentieon_BQSR_tumor.recaled_bam_index,
  202. normal_bam = Sentieon_BQSR_normal.recaled_bam,
  203. normal_bam_bai = Sentieon_BQSR_normal.recaled_bam_index,
  204. ref_fasta = ref_fasta,
  205. ref_dir = ref_fasta_dir,
  206. sample_id = sample_id,
  207. docker = docker_manta,
  208. cluster_config = cluster_config,
  209. disk_size = disk_size
  210. }
  211. call strelka_calling.strelka_calling as strelka_calling{
  212. input:
  213. tumor_bam = Sentieon_BQSR_tumor.recaled_bam,
  214. tumor_bam_bai = Sentieon_BQSR_tumor.recaled_bam_index,
  215. normal_bam = Sentieon_BQSR_normal.recaled_bam,
  216. normal_bam_bai = Sentieon_BQSR_normal.recaled_bam_index,
  217. ref_fasta = ref_fasta,
  218. ref_dir = ref_fasta_dir,
  219. sample_id = sample_id,
  220. manta_indel_vcf = manta_calling.manta_indel_vcf,
  221. manta_indel_vcf_index = manta_calling.manta_indel_vcf_index,
  222. docker=docker_strelka,
  223. cluster_config=cluster_config,
  224. disk_size=disk_size
  225. }
  226. }