-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharguments.py
More file actions
211 lines (150 loc) · 6.84 KB
/
Copy patharguments.py
File metadata and controls
211 lines (150 loc) · 6.84 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
import sys
from pathlib import Path
import argparse
here = Path(__file__).parent.absolute()
def dendritic_spine_example(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "dendritic-spine-example").as_posix())
import dendritic_spine_args
dendritic_spine_args.add_run_dendritic_spine_arguments(parser)
def preprocess_spine_mesh(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "dendritic-spine-example").as_posix())
import dendritic_spine_args
dendritic_spine_args.add_preprocess_spine_mesh_arguments(parser)
def postprocess_spine_mesh(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "dendritic-spine-example").as_posix())
import dendritic_spine_args
dendritic_spine_args.add_dendritic_spine_postprocess_arguments(parser)
def cru_example(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "cru-example").as_posix())
import cru_args
cru_args.add_run_cru_arguments(parser)
def preprocess_cru_mesh(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "cru-example").as_posix())
import cru_args
cru_args.add_preprocess_cru_mesh_arguments(parser)
def mechanotransduction_example(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "mechanotransduction-example").as_posix())
import mech_parser_args
mech_parser_args.add_mechanotransduction_arguments(parser)
def mechanotransduction_postprocess(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "mechanotransduction-example").as_posix())
import mech_parser_args
mech_parser_args.add_mechanotransduction_postprocess_arguments(parser)
def preprocess_mech_mesh(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "mechanotransduction-example").as_posix())
import mech_parser_args
mech_parser_args.add_preprocess_mech_mesh_arguments(parser)
def mito_example(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "mito-example").as_posix())
import mito_parser_args
mito_parser_args.add_run_mito_arguments(parser)
def preprocess_mito_mesh(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "mito-example").as_posix())
import mito_parser_args
mito_parser_args.add_preprocess_mito_mesh_arguments(parser)
def phosphorylation_example(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "phosphorylation-example").as_posix())
import phosphorylation_parser_args
phosphorylation_parser_args.add_phosphorylation_arguments(parser)
def phosphorylation_preprocess(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "phosphorylation-example").as_posix())
import phosphorylation_parser_args
phosphorylation_parser_args.add_phosphorylation_preprocess_arguments(parser)
def postprocess_phosphorylation(parser: argparse.ArgumentParser):
sys.path.insert(0, (here / ".." / "phosphorylation-example").as_posix())
import phosphorylation_parser_args
phosphorylation_parser_args.add_phosphorylation_postprocess(parser)
def setup_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
# Root parser
parser.add_argument(
"-n",
"--ntasks",
default=1,
type=int,
help="Number of cores to use for each program",
)
parser.add_argument(
"--dry-run",
action="store_true",
help="Just print the command and do not run it",
)
cg = parser.add_argument_group("cluster", "Options relevant for clusters")
cg.add_argument(
"-p",
"--partition",
default="defq",
type=str,
help="Which partition to use on the cluster",
)
cluster = cg.add_mutually_exclusive_group()
cluster.add_argument(
"--submit-ex3",
action="store_true",
help="Add this flag if you want to submit the job on the ex3 cluster",
)
cluster.add_argument(
"--submit-tscc",
action="store_true",
help="Add this flag if you want to submit the job on the hopper cluster at TSCC",
)
subparsers = parser.add_subparsers(dest="command")
# Convert notebooks
subparsers.add_parser("convert-notebooks", help="Convert notebooks to python files")
# Dendritic spine
preprocess_spine_mesh_parser = subparsers.add_parser(
"dendritic-spine-preprocess", help="Preprocess mesh for dendritic spine example"
)
preprocess_spine_mesh(preprocess_spine_mesh_parser)
dendritic_spine_parser = subparsers.add_parser(
"dendritic-spine", help="Run dendritic spine example"
)
dendritic_spine_example(dendritic_spine_parser)
postprocess_spine_mesh_parser = subparsers.add_parser(
"dendritic-spine-postprocess", help="postprocess mesh for dendritic spine example"
)
postprocess_spine_mesh(postprocess_spine_mesh_parser)
# CRU (calcium release unit)
preprocess_cru_mesh_parser = subparsers.add_parser(
"cru-preprocess", help="Preprocess mesh for CRU example"
)
preprocess_cru_mesh(preprocess_cru_mesh_parser)
cru_parser = subparsers.add_parser(
"cru", help="Run CRU example"
)
cru_example(cru_parser)
# Mechanotransduction example
preprocess_spine_mesh_parser = subparsers.add_parser(
"mechanotransduction-preprocess", help="Preprocess mesh for mechanotransduction example"
)
preprocess_mech_mesh(preprocess_spine_mesh_parser)
mechanotransduction_parser = subparsers.add_parser(
"mechanotransduction", help="Run mechanotransduction example"
)
mechanotransduction_example(mechanotransduction_parser)
mechanotransduction_postprocess_parser = subparsers.add_parser(
"mechanotransduction-postprocess", help="Postprocess mechanotransduction example"
)
mechanotransduction_postprocess(mechanotransduction_postprocess_parser)
# Mito example
preprocess_mito_mesh_parser = subparsers.add_parser(
"mito-preprocess", help="Preprocess mesh for mito example"
)
preprocess_mito_mesh(preprocess_mito_mesh_parser)
mito_parser = subparsers.add_parser("mito", help="Run mito example")
mito_example(mito_parser)
# Phosphorylation example
phosphorylation_preprocess_parser = subparsers.add_parser(
"phosphorylation-preprocess",
help="Preprocess mesh for phosphorylation example",
)
phosphorylation_preprocess(phosphorylation_preprocess_parser)
phosphorylation_parser = subparsers.add_parser(
"phosphorylation", help="Run phosphorylation example"
)
phosphorylation_example(phosphorylation_parser)
postprocess_phosphorylation_parser = subparsers.add_parser(
"phosphorylation-postprocess", help="Postprocess phosphorylation example"
)
postprocess_phosphorylation(postprocess_phosphorylation_parser)
return parser