sgkit-dev / bio2zarr

Convert bioinformatics file formats to Zarr
Apache License 2.0
20 stars 5 forks source link

Inconsistent input/output argument order #219

Open hyanwong opened 1 month ago

hyanwong commented 1 month ago

Using the (undocumented) python API:

vcf2zarr.convert(input_vcfs, output_zarr)
vcf2zarr.explode(output_icf, input_vcfs)  # this has output path as first param, input as second?
vcf2zarr.encode(input_icf, output_zarr)

I think vcf2zarr.explode should probably reverse the order of the first 2 params? I guess since it's undocumented, it's possible to make changes like this without breaking the API at this stage?

jeromekelleher commented 1 month ago

Yes, well spotted. I've been debating with myself on what should be done here. It's not quite so obvious when you look at explode_init, explode_partition etc, where it makes sense for the "self" reference to be the first argument.

See #102 for a related problem that I've been dithering about

jeromekelleher commented 1 month ago

I wouldn't write any code using the Python API by the way, it will definitely change in breaking ways before being documented.

hyanwong commented 1 month ago

I wouldn't write any code using the Python API by the way, it will definitely change in breaking ways before being documented.

Thanks. I gathered that it's undocumented, so I'm expecting changes. The context is that I'm very roughly drafting some examples for teaching in a few months, so I'm happy to change any code as/when it is documented.

jeromekelleher commented 1 month ago

Would it not be easier to use the CLI? Bash cells in Jupyter notebooks work well.

hyanwong commented 1 month ago

Ah yes, probably sensible in this case. I'm not sure how they work in jupyterbook or pyodide formats, but that might not be needed in this case.

jeromekelleher commented 1 month ago

Doubt cyvcf2 will work in pyodide anyway.