Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bio2zarr/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,14 +1068,16 @@ def iter_alleles_and_genotypes(self, start, stop, shape, num_alleles):
for variant_length, alleles in zip(
variant_lengths, self.iter_alleles(start, stop, num_alleles)
):
yield vcz.VariantData(variant_length, alleles, None, None)
# Stored ICF values are always at least 1D arrays; "rlen" is Number=1
# so we must extract the scalar to avoid NumPy scalar-conversion issues.
yield vcz.VariantData(variant_length[0], alleles, None, None)
else:
for variant_length, alleles, (gt, phased) in zip(
variant_lengths,
self.iter_alleles(start, stop, num_alleles),
self.iter_genotypes(shape, start, stop),
):
yield vcz.VariantData(variant_length, alleles, gt, phased)
yield vcz.VariantData(variant_length[0], alleles, gt, phased)

def generate_schema(
self, variants_chunk_size=None, samples_chunk_size=None, local_alleles=None
Expand Down
5 changes: 3 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ B2Z_VERSION:=$(shell PYTHONPATH=${PYPATH} \
CASTS=_static/vcf2zarr_convert.cast\
_static/vcf2zarr_explode.cast

ASCIINEMA_ARGS=-c "env PS1=\\$$\\ bash --noprofile --norc"

BUILDDIR = _build

Expand Down Expand Up @@ -36,15 +37,15 @@ sample.vcf.gz:

_static/vcf2zarr_convert.cast: sample.vcf.gz
rm -fR sample.vcz
asciinema-automation -d cast_scripts/vcf2zarr_convert.sh $@
asciinema-automation -aa '$(ASCIINEMA_ARGS)' -d cast_scripts/vcf2zarr_convert.sh $@
cat _static/vcf2zarr_convert.log
asciinema play _static/vcf2zarr_convert.cast
cp -R sample.vcz vcf2zarr

# TODO rename this cast
_static/vcf2zarr_explode.cast: sample.vcf.gz
rm -Rf sample.icf sample.vcz
asciinema-automation -d cast_scripts/vcf2zarr_explode.sh $@
asciinema-automation -aa '$(ASCIINEMA_ARGS)' -d cast_scripts/vcf2zarr_explode.sh $@
cat _static/vcf2zarr_explode.log
asciinema play _static/vcf2zarr_explode.cast
cp -R sample.icf sample.vcz vcf2zarr
4 changes: 2 additions & 2 deletions docs/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#/bin/bash
#!/usr/bin/env bash

# Jupyter-build doesn't have an option to automatically show the
# saved reports, which makes it difficult to debug the reasons for
# build failures in CI. This is a simple wrapper to handle that.

REPORTDIR=_build/html/reports

jupyter-book build -Wn --keep-going .
jupyter-book build -W -n --keep-going .
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
if [ -e $REPORTDIR ]; then
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asciinema-automation
bash_kernel
jupyter-book
jupyter-book<2
sphinx-click
2 changes: 1 addition & 1 deletion docs/vcf2zarr/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ of these arrays is then stored hierarchically within
these directories:

```{code-cell}
tree sample.vcz
find sample.vcz -maxdepth 2 -type d | sort
```

You can get a better idea of what's being stored and the sizes
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ dev = [
"pytest-xdist",
"sgkit>=0.8.0",
"tqdm",
"tskit>=0.6.4",
"tskit>=0.6.4,<1",
"bed_reader",
"cyvcf2"
]
tskit = ["tskit>=0.6.4"]
tskit = ["tskit>=0.6.4,<1"]
vcf = ["cyvcf2"]
all = [
"tskit>=0.6.4",
"tskit>=0.6.4,<1",
"cyvcf2"
]

Expand Down
Loading