Skip to content

Commit d941091

Browse files
Fixup documentation and add some info logging
1 parent a173af7 commit d941091

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

bio2zarr/tskit.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ def __init__(
2828
else:
2929
# input 'ts' is a path.
3030
self._path = ts
31+
logger.info(f"Loading from {ts}")
3132
self.ts = tskit.load(ts)
33+
logger.info(
34+
f"Input has {self.ts.num_individuals} individuals and "
35+
f"{self.ts.num_sites} sites"
36+
)
3237

3338
self.contig_id = contig_id if contig_id is not None else "1"
3439
self.isolated_as_missing = isolated_as_missing
@@ -42,6 +47,7 @@ def __init__(
4247
sample_ids = model_mapping.individuals_name
4348

4449
self._num_samples = individuals_nodes.shape[0]
50+
logger.info(f"Converting for {self._num_samples} samples")
4551
if self._num_samples < 1:
4652
raise ValueError("individuals_nodes must have at least one sample")
4753
self.max_ploidy = individuals_nodes.shape[1]
@@ -100,6 +106,7 @@ def iter_field(self, field_name, shape, start, stop):
100106
def iter_alleles_and_genotypes(self, start, stop, shape, num_alleles):
101107
# All genotypes in tskit are considered phased
102108
phased = np.ones(shape[:-1], dtype=bool)
109+
logger.debug(f"Getting genotpes start={start} stop={stop}")
103110

104111
for variant in self.ts.variants(
105112
isolated_as_missing=self.isolated_as_missing,

docs/tskit2zarr/python_api.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ This will convert the [tskit](https://tskit.dev) tree sequence stored
1212
at ``ts_path`` to VCF Zarr stored at ``vcz_path`` using 8 worker processes.
1313
The details of how we map from the
1414
tskit {ref}`tskit:sec_data_model` to VCF Zarr are taken care of by
15-
TreeSequence.map_to_vcf_model method, which is called with no
15+
{meth}`tskit.TreeSequence.map_to_vcf_model`
16+
method, which is called with no
1617
parameters by default if the ``model_mapping`` parameter to
1718
{func}`~bio2zarr.tskit.convert` is not specified.
1819

1920
For more control over the properties of the output, for example
2021
to pick a specific subset of individuals, you can use
21-
TreeSequence.map_to_vcf_model
22+
{meth}`~tskit.TreeSequence.map_to_vcf_model`
2223
to return the required mapping:
2324

2425
```python

0 commit comments

Comments
 (0)