17
17
)
18
18
19
19
20
- def _pipeline_prefix (
20
+ def pipeline_prefix (
21
21
root : str ,
22
22
reference_genome : ReferenceGenome ,
23
23
dataset_type : DatasetType ,
@@ -36,38 +36,15 @@ def _pipeline_prefix(
36
36
)
37
37
38
38
39
- def _v03_reference_data_prefix (
40
- access_control : AccessControl ,
41
- reference_genome : ReferenceGenome ,
42
- dataset_type : DatasetType ,
43
- ) -> str :
44
- root = (
45
- Env .PRIVATE_REFERENCE_DATASETS_DIR
46
- if access_control == AccessControl .PRIVATE
47
- else Env .REFERENCE_DATASETS_DIR
48
- )
49
- if FeatureFlag .INCLUDE_PIPELINE_VERSION_IN_PREFIX :
50
- return os .path .join (
51
- root ,
52
- PipelineVersion .V03 .value ,
53
- reference_genome .value ,
54
- dataset_type .value ,
55
- )
56
- return os .path .join (
57
- root ,
58
- reference_genome .value ,
59
- dataset_type .value ,
60
- )
61
-
62
-
63
39
def _v03_reference_dataset_prefix (
40
+ root : str ,
64
41
access_control : AccessControl ,
65
42
reference_genome : ReferenceGenome ,
66
43
) -> str :
67
44
root = (
68
45
Env .PRIVATE_REFERENCE_DATASETS_DIR
69
46
if access_control == AccessControl .PRIVATE
70
- else Env . REFERENCE_DATASETS_DIR
47
+ else root
71
48
)
72
49
if FeatureFlag .INCLUDE_PIPELINE_VERSION_IN_PREFIX :
73
50
return os .path .join (
@@ -88,7 +65,7 @@ def family_table_path(
88
65
family_guid : str ,
89
66
) -> str :
90
67
return os .path .join (
91
- _pipeline_prefix (
68
+ pipeline_prefix (
92
69
Env .HAIL_SEARCH_DATA_DIR ,
93
70
reference_genome ,
94
71
dataset_type ,
@@ -104,7 +81,7 @@ def tdr_metrics_dir(
104
81
dataset_type : DatasetType ,
105
82
) -> str :
106
83
return os .path .join (
107
- _pipeline_prefix (
84
+ pipeline_prefix (
108
85
Env .LOADING_DATASETS_DIR ,
109
86
reference_genome ,
110
87
dataset_type ,
@@ -130,7 +107,7 @@ def imported_callset_path(
130
107
callset_path : str ,
131
108
) -> str :
132
109
return os .path .join (
133
- _pipeline_prefix (
110
+ pipeline_prefix (
134
111
Env .LOADING_DATASETS_DIR ,
135
112
reference_genome ,
136
113
dataset_type ,
@@ -177,7 +154,7 @@ def project_table_path(
177
154
project_guid : str ,
178
155
) -> str :
179
156
return os .path .join (
180
- _pipeline_prefix (
157
+ pipeline_prefix (
181
158
Env .HAIL_SEARCH_DATA_DIR ,
182
159
reference_genome ,
183
160
dataset_type ,
@@ -194,7 +171,7 @@ def relatedness_check_table_path(
194
171
callset_path : str ,
195
172
) -> str :
196
173
return os .path .join (
197
- _pipeline_prefix (
174
+ pipeline_prefix (
198
175
Env .LOADING_DATASETS_DIR ,
199
176
reference_genome ,
200
177
dataset_type ,
@@ -210,7 +187,7 @@ def relatedness_check_tsv_path(
210
187
callset_path : str ,
211
188
) -> str :
212
189
return os .path .join (
213
- _pipeline_prefix (
190
+ pipeline_prefix (
214
191
Env .LOADING_DATASETS_DIR ,
215
192
reference_genome ,
216
193
dataset_type ,
@@ -227,7 +204,7 @@ def remapped_and_subsetted_callset_path(
227
204
project_guid : str ,
228
205
) -> str :
229
206
return os .path .join (
230
- _pipeline_prefix (
207
+ pipeline_prefix (
231
208
Env .LOADING_DATASETS_DIR ,
232
209
reference_genome ,
233
210
dataset_type ,
@@ -243,7 +220,7 @@ def lookup_table_path(
243
220
dataset_type : DatasetType ,
244
221
) -> str :
245
222
return os .path .join (
246
- _pipeline_prefix (
223
+ pipeline_prefix (
247
224
Env .HAIL_SEARCH_DATA_DIR ,
248
225
reference_genome ,
249
226
dataset_type ,
@@ -257,7 +234,7 @@ def runs_path(
257
234
dataset_type : DatasetType ,
258
235
) -> str :
259
236
return os .path .join (
260
- _pipeline_prefix (
237
+ pipeline_prefix (
261
238
Env .HAIL_SEARCH_DATA_DIR ,
262
239
reference_genome ,
263
240
dataset_type ,
@@ -272,7 +249,7 @@ def sex_check_table_path(
272
249
callset_path : str ,
273
250
) -> str :
274
251
return os .path .join (
275
- _pipeline_prefix (
252
+ pipeline_prefix (
276
253
Env .LOADING_DATASETS_DIR ,
277
254
reference_genome ,
278
255
dataset_type ,
@@ -306,6 +283,7 @@ def valid_reference_dataset_path(
306
283
) -> str | None :
307
284
return os .path .join (
308
285
_v03_reference_dataset_prefix (
286
+ Env .REFERENCE_DATASETS_DIR ,
309
287
reference_dataset .access_control ,
310
288
reference_genome ,
311
289
),
@@ -318,9 +296,13 @@ def valid_reference_dataset_query_path(
318
296
reference_genome : ReferenceGenome ,
319
297
dataset_type : DatasetType ,
320
298
reference_dataset_query : ReferenceDatasetQuery ,
299
+ root = None ,
321
300
) -> str | None :
301
+ if not root :
302
+ root = Env .REFERENCE_DATASETS_DIR
322
303
return os .path .join (
323
304
_v03_reference_dataset_prefix (
305
+ root ,
324
306
reference_dataset_query .access_control ,
325
307
reference_genome ,
326
308
),
@@ -334,7 +316,7 @@ def variant_annotations_table_path(
334
316
dataset_type : DatasetType ,
335
317
) -> str :
336
318
return os .path .join (
337
- _pipeline_prefix (
319
+ pipeline_prefix (
338
320
Env .HAIL_SEARCH_DATA_DIR ,
339
321
reference_genome ,
340
322
dataset_type ,
@@ -348,7 +330,7 @@ def variant_annotations_vcf_path(
348
330
dataset_type : DatasetType ,
349
331
) -> str :
350
332
return os .path .join (
351
- _pipeline_prefix (
333
+ pipeline_prefix (
352
334
Env .HAIL_SEARCH_DATA_DIR ,
353
335
reference_genome ,
354
336
dataset_type ,
@@ -386,7 +368,7 @@ def project_remap_path(
386
368
project_guid : str ,
387
369
) -> str :
388
370
return os .path .join (
389
- _pipeline_prefix (
371
+ pipeline_prefix (
390
372
Env .LOADING_DATASETS_DIR ,
391
373
reference_genome ,
392
374
dataset_type ,
@@ -404,7 +386,7 @@ def project_pedigree_path(
404
386
project_guid : str ,
405
387
) -> str :
406
388
return os .path .join (
407
- _pipeline_prefix (
389
+ pipeline_prefix (
408
390
Env .LOADING_DATASETS_DIR ,
409
391
reference_genome ,
410
392
dataset_type ,
0 commit comments