Skip to content

Commit

Permalink
Debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
hyanwong committed Jul 26, 2024
1 parent 5a1e58e commit 91e9ee1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,11 @@ Python to simulate some data under the coalescent with recombination, using
import builtins
import sys
from Bio import bgzf
import os
import subprocess
import numpy as np
from Bio import bgzf
import numpy as np
import msprime
import tsinfer
Expand Down Expand Up @@ -238,10 +239,9 @@ vcf_name = f"{name}.vcf.gz"
with bgzf.open(vcf_name, "wt") as f:
ts.write_vcf(f)
subprocess.run(["tabix", vcf_name])
ret = subprocess.run(
"python -m bio2zarr vcf2zarr convert --force".split() + [vcf_name, f"{name}.vcz"],
stderr = subprocess.DEVNULL if name == "notebook-simulation" else None
)
!python -m bio2zarr vcf2zarr convert --force {vcf_name} {name}.vcz
assert os.path.exists(f"{name}.vcz")
if ret.returncode == 0:
print(f"Converted to {name}.vcz")
```
Expand Down Expand Up @@ -308,6 +308,7 @@ In practice this means we can keep such files lying around without taking up too
Once we have our `.vcz` file created, running the inference is straightforward.

```{code-cell} ipython3
import os
# Infer & save a ts from the notebook simulation.
ancestral_alleles = np.load(f"{name}-AA.npy")
vdata = tsinfer.VariantData(f"{name}.vcz", ancestral_alleles)
Expand Down

0 comments on commit 91e9ee1

Please sign in to comment.