4
4
import pathlib
5
5
import click
6
6
7
- import bio2zarr as bz
8
7
9
- # tmp, come up with better names and flatten hierarchy
10
8
from bio2zarr import vcf
11
9
12
10
15
13
@click .option ("-p" , "--worker-processes" , type = int , default = 1 )
16
14
@click .option ("-f" , "--force" , is_flag = True , default = False )
17
15
def cli (vcfs , worker_processes , force ):
18
-
19
16
data_path = pathlib .Path ("validation-data" )
20
17
if len (vcfs ) == 0 :
21
18
vcfs = list (data_path .glob ("*.vcf.gz" )) + list (data_path .glob ("*.bcf" ))
@@ -27,23 +24,23 @@ def cli(vcfs, worker_processes, force):
27
24
print (f )
28
25
exploded = tmp_path / (f .name + ".exploded" )
29
26
if force or not exploded .exists ():
30
- bz . explode_vcf (
27
+ vcf . explode (
31
28
[f ],
32
29
exploded ,
33
30
worker_processes = worker_processes ,
34
31
show_progress = True ,
35
32
)
36
- spec = tmp_path / (f .name + ".spec " )
33
+ spec = tmp_path / (f .name + ".schema " )
37
34
if force or not spec .exists ():
38
35
with open (spec , "w" ) as specfile :
39
- vcf .generate_spec (exploded , specfile )
36
+ vcf .mkschema (exploded , specfile )
40
37
41
38
zarr = tmp_path / (f .name + ".zarr" )
42
39
if force or not zarr .exists ():
43
- vcf .to_zarr (
40
+ vcf .encode (
44
41
exploded ,
45
42
zarr ,
46
- conversion_spec = spec ,
43
+ spec ,
47
44
worker_processes = worker_processes ,
48
45
show_progress = True ,
49
46
)
0 commit comments