@@ -18,6 +18,12 @@ def list_commands(self, ctx):
18
18
19
19
20
20
# Common arguments/options
21
+ vcfs = click .argument (
22
+ "vcfs" , nargs = - 1 , required = True , type = click .Path (exists = True , dir_okay = False )
23
+ )
24
+
25
+ icf_path = click .argument ("icf_path" , type = click .Path ())
26
+
21
27
verbose = click .option ("-v" , "--verbose" , count = True , help = "Increase verbosity" )
22
28
23
29
version = click .version_option (version = f"{ provenance .__version__ } " )
@@ -65,7 +71,7 @@ def setup_logging(verbosity):
65
71
66
72
67
73
@click .command
68
- @click . argument ( " vcfs" , nargs = - 1 , required = True )
74
+ @vcfs
69
75
@click .argument ("zarr_path" , type = click .Path ())
70
76
@verbose
71
77
@worker_processes
@@ -85,8 +91,8 @@ def explode(vcfs, zarr_path, verbose, worker_processes, column_chunk_size):
85
91
86
92
87
93
@click .command
88
- @click . argument ( " vcfs" , nargs = - 1 , required = True )
89
- @click . argument ( " icf_path" , type = click . Path ())
94
+ @vcfs
95
+ @icf_path
90
96
@click .argument ("num_partitions" , type = int )
91
97
@column_chunk_size
92
98
@verbose
@@ -95,7 +101,7 @@ def dexplode_init(
95
101
vcfs , icf_path , num_partitions , column_chunk_size , verbose , worker_processes
96
102
):
97
103
"""
98
- Initial step for parallel conversion of VCF(s) to intermediate columnar format
104
+ Initial step for distributed conversion of VCF(s) to intermediate columnar format
99
105
over the requested number of paritions.
100
106
"""
101
107
setup_logging (verbose )
@@ -111,12 +117,12 @@ def dexplode_init(
111
117
112
118
113
119
@click .command
114
- @click . argument ( " icf_path" , type = click . Path ())
120
+ @icf_path
115
121
@click .argument ("partition" , type = int )
116
122
@verbose
117
123
def dexplode_partition (icf_path , partition , verbose ):
118
124
"""
119
- Convert a VCF partition into intermediate columnar format. Must be called *after*
125
+ Convert a VCF partition to intermediate columnar format. Must be called *after*
120
126
the ICF path has been initialised with dexplode_init. Partition indexes must be
121
127
from 0 (inclusive) to the number of paritions returned by dexplode_init (exclusive).
122
128
"""
@@ -129,26 +135,26 @@ def dexplode_partition(icf_path, partition, verbose):
129
135
@verbose
130
136
def dexplode_finalise (path , verbose ):
131
137
"""
132
- Final step for parallel conversion of VCF(s) to intermediate columnar format
138
+ Final step for distributed conversion of VCF(s) to intermediate columnar format.
133
139
"""
134
140
setup_logging (verbose )
135
141
vcf .explode_finalise (path )
136
142
137
143
138
144
@click .command
139
- @click .argument ("icf_path " , type = click .Path ())
145
+ @click .argument ("path " , type = click .Path ())
140
146
@verbose
141
- def inspect (icf_path , verbose ):
147
+ def inspect (path , verbose ):
142
148
"""
143
- Inspect an intermediate format or Zarr path.
149
+ Inspect an intermediate columnar format or Zarr path.
144
150
"""
145
151
setup_logging (verbose )
146
- data = vcf .inspect (icf_path )
152
+ data = vcf .inspect (path )
147
153
click .echo (tabulate .tabulate (data , headers = "keys" ))
148
154
149
155
150
156
@click .command
151
- @click . argument ( " icf_path" , type = click . Path ())
157
+ @icf_path
152
158
def mkschema (icf_path ):
153
159
"""
154
160
Generate a schema for zarr encoding
@@ -158,7 +164,7 @@ def mkschema(icf_path):
158
164
159
165
160
166
@click .command
161
- @click . argument ( " icf_path" , type = click . Path ())
167
+ @icf_path
162
168
@click .argument ("zarr_path" , type = click .Path ())
163
169
@verbose
164
170
@click .option ("-s" , "--schema" , default = None , type = click .Path (exists = True ))
@@ -212,7 +218,7 @@ def encode(
212
218
213
219
214
220
@click .command (name = "convert" )
215
- @click . argument ( " vcfs" , nargs = - 1 , required = True )
221
+ @vcfs
216
222
@click .argument ("zarr_path" , type = click .Path ())
217
223
@variants_chunk_size
218
224
@samples_chunk_size
@@ -235,17 +241,6 @@ def convert_vcf(
235
241
)
236
242
237
243
238
- @click .command
239
- @click .argument ("vcfs" , nargs = - 1 , required = True )
240
- @click .argument ("zarr_path" , type = click .Path ())
241
- def validate (vcfs , zarr_path ):
242
- """
243
- Development only, do not use. Will be removed before release.
244
- """
245
- # FIXME! Will silently not look at remaining VCFs
246
- vcf .validate (vcfs [0 ], zarr_path , show_progress = True )
247
-
248
-
249
244
@version
250
245
@click .group (cls = NaturalOrderGroup )
251
246
def vcf2zarr ():
@@ -309,7 +304,6 @@ def vcf2zarr():
309
304
vcf2zarr .add_command (dexplode_init )
310
305
vcf2zarr .add_command (dexplode_partition )
311
306
vcf2zarr .add_command (dexplode_finalise )
312
- vcf2zarr .add_command (validate )
313
307
314
308
315
309
@click .command (name = "convert" )
0 commit comments