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 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 annovar_docker String manta_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? regions Int? interval_padding String disk_size String cluster_config 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_config } call Metrics.Metrics as tumor_Metrics { input: 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_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_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_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_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_config } call Metrics.Metrics as normal_Metrics { input: 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_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_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_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 } call Haplotyper.Haplotyper as Haplotyper { input: 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 } call bcftools.bcftools as Haplotyper_bcftools { input: vcf=Haplotyper.vcf, fasta=fasta, ref_dir=ref_dir, docker=bcftools_docker, cluster_config=cluster_config, disk_size=disk_size } } call Manta.Manta as Manta { input: sample=sample_id, fasta=fasta, ref_dir=ref_dir, regions=regions, 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, docker=manta_docker, cluster_config=cluster_config, disk_size=disk_size } call AnnotSV.AnnotSV as Manta_AnnotSV { input: sample=sample_id, somatic_vcf=Manta.somatic_vcf, germline_vcf=Manta.germline_vcf, annotsv_database=annotsv_database, docker=annotsv_docker, cluster_config=cluster_config, disk_size=disk_size } 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, regions=regions, interval_padding=interval_padding, germline_resource=germline_resource, germline_resource_tbi=germline_resource_tbi, docker=sentieon_docker, cluster_config=cluster_config, 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_config, 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_config, disk_size=disk_size } call MSIsensor.MSIsensor as MSIsensor { input: sample=sample_id, fasta=fasta, ref_dir=ref_dir, 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, baseline=baseline, docker=msisensor_docker, cluster_config=cluster_config, disk_size=disk_size } call HRD.HRD as HRD { input: sample=sample_id, fasta=fasta, ref_dir=ref_dir, gc=gc, 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, docker=sequenza_docker, cluster_config=cluster_config, disk_size=disk_size } call TMB.TMB as TMB { input: sample=sample_id, regions=regions, snpindel_txt=TNseq_ANNOVAR.multianno_txt, docker=tmb_docker, cluster_config=cluster_config, disk_size=disk_size } call CNVkit.CNVkit as CNVkit { input: sample=sample_id, fasta=fasta, ref_dir=ref_dir, regions=regions, ref_flat=ref_flat, 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, hrd=HRD.hrd, docker=cnvkit_docker, cluster_config=cluster_config, disk_size=disk_size } }