forked from broadinstitute/dockstore-tool-cms2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcms2_main_emp.wdl
122 lines (102 loc) · 5.3 KB
/
cms2_main_emp.wdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
version 1.0
import "./structs.wdl"
import "./run_sims_and_compute_cms2_components.wdl"
# * workflow cms2_main_emp
workflow cms2_main_emp {
meta {
description: "Fetch empirical data and compute CMS2 component scores"
email: "[email protected]"
}
parameter_meta {
# ** inputs
# *** Simulation params
# **** Specifying the demographic model and sweep scenarios
paramFile_demographic_model: "(File) cosi2 parameter file specifying the demographic model; this file describes the parts common to neutral and selection simulations."
paramFile_neutral: "(File) cosi2 parameter file portion used for neutral simulations only. *paramFile_demographic_model* is prepended to it to create the full parameter file for neutral simulations."
paramFiles_selection: "(Array[File]) cosi2 parameter file portions for selection simulations. For each file in this array, a set of selection simulations will be done. *paramFile_demographic_model* is prepended to this file to construct the full cosi2 parameter file."
# **** Identification information about the computational experiment
experimentId: "(String) An arbitrary string identifying this (computational) experiment. Change it to ensure that random seeds used for simulations are not reused."
experiment_description: "(String) Experiment description, for recording purposes"
modelId: "(String) A string identifying the demographic model; if not given, defaults to the base name of *paramFile_demographic_model*."
# **** Specifying how many simulations to create
nreps_neutral: "(Int) Run this many neutral simulations, for establishing normalization stats."
nreps: "(Int) Run this many selection simulations for each selection scenario in *paramFiles_selection*."
# **** Computational limits and resources for doing simulations
maxAttempts: "(Int) Max number of times to attempt to generate an allele frequency trajectory for a given random seed"
numRepsPerBlock: "(Int) Run this many simulations per block. A block of simulations is run in a single task."
numCpusPerBlock: "(Int) Allocate this many CPUs to each task running the simulations."
memoryPerBlock: "(String) Memory spec for each task running a block of simulation replicas."
repTimeoutSeconds: "(Int) Time out (and fail) a simulation replica for a given random seed after this many seconds."
# *** Component stats computation params
n_bins: "Number of frequency bins for normalizing iHS, nSL and delIHH component statistics."
# **** Computational limits and resources for component stats computation
}
# ** inputs
input {
#
# Simulation params
#
File paramFile_demographic_model
File paramFile_neutral
Array[File] paramFiles_selection
File recombFile
String experimentId = "default"
String experiment_description = "an experiment"
String modelId = "model_"+basename(paramFile_demographic_model, ".par")
Int nreps_neutral
Int nreps
Int maxAttempts = 10000000
Int numRepsPerBlock = 1
Int numCpusPerBlock = numRepsPerBlock
Int repTimeoutSeconds = 600
String memoryPerBlock = "3 GB"
Int hapset_block_size = 2
Int n_bins = 20
Map[String,Boolean] include_components = {"ihs": true, "ihh12": true, "nsl": true, "delihh": true, "xpehh": true, "fst": true, "delDAF": true, "derFreq": true}
ComputeResources compute_resources_for_compute_one_pop_cms2_components = object {
mem_gb: 4,
cpus: 1,
local_storage_gb: 50
}
ComputeResources compute_resources_for_compute_two_pop_cms2_components = object {
mem_gb: 4,
cpus: 1,
local_storage_gb: 50
}
}
call run_sims_and_compute_cms2_components.run_sims_and_compute_cms2_components_wf as main_call {
input:
paramFile_demographic_model=paramFile_demographic_model,
paramFile_neutral=paramFile_neutral,
paramFiles_selection=paramFiles_selection,
recombFile=recombFile,
nreps_neutral=nreps_neutral,
nreps=nreps,
n_bins_ihs=n_bins,
n_bins_nsl=n_bins,
n_bins_delihh=n_bins,
numRepsPerBlock=numRepsPerBlock,
numCpusPerBlock=numCpusPerBlock,
memoryPerBlock=memoryPerBlock,
include_components=include_components,
hapset_block_size=hapset_block_size,
compute_resources_for_compute_one_pop_cms2_components=compute_resources_for_compute_one_pop_cms2_components,
compute_resources_for_compute_two_pop_cms2_components=compute_resources_for_compute_two_pop_cms2_components
}
# ** Workflow outputs
output {
# *** Bookkeeping outputs
# File saved_input_files = main_call.saved_input_files
PopsInfo pops_info = main_call.pops_info
# *** Simulation outputs
#Array[File] neutral_sims_tar_gzs = main_call.neutral_sims_tar_gzs
#Array[File] selection_sims_tar_gzs = main_call.selection_sims_tar_gzs
#Array[ReplicaInfo] neutral_sims_replica_infos = flatten(run_neutral_sims.replicaInfos)
#Array[ReplicaInfo] selection_sims_replica_infos = flatten(run_selection_sims.replicaInfos)
#Int n_neutral_sims_succeeded = length(select_all(compute_cms2_components_for_neutral.ihs[0]))
# *** Component scores
#Array[File?] sel_normed_and_collated = main_call.sel_normed_and_collated
Array[File] all_hapsets_component_stats_h5_blocks = main_call.all_hapsets_component_stats_h5_blocks
#Array[CMS2_Components_Result?] sel_components_results = sel_components_result
}
}