modified: diffout.py
[GalaxyCodeBases.git] / etc / gatk-wdl / fm2 / fm2.wdl
blobde49e5f3cbd114d670607746914aaf7b542c8216
1 version 1.0
3 import "tasks/sample.wdl" as sampleWf
4 import "tasks/common.wdl" as common
5 import "tasks/structs.wdl" as structs
7 workflow fm2 {
8         input {
9                 File sampleConfigFile
10                 String outputDir = "."
11                 String platform = "illumina"
12                 Boolean useBwaKit = false
13                 Int scatterSizeMillions = 1000
14                 Int? minBWAmatchLen = 200
15                 BwaIndex bwaIndex
16                 GatkIndex GatkIndex
17                 String? adapterForward = "AAGTCGGAGGCCAAGCGGTCTTAGGAAGACAA"  # Illumina universal adapter.
18                 String? adapterReverse = "AAGTCGGATCGTAGCCATGTCGTTC"  # Illumina universal adapter.
19                 Int? scatterSize
20                 Int bwaThreads = 4
21                 File dockerImagesFile
22         }
24         # Parse docker Tags configuration and sample sheet.
25         call common.YamlToJson as convertDockerImagesFile {
26                 input:
27                         yaml = dockerImagesFile,
28                         outputJson = "dockerImages.json"
29         }
31         Map[String, String] dockerImages = read_json(convertDockerImagesFile.json)
32         #Array[Array[File]] inputSamples = read_tsv(SampleFqTSV)
33         SampleConfig sampleConfig = read_json(sampleConfigFile)
35         scatter (sample in sampleConfig.samples) {
36                 String sampleIds = sample.id
37                 String sampleDir = outputDir + "/samples/" + sample.id + "/"
38                 call sampleWf.SampleWorkflow as sampleWorkflow {
39                         input:
40                                 sampleDir = sampleDir,
41                                 sample = sample,
42                                 bwaThreads = bwaThreads,
43                                 bwaIndex = bwaIndex,
44                                 #bwaMem2Index = bwaMem2Index,
45                                 GatkIndex = GatkIndex,
46                                 adapterForward = adapterForward,
47                                 adapterReverse = adapterReverse,
48                                 useBwaKit = useBwaKit,
49                                 dockerImages = dockerImages,
50                                 #scatters = scatterList.scatters,
51                                 bwaThreads = bwaThreads,
52                                 platform = platform,
53                                 minBWAmatchLen = minBWAmatchLen
54                                 #sampleName = sample.id,
55                                 #gender = select_first([sample.gender, "unknown"]),
56                 }
57         }
59         Array[File] allReports = flatten([
60                 flatten(sampleWorkflow.reports)
61                 #, flatten(singleSampleCalling.reports)
62         ])
63         
64         output {
65                 File dockerImagesList = convertDockerImagesFile.json
66                 #File multiqcReport = multiqcTask.multiqcReport
67                 Array[File] reports = allReports
68                 #Array[File] recalibratedBams = sampleWorkflow.recalibratedBam
69                 #Array[File] recalibratedBamIndexes = sampleWorkflow.recalibratedBamIndex
70                 Array[File] markdupBams = sampleWorkflow.markdupBam
71                 Array[File] markdupBamIndexes = sampleWorkflow.markdupBamIndex
72                 Array[File] filteredBam = sampleWorkflow.filteredBam
73                 Array[File] filteredBamIndex = sampleWorkflow.filteredBamIndex
74                 Array[File] outSNP0txts = sampleWorkflow.outSNP0txt
75                 Array[File] outSTR0txts = sampleWorkflow.outSTR0txt
76                 Array[File] outSNP1txts = sampleWorkflow.outSNP1txt
77                 Array[File] outSNPtxts = sampleWorkflow.outSNPtxt
78                 Array[File] outSTRtxts = sampleWorkflow.outSTRtxt
79                 Array[File] outbcfFiles = sampleWorkflow.outbcfFile
80                 Array[File] outsnpFiles = sampleWorkflow.outsnpFile
81                 Array[File] outsnpIndexFiles = sampleWorkflow.outsnpIndexFile
82                 Array[File] outsnp0Files = sampleWorkflow.outsnp0File
83                 Array[File] outsnp0IndexFiles = sampleWorkflow.outsnp0IndexFile
84                 #Array[File?] mantaVCFs = svCalling.mantaVcf
85                 #Array[File?] dellyVCFs = svCalling.dellyVcf
86                 #Array[File?] survivorVCFs = svCalling.survivorVcf
87                 #Array[Array[File]?] modifiedVcfs = svCalling.modifiedVcfs
88         }
90         parameter_meta {
91                 # inputs
92                 sampleConfigFile: {description: "The samplesheet, including sample ids, library ids, readgroup ids and fastq file locations.", category: "required"}
93                 outputDir: {description: "The directory the output should be written to.", category: "common"}
94                 platform: {description: "The platform used for sequencing.", category: "advanced"}
95                 useBwaKit: {description: "Whether or not BWA kit should be used. If false BWA mem will be used.", category: "advanced"}
96                 scatterSizeMillions:{description: "Same as scatterSize, but is multiplied by 1000000 to get scatterSize. This allows for setting larger values more easily.", category: "advanced"}
97                 bwaIndex: {description: "The BWA index files. When these are provided BWA will be used.", category: "common"}
98                 adapterForward: {description: "The adapter to be removed from the reads first or single end reads.", category: "common"}
99                 adapterReverse: {description: "The adapter to be removed from the reads second end reads.", category: "common"}
100                 scatterSize: {description: "The size of the scattered regions in bases for the GATK subworkflows. Scattering is used to speed up certain processes. The genome will be seperated into multiple chunks (scatters) which will be processed in their own job, allowing for parallel processing. Higher values will result in a lower number of jobs. The optimal value here will depend on the available resources.", category: "advanced"}
101                 bwaThreads: {description: "The amount of threads for the alignment process.", category: "advanced"}
102                 dockerImagesFile: {description: "A YAML file describing the docker image used for the tasks. The dockerImages.yml provided with the pipeline is recommended.", category: "advanced"}
104                 # outputs
105                 dockerImagesList: {description: "Json file describing the docker images used by the pipeline."}
106                 reports: {description: ""}
107                 recalibratedBams: {description: ""}
108                 recalibratedBamIndexes: {description: ""}
109                 markdupBams: {description: ""}
110                 markdupBamIndexes: {description: ""}
111         }