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/bcftools.wdl" as bcftools import "./tasks/ANNOVAR.wdl" as ANNOVAR import "./tasks/Manta.wdl" as Manta import "./tasks/AnnotSV.wdl" as AnnotSV import "./tasks/CNVkit.wdl" as CNVkit import "./tasks/MSIsensor.wdl" as MSIsensor import "./tasks/HRD.wdl" as HRD import "./tasks/TMB.wdl" as TMB import "./tasks/fastqc.wdl" as fastqc import "./tasks/fastqscreen.wdl" as fastqscreen import "./tasks/qualimap.wdl" as qualimap import "./tasks/TNscope.wdl" as TNscope import "./tasks/somatic.wdl" as somatic import "./tasks/processSomatic.wdl" as processSomatic import "./tasks/somaticFilter.wdl" as somaticFilter workflow {{ project_name }} { String sample_id File? tumor_fastq_1 File? tumor_fastq_2 File? normal_fastq_1 File? normal_fastq_2 String? duplex_umi String? read_structure String SENTIEON_LICENSE String sentieon_docker String manta_docker String bcftools_docker String annovar_docker String annotsv_docker String cnvkit_docker String sequenza_docker String msisensor_docker String tmb_docker String platform File ref_dir String fasta File dbmills_dir String db_mills File dbsnp_dir String dbsnp File germline_resource File germline_resource_tbi File annovar_database File annotsv_database File gc File baseline File ref_flat File? regions Int? interval_padding String disk_size String cluster_2cpu_4gb String cluster_16cpu_32gb Boolean qc String fastqc_docker String fastqscreen_docker String qualimap_docker File screen_ref_dir File fastq_screen_conf Boolean multi_caller String varscan_docker 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_LICENSE=SENTIEON_LICENSE, duplex_umi=duplex_umi, read_structure=read_structure, platform=platform, fasta=fasta, ref_dir=ref_dir, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call Metrics.Metrics as tumor_Metrics { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.T', fasta=fasta, ref_dir=ref_dir, sorted_bam=tumor_mapping.sorted_bam, sorted_bam_index=tumor_mapping.sorted_bam_index, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call Dedup.Dedup as tumor_Dedup { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.T', sorted_bam=tumor_mapping.sorted_bam, sorted_bam_index=tumor_mapping.sorted_bam_index, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call deduped_Metrics.deduped_Metrics as tumor_deduped_Metrics { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.T', fasta=fasta, ref_dir=ref_dir, deduped_bam=tumor_Dedup.deduped_bam, deduped_bam_index=tumor_Dedup.deduped_bam_index, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call BQSR.BQSR as tumor_BQSR { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.T', 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, regions=regions, interval_padding=interval_padding, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } if (qc){ call fastqc.fastqc as tumor_fastqc { input: sample=sample_id + '.T', read1=tumor_fastq_1, read2=tumor_fastq_2, docker=fastqc_docker, disk_size=disk_size, cluster_config=cluster_2cpu_4gb } call fastqscreen.fastq_screen as tumor_fastqscreen { input: sample=sample_id + '.T', read1=tumor_fastq_1, read2=tumor_fastq_2, screen_ref_dir=screen_ref_dir, fastq_screen_conf=fastq_screen_conf, docker=fastqscreen_docker, disk_size=disk_size, cluster_config=cluster_2cpu_4gb } call qualimap.qualimap as tumor_qualimap { input: sample=sample_id + '.T', bam=tumor_Dedup.deduped_bam, bai=tumor_Dedup.deduped_bam_index, covered_bed=regions, docker=qualimap_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } } } 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_LICENSE=SENTIEON_LICENSE, duplex_umi=duplex_umi, read_structure=read_structure, platform=platform, fasta=fasta, ref_dir=ref_dir, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call Metrics.Metrics as normal_Metrics { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.N', fasta=fasta, ref_dir=ref_dir, sorted_bam=normal_mapping.sorted_bam, sorted_bam_index=normal_mapping.sorted_bam_index, regions=regions, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call Dedup.Dedup as normal_Dedup { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.N', sorted_bam=normal_mapping.sorted_bam, sorted_bam_index=normal_mapping.sorted_bam_index, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call deduped_Metrics.deduped_Metrics as normal_deduped_Metrics { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.N', fasta=fasta, ref_dir=ref_dir, deduped_bam=normal_Dedup.deduped_bam, deduped_bam_index=normal_Dedup.deduped_bam_index, regions=regions, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } call BQSR.BQSR as normal_BQSR { input: SENTIEON_LICENSE=SENTIEON_LICENSE, sample=sample_id + '.N', 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, regions=regions, interval_padding=interval_padding, docker=sentieon_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } if (qc){ call fastqc.fastqc as normal_fastqc { input: sample=sample_id + '.N', read1=normal_fastq_1, read2=normal_fastq_2, docker=fastqc_docker, disk_size=disk_size, cluster_config=cluster_2cpu_4gb } call fastqscreen.fastq_screen as normal_fastqscreen { input: sample=sample_id + '.N', read1=normal_fastq_1, read2=normal_fastq_2, screen_ref_dir=screen_ref_dir, fastq_screen_conf=fastq_screen_conf, docker=fastqscreen_docker, disk_size=disk_size, cluster_config=cluster_2cpu_4gb } call qualimap.qualimap as normal_qualimap { input: sample=sample_id + '.N', bam=normal_Dedup.deduped_bam, bai=normal_Dedup.deduped_bam_index, covered_bed=regions, docker=qualimap_docker, disk_size=disk_size, cluster_config=cluster_16cpu_32gb } } } call TNseq.TNseq as TNseq { input: SENTIEON_LICENSE=SENTIEON_LICENSE, 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, normal_name=sample_id + ".N", tumor_name=sample_id + ".T", fasta=fasta, ref_dir=ref_dir, dbsnp=dbsnp, dbsnp_dir=dbsnp_dir, regions=regions, interval_padding=interval_padding, germline_resource=germline_resource, germline_resource_tbi=germline_resource_tbi, docker=sentieon_docker, cluster_config=cluster_16cpu_32gb, disk_size=disk_size } call bcftools.bcftools as TNseq_bcftools { input: vcf=TNseq.vcf, fasta=fasta, ref_dir=ref_dir, docker=bcftools_docker, cluster_config=cluster_2cpu_4gb, disk_size=disk_size } call ANNOVAR.ANNOVAR as TNseq_ANNOVAR { input: vcf=TNseq_bcftools.norm_vcf, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_16cpu_32gb, disk_size=disk_size } if (multi_caller){ 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_16cpu_32gb } 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_16cpu_32gb } 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_16cpu_32gb } call bcftools.bcftools as VarScan_bcftools { input: vcf=somaticFilter.varscan_somatic_filter, fasta=fasta, ref_dir=ref_dir, docker=bcftools_docker, cluster_config=cluster_2cpu_4gb, disk_size=disk_size } call ANNOVAR.ANNOVAR as VarScan_ANNOVAR { input: vcf=VarScan_bcftools.norm_vcf, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_16cpu_32gb, disk_size=disk_size } call TNscope.TNscope as TNscope { input: 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, docker=sentieon_docker, cluster_config=cluster_16cpu_32gb, disk_size=disk_size } call bcftools.bcftools as TNscope_bcftools { input: vcf=TNscope.TNscope_vcf, fasta=fasta, ref_dir=ref_dir, docker=bcftools_docker, cluster_config=cluster_2cpu_4gb, disk_size=disk_size } call ANNOVAR.ANNOVAR as TNscope_ANNOVAR { input: vcf=TNscope_bcftools.norm_vcf, annovar_database=annovar_database, docker=annovar_docker, cluster_config=cluster_16cpu_32gb, disk_size=disk_size } } }