version 1.0 import "../../../tasks/wdl/Utilities.wdl" as utils workflow PeakCalling { meta { allowNestedInputs: true } input { File annotations_gtf File metrics_h5ad File chrom_sizes String output_base_name # SnapATAC2 parameters Int min_counts = 5000 Int min_tsse = 10 Int max_counts = 100000 Float probability_threshold = 0.5 # Runtime attributes/docker Int disk_size = 500 Int mem_size = 64 Int nthreads = 4 String cloud_provider } String pipeline_version = "1.0.1" # Determine docker prefix based on cloud provider String gcr_docker_prefix = "us.gcr.io/broad-gotc-prod/" String acr_docker_prefix = "dsppipelinedev.azurecr.io/" String docker_prefix = if cloud_provider == "gcp" then gcr_docker_prefix else acr_docker_prefix # Docker image names String snap_atac_docker = "snapatac2:2.0.0" # Make sure either 'gcp' or 'azure' is supplied as cloud_provider input. If not, raise an error if ((cloud_provider != "gcp") && (cloud_provider != "azure")) { call utils.ErrorWithMessage as ErrorMessageIncorrectInput { input: message = "cloud_provider must be supplied with either 'gcp' or 'azure'." } } call PeakCalling { input: annotations_gtf = annotations_gtf, metrics_h5ad = metrics_h5ad, chrom_sizes = chrom_sizes, output_base_name = output_base_name, docker_path = docker_prefix + snap_atac_docker } output { File cellbybin_h5ad = PeakCalling.cellbybin_h5ad File cellbypeak_h5ad = PeakCalling.cellbypeak_h5ad String pipeline_version_out = pipeline_version } } # peak calling using SnapATAC2 task PeakCalling { input { File annotations_gtf File metrics_h5ad File chrom_sizes String output_base_name # SnapATAC2 parameters Int min_counts = 5000 Int min_tsse = 10 Int max_counts = 100000 Float probability_threshold = 0.5 # Runtime attributes/docker String docker_path Int disk_size = 500 Int mem_size = 64 Int nthreads = 4 } parameter_meta { annotations_gtf: "GTF for SnapATAC2 to calculate TSS sites of fragment file." disk_size: "Disk size used in create fragment file step." mem_size: "The size of memory used in create fragment file." docker_path: "The docker image path containing the runtime environment for this task" } command <<< set -euo pipefail set -x python3 <>> runtime { docker: docker_path disks: "local-disk ${disk_size} SSD" memory: "${mem_size} GiB" cpu: nthreads } output { File cellbybin_h5ad = "~{output_base_name}.cellbybin.h5ad" File cellbypeak_h5ad = "~{output_base_name}.cellbypeak.h5ad" } }