test: packaged CN data files

This commit is contained in:
kemal committed 2026-09-29 07:07:03 +01:00
1 parent efe781fbe0
commit b20da743c6
1 file changed
+9
+9
View File
@@ -219,3 +219,12 @@ def test_cn_annotate_end_to_end(tmp_path: Path) -> None: # CYTO-032 / CYTO-033
assert {c["id"] for c in doc["chromosomes"]} == {"1", "2"} assert {c["id"] for c in doc["chromosomes"]} == {"1", "2"}
normal = json.loads((out / "200000000001_R02C01.cyto.json").read_text()) normal = json.loads((out / "200000000001_R02C01.cyto.json").read_text())
assert normal["iscn_microarray"] in ("arr[GRCh38](1-22,X)x2", "arr[GRCh37](1-22,X)x2") or normal["events"] assert normal["iscn_microarray"] in ("arr[GRCh38](1-22,X)x2", "arr[GRCh37](1-22,X)x2") or normal["events"]
def test_packaged_cn_data() -> None: # the built-in mask and cytobands ship with the package (CYTO-017, CYTO-035)
from simurg.pipeline.cn import _builtin_file, read_mask
for build in ("GRCh37", "GRCh38"):
m = read_mask(None, build)
assert len(m) >= 24 and all(s <= e for iv in m.values() for s, e in iv)
assert gzip.decompress(_builtin_file(f"cytoBand_{build}.txt.gz")).startswith(b"chr1\t0\t")