@@ -18,6 +18,12 @@ def list_commands(self, ctx):
1818
1919
2020# 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+
2127verbose = click .option ("-v" , "--verbose" , count = True , help = "Increase verbosity" )
2228
2329version = click .version_option (version = f"{ provenance .__version__ } " )
@@ -65,7 +71,7 @@ def setup_logging(verbosity):
6571
6672
6773@click .command
68- @click . argument ( " vcfs" , nargs = - 1 , required = True )
74+ @vcfs
6975@click .argument ("zarr_path" , type = click .Path ())
7076@verbose
7177@worker_processes
@@ -85,8 +91,8 @@ def explode(vcfs, zarr_path, verbose, worker_processes, column_chunk_size):
8591
8692
8793@click .command
88- @click . argument ( " vcfs" , nargs = - 1 , required = True )
89- @click . argument ( " icf_path" , type = click . Path ())
94+ @vcfs
95+ @icf_path
9096@click .argument ("num_partitions" , type = int )
9197@column_chunk_size
9298@verbose
@@ -95,7 +101,7 @@ def dexplode_init(
95101 vcfs , icf_path , num_partitions , column_chunk_size , verbose , worker_processes
96102):
97103 """
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
99105 over the requested number of paritions.
100106 """
101107 setup_logging (verbose )
@@ -111,12 +117,12 @@ def dexplode_init(
111117
112118
113119@click .command
114- @click . argument ( " icf_path" , type = click . Path ())
120+ @icf_path
115121@click .argument ("partition" , type = int )
116122@verbose
117123def dexplode_partition (icf_path , partition , verbose ):
118124 """
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*
120126 the ICF path has been initialised with dexplode_init. Partition indexes must be
121127 from 0 (inclusive) to the number of paritions returned by dexplode_init (exclusive).
122128 """
@@ -129,26 +135,26 @@ def dexplode_partition(icf_path, partition, verbose):
129135@verbose
130136def dexplode_finalise (path , verbose ):
131137 """
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.
133139 """
134140 setup_logging (verbose )
135141 vcf .explode_finalise (path )
136142
137143
138144@click .command
139- @click .argument ("icf_path " , type = click .Path ())
145+ @click .argument ("path " , type = click .Path ())
140146@verbose
141- def inspect (icf_path , verbose ):
147+ def inspect (path , verbose ):
142148 """
143- Inspect an intermediate format or Zarr path.
149+ Inspect an intermediate columnar format or Zarr path.
144150 """
145151 setup_logging (verbose )
146- data = vcf .inspect (icf_path )
152+ data = vcf .inspect (path )
147153 click .echo (tabulate .tabulate (data , headers = "keys" ))
148154
149155
150156@click .command
151- @click . argument ( " icf_path" , type = click . Path ())
157+ @icf_path
152158def mkschema (icf_path ):
153159 """
154160 Generate a schema for zarr encoding
@@ -158,7 +164,7 @@ def mkschema(icf_path):
158164
159165
160166@click .command
161- @click . argument ( " icf_path" , type = click . Path ())
167+ @icf_path
162168@click .argument ("zarr_path" , type = click .Path ())
163169@verbose
164170@click .option ("-s" , "--schema" , default = None , type = click .Path (exists = True ))
@@ -212,7 +218,7 @@ def encode(
212218
213219
214220@click .command (name = "convert" )
215- @click . argument ( " vcfs" , nargs = - 1 , required = True )
221+ @vcfs
216222@click .argument ("zarr_path" , type = click .Path ())
217223@variants_chunk_size
218224@samples_chunk_size
@@ -235,17 +241,6 @@ def convert_vcf(
235241 )
236242
237243
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-
249244@version
250245@click .group (cls = NaturalOrderGroup )
251246def vcf2zarr ():
@@ -309,7 +304,6 @@ def vcf2zarr():
309304vcf2zarr .add_command (dexplode_init )
310305vcf2zarr .add_command (dexplode_partition )
311306vcf2zarr .add_command (dexplode_finalise )
312- vcf2zarr .add_command (validate )
313307
314308
315309@click .command (name = "convert" )
0 commit comments