import "./tasks/mapping.wdl" as mapping import "./tasks/Metrics.wdl" as Metrics import "./tasks/Dedup.wdl" as Dedup import "./tasks/deduped_Metrics.wdl" as deduped_Metrics import "./tasks/BQSR.wdl" as BQSR import "./tasks/Haplotyper.wdl" as Haplotyper import "./tasks/TNseq.wdl" as TNseq import "./tasks/TNscope.wdl" as TNscope import "./tasks/somatic.wdl" as somatic import "./tasks/processSomatic.wdl" as processSomatic import "./tasks/somaticFilter.wdl" as somaticFilter import "./tasks/replaceRG.wdl" as replaceRG import "./tasks/pindel.wdl" as pindel import "./tasks/ANNOVAR.wdl" as ANNOVAR import "./tasks/VEP.wdl" as VEP workflow {{ project_name }} { String sample_id File? tumor_fastq_1 File? tumor_fastq_2 File? normal_fastq_1 File? normal_fastq_2 File? tumor_deduped_bam File? normal_deduped_bam Boolean input_fastq Boolean input_bam String SENTIEON_INSTALL_DIR String SENTIEON_LICENSE String sentieon_docker String varscan_docker String pindel_docker String samtools_docker String annovar_docker String vep_docker String pl File ref_dir String fasta File dbmills_dir String db_mills File dbsnp_dir String dbsnp File germline_resource File germline_resource_tbi String hg File annovar_database File? regions Int? interval_padding File? tnseq_pon File? tnscope_pon String vep_path File cache String species String vcf2maf_path String disk_size String cluster_config Boolean haplotyper Boolean pindel Boolean tnseq Boolean tnscope Boolean varscan Boolean annovar Boolean vep Boolean only_pass if (input_fastq) { if (tumor_fastq_1!= "") { call mapping.mapping as tumor_mapping { input: group=sample_id + '.T', sample=sample_id + '.T', fastq_1=tumor_fastq_1, fastq_2=tumor_fastq_2, SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, pl=pl, fasta=fasta, ref_dir=ref_dir, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call Metrics.Metrics as tumor_Metrics { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, sorted_bam=tumor_mapping.sorted_bam, sorted_bam_index=tumor_mapping.sorted_bam_index, sample=sample_id + '.T', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call Dedup.Dedup as tumor_Dedup { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sorted_bam=tumor_mapping.sorted_bam, sorted_bam_index=tumor_mapping.sorted_bam_index, sample=sample_id + '.T', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call deduped_Metrics.deduped_Metrics as tumor_deduped_Metrics { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, deduped_bam=tumor_Dedup.deduped_bam, deduped_bam_index=tumor_Dedup.deduped_bam_index, sample=sample_id + '.T', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call BQSR.BQSR as tumor_BQSR { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, deduped_bam=tumor_Dedup.deduped_bam, deduped_bam_index=tumor_Dedup.deduped_bam_index, db_mills=db_mills, dbmills_dir=dbmills_dir, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, sample=sample_id + '.T', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } } if (normal_fastq_1!= "") { call mapping.mapping as normal_mapping { input: group=sample_id + '.N', sample=sample_id + '.N', fastq_1=normal_fastq_1, fastq_2=normal_fastq_2, SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, pl=pl, fasta=fasta, ref_dir=ref_dir, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call Metrics.Metrics as normal_Metrics { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, sorted_bam=normal_mapping.sorted_bam, sorted_bam_index=normal_mapping.sorted_bam_index, sample=sample_id + '.N', regions=regions, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call Dedup.Dedup as normal_Dedup { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sorted_bam=normal_mapping.sorted_bam, sorted_bam_index=normal_mapping.sorted_bam_index, sample=sample_id + '.N', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call deduped_Metrics.deduped_Metrics as normal_deduped_Metrics { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, deduped_bam=normal_Dedup.deduped_bam, deduped_bam_index=normal_Dedup.deduped_bam_index, sample=sample_id + '.N', regions=regions, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } call BQSR.BQSR as normal_BQSR { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, deduped_bam=normal_Dedup.deduped_bam, deduped_bam_index=normal_Dedup.deduped_bam_index, db_mills=db_mills, dbmills_dir=dbmills_dir, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, sample=sample_id + '.N', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } } if (haplotyper) { call Haplotyper.Haplotyper as Haplotyper { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.N', fasta=fasta, ref_dir=ref_dir, recaled_bam=normal_BQSR.recaled_bam, recaled_bam_index=normal_BQSR.recaled_bam_index, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, regions=regions, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } } if (pindel) { call pindel.pindel as pindel { input: sample_id=sample_id + '.N', bam=normal_BQSR.recaled_bam, bam_index=normal_BQSR.recaled_bam_index, fasta=fasta, ref_dir=ref_dir, docker=pindel_docker, disk_size=disk_size, cluster_config=cluster_config } } if (tnseq) { call TNseq.TNseq as TNseq { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id, normal_recaled_bam=normal_BQSR.recaled_bam, normal_recaled_bam_index=normal_BQSR.recaled_bam_index, tumor_recaled_bam=tumor_BQSR.recaled_bam, tumor_recaled_bam_index=tumor_BQSR.recaled_bam_index, normal_name=sample_id + ".N", tumor_name=sample_id + ".T", fasta=fasta, ref_dir=ref_dir, regions=regions, interval_padding=interval_padding, germline_resource=germline_resource, germline_resource_tbi=germline_resource_tbi, pon_vcf=tnseq_pon, docker=sentieon_docker, cluster_config=cluster_config, disk_size=disk_size } if (annovar) { call ANNOVAR.ANNOVAR as TNseq_annovar { input: vcf=TNseq.TNseq_filter_vcf, hg=hg, only_pass=only_pass, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_config, disk_size=disk_size } } if (vep) { call VEP.VEP as TNseq_VEP { input: vcf=TNseq.TNseq_filter_vcf, hg=hg, only_pass=only_pass, sample_id=sample_id, tumor_id=sample_id + ".T", normal_id=sample_id + ".N", ref_dir=ref_dir, fasta=fasta, vep_path=vep_path, cache=cache, species=species, vcf2maf_path=vcf2maf_path, docker=vep_docker, cluster_config=cluster_config, disk_size=disk_size } } } if (tnscope) { call TNscope.TNscope as TNscope { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id, normal_recaled_bam=normal_BQSR.recaled_bam, normal_recaled_bam_index=normal_BQSR.recaled_bam_index, tumor_recaled_bam=tumor_BQSR.recaled_bam, tumor_recaled_bam_index=tumor_BQSR.recaled_bam_index, normal_name=sample_id + ".N", tumor_name=sample_id + ".T", fasta=fasta, ref_dir=ref_dir, regions=regions, interval_padding=interval_padding, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, pon_vcf=tnscope_pon, docker=sentieon_docker, cluster_config=cluster_config, disk_size=disk_size } if (annovar) { call ANNOVAR.ANNOVAR as TNscope_annovar { input: vcf=TNscope.TNscope_vcf, hg=hg, only_pass=only_pass, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_config, disk_size=disk_size } } if (vep) { call VEP.VEP as TNscope_VEP { input: vcf=TNscope.TNscope_vcf, hg=hg, only_pass=only_pass, sample_id=sample_id, tumor_id=sample_id + ".T", normal_id=sample_id + ".N", ref_dir=ref_dir, fasta=fasta, vep_path=vep_path, cache=cache, species=species, vcf2maf_path=vcf2maf_path, docker=vep_docker, cluster_config=cluster_config, disk_size=disk_size } } } if (varscan) { call somatic.somatic as somatic { input: sample=sample_id, normal_bam=normal_BQSR.recaled_bam, normal_bam_index=normal_BQSR.recaled_bam_index, tumor_bam=tumor_BQSR.recaled_bam, tumor_bam_index=tumor_BQSR.recaled_bam_index, ref_dir=ref_dir, fasta=fasta, docker=varscan_docker, disk_size=disk_size, cluster_config=cluster_config } call processSomatic.processSomatic as processSomatic { input: sample=sample_id, varscan_snp=somatic.varscan_snp, varscan_indel=somatic.varscan_indel, docker=varscan_docker, disk_size=disk_size, cluster_config=cluster_config } call somaticFilter.somaticFilter as somaticFilter { input: sample=sample_id, varscan_snp_somatic_hc=processSomatic.varscan_snp_somatic_hc, varscan_snp_germline_hc=processSomatic.varscan_snp_germline_hc, varscan_snp_loh_hc=processSomatic.varscan_snp_loh_hc, varscan_indel_somatic_hc=processSomatic.varscan_indel_somatic_hc, varscan_indel_germline_hc=processSomatic.varscan_indel_germline_hc, varscan_indel_loh_hc=processSomatic.varscan_indel_loh_hc, varscan_indel=somatic.varscan_indel, docker=varscan_docker, disk_size=disk_size, cluster_config=cluster_config } if (annovar) { call ANNOVAR.ANNOVAR as VarScan_annovar { input: vcf=somaticFilter.varscan_somatic_filter, hg=hg, only_pass=only_pass, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_config, disk_size=disk_size } } if (vep) { call VEP.VEP as VarScan_VEP { input: vcf=somaticFilter.varscan_somatic_filter, hg=hg, only_pass=only_pass, sample_id=sample_id, tumor_id=sample_id + ".T", normal_id=sample_id + ".N", ref_dir=ref_dir, fasta=fasta, vep_path=vep_path, cache=cache, species=species, vcf2maf_path=vcf2maf_path, docker=vep_docker, cluster_config=cluster_config, disk_size=disk_size } } } } if (input_bam) { if (tumor_deduped_bam != "") { call replaceRG.replaceRG as tumor_replaceRG { input: bam=tumor_deduped_bam, group=group_id + '.T', sample=sample_id + '.T', pl=pl, docker=samtools_docker, disk_size=disk_size, cluster_config=cluster_config } call BQSR.BQSR as tumor_BQSR_fb { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, deduped_bam=tumor_replaceRG.deduped_bam, deduped_bam_index=tumor_replaceRG.deduped_bam_index, db_mills=db_mills, dbmills_dir=dbmills_dir, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, sample=sample_id + '.T', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } } if (normal_deduped_bam != "") { call replaceRG.replaceRG as normal_replaceRG { input: bam=normal_deduped_bam, group=group_id + '.N', sample=sample_id + '.N', pl=pl, docker=samtools_docker, disk_size=disk_size, cluster_config=cluster_config } call BQSR.BQSR as normal_BQSR_fb { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, fasta=fasta, ref_dir=ref_dir, deduped_bam=normal_replaceRG.deduped_bam, deduped_bam_index=normal_replaceRG.deduped_bam_index, db_mills=db_mills, dbmills_dir=dbmills_dir, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, sample=sample_id + '.N', docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } } if (haplotyper) { call Haplotyper.Haplotyper as Haplotyper_fb { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.N', fasta=fasta, ref_dir=ref_dir, recaled_bam=normal_BQSR_fb.recaled_bam, recaled_bam_index=normal_BQSR_fb.recaled_bam_index, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, regions=regions, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_config } } if (pindel) { call pindel.pindel as pindel_fb { input: sample_id=sample_id + '.N', bam=normal_BQSR_fb.recaled_bam, bam_index=normal_BQSR_fb.recaled_bam_index, fasta=fasta, ref_dir=ref_dir, docker=pindel_docker, disk_size=disk_size, cluster_config=cluster_config } } if (tnseq) { call TNseq.TNseq as TNseq_fb { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id, normal_recaled_bam=normal_BQSR_fb.recaled_bam, normal_recaled_bam_index=normal_BQSR_fb.recaled_bam_index, tumor_recaled_bam=tumor_BQSR_fb.recaled_bam, tumor_recaled_bam_index=tumor_BQSR_fb.recaled_bam_index, normal_name=sample_id + ".N", tumor_name=sample_id + ".T", fasta=fasta, ref_dir=ref_dir, regions=regions, interval_padding=interval_padding, germline_resource=germline_resource, germline_resource_tbi=germline_resource_tbi, pon_vcf=tnseq_pon, docker=sentieon_docker, cluster_config=cluster_config, disk_size=disk_size } if (annovar) { call ANNOVAR.ANNOVAR as TNseq_annovar_fb { input: vcf=TNseq_fb.TNseq_filter_vcf, hg=hg, only_pass=only_pass, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_config, disk_size=disk_size } } if (vep) { call VEP.VEP as TNseq_VEP_fb { input: vcf=TNseq_fb.TNseq_filter_vcf, hg=hg, only_pass=only_pass, sample_id=sample_id, tumor_id=sample_id + ".T", normal_id=sample_id + ".N", ref_dir=ref_dir, fasta=fasta, vep_path=vep_path, cache=cache, species=species, vcf2maf_path=vcf2maf_path, docker=vep_docker, cluster_config=cluster_config, disk_size=disk_size } } } if (tnscope) { call TNscope.TNscope as TNscope_fb { input: SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR, SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id, normal_recaled_bam=normal_BQSR_fb.recaled_bam, normal_recaled_bam_index=normal_BQSR_fb.recaled_bam_index, tumor_recaled_bam=tumor_BQSR_fb.recaled_bam, tumor_recaled_bam_index=tumor_BQSR_fb.recaled_bam_index, normal_name=sample_id + ".N", tumor_name=sample_id + ".T", fasta=fasta, ref_dir=ref_dir, regions=regions, interval_padding=interval_padding, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, pon_vcf=tnscope_pon, docker=sentieon_docker, cluster_config=cluster_config, disk_size=disk_size } if (annovar) { call ANNOVAR.ANNOVAR as TNscope_annovar_fb { input: vcf=TNscope_fb.TNscope_vcf, hg=hg, only_pass=only_pass, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_config, disk_size=disk_size } } if (vep) { call VEP.VEP as TNscope_VEP_fb { input: vcf=TNscope_fb.TNscope_vcf, hg=hg, only_pass=only_pass, sample_id=sample_id, tumor_id=sample_id + ".T", normal_id=sample_id + ".N", ref_dir=ref_dir, fasta=fasta, vep_path=vep_path, cache=cache, species=species, vcf2maf_path=vcf2maf_path, docker=vep_docker, cluster_config=cluster_config, disk_size=disk_size } } } if (varscan) { call somatic.somatic as somatic_fb { input: sample=sample_id, normal_bam=normal_BQSR_fb.recaled_bam, normal_bam_index=normal_BQSR_fb.recaled_bam_index, tumor_bam=tumor_BQSR_fb.recaled_bam, tumor_bam_index=tumor_BQSR_fb.recaled_bam_index, ref_dir=ref_dir, fasta=fasta, docker=varscan_docker, disk_size=disk_size, cluster_config=cluster_config } call processSomatic.processSomatic as processSomatic_fb { input: sample=sample_id, varscan_snp=somatic_fb.varscan_snp, varscan_indel=somatic_fb.varscan_indel, docker=varscan_docker, disk_size=disk_size, cluster_config=cluster_config } call somaticFilter.somaticFilter as somaticFilter_fb { input: sample=sample_id, varscan_snp_somatic_hc=processSomatic_fb.varscan_snp_somatic_hc, varscan_snp_germline_hc=processSomatic_fb.varscan_snp_germline_hc, varscan_snp_loh_hc=processSomatic_fb.varscan_snp_loh_hc, varscan_indel_somatic_hc=processSomatic_fb.varscan_indel_somatic_hc, varscan_indel_germline_hc=processSomatic_fb.varscan_indel_germline_hc, varscan_indel_loh_hc=processSomatic_fb.varscan_indel_loh_hc, varscan_indel=somatic_fb.varscan_indel, docker=varscan_docker, disk_size=disk_size, cluster_config=cluster_config } if (annovar) { call ANNOVAR.ANNOVAR as VarScan_annovar_fb { input: vcf=somaticFilter_fb.varscan_somatic_filter, hg=hg, only_pass=only_pass, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_config, disk_size=disk_size } } if (vep) { call VEP.VEP as VarScan_VEP_fb { input: vcf=somaticFilter_fb.varscan_somatic_filter, hg=hg, only_pass=only_pass, sample_id=sample_id, tumor_id=sample_id + ".T", normal_id=sample_id + ".N", ref_dir=ref_dir, fasta=fasta, vep_path=vep_path, cache=cache, species=species, vcf2maf_path=vcf2maf_path, docker=vep_docker, cluster_config=cluster_config, disk_size=disk_size } } } } }