Readers for IDAT v3, BPM (locus entries v4-v8), CSV manifest, EGT (data blocks 5-9) and GTC v3-v5 (plus a layout-preserving GTC writer); sample-sheet validation (IN-001..IN-014), IDAT discovery and pairing (IN-020..IN-022), message catalogue and exit codes (CLI-014/016), JSON Lines logging (CLI-007/008), atomic writes (CLI-011), run manifest, and `simurg inspect`. Validation (docs/validation/P1.md): GTC, BPM and EGT readers agree exactly with Illumina BeadArrayFiles on GSA v4 / GDA v1 files; GTCs round-trip byte-identically; BPM and CSV manifests are consistent.
46 lines
1.8 KiB
Python
46 lines
1.8 KiB
Python
"""Shared test configuration.
|
|
|
|
Tests marked ``data`` need files fetched by ``scripts/fetch_data.sh p0``; tests marked ``oracle`` need
|
|
reference repositories under ``refs/`` (``scripts/bootstrap_refs.sh``). Both are skipped when absent.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
DATA = ROOT / "data" / "p0"
|
|
REFS = ROOT / "refs"
|
|
|
|
GSA = DATA / "gsa_v4_pgx"
|
|
GSA_BPM = GSA / "GSA-PGx-48v4-0_20079540_E2_bpm" / "GSA-PGx-48v4-0_20079540_E2.bpm"
|
|
GSA_CSV = GSA / "GSA-PGx-48v4-0_20079540_E2_csv" / "GSA-PGx-48v4-0_20079540_E2.csv"
|
|
GSA_EGT = GSA / "GSA-PGx-48v4-0_20079540_E2_ClusterFile" / "GSA-PGx-48v4-0_20079540_E2_ClusterFile.egt"
|
|
GSA_IDATS = GSA / "idats_Demo_36" / "idats_Demo_36"
|
|
GDA_EGT = DATA / "gda_v1" / "infinium-global-diversity-array-8-v1-0-D1-cluster-file" / "GDA-8v1-0_D1_ClusterFile.egt"
|
|
GDA_BPM = DATA / "gda_v1" / "infinium-global-diversity-array-8-v1-0-D1-manifest-file-bpm" / "GDA-8v1-0_D1.bpm"
|
|
GDA_SHEET = DATA / "gda_v1" / "infinium-global-diversity-array-8-v1-0_D1_SampleSheet_Demo_36.csv"
|
|
BIOC_IDATS = DATA / "bioc" / "IlluminaDataTestFiles_1.50.0" / "IlluminaDataTestFiles" / "inst" / "extdata" / "idat"
|
|
ORACLE_GTCS = DATA / "oracle" / "gsa_gtc_gtc2vcf"
|
|
|
|
|
|
def need(*paths: Path) -> None:
|
|
missing = [p for p in paths if not p.exists()]
|
|
if missing:
|
|
pytest.skip(f"missing test data: {missing[0]} (run scripts/fetch_data.sh p0)")
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def beadarrayfiles(): # type: ignore[no-untyped-def]
|
|
"""Illumina BeadArrayFiles (BSD-2) as an oracle."""
|
|
path = REFS / "BeadArrayFiles"
|
|
if not (path / "module").is_dir():
|
|
pytest.skip("refs/BeadArrayFiles not present (run scripts/bootstrap_refs.sh)")
|
|
sys.path.insert(0, str(path))
|
|
import module # type: ignore[import-not-found]
|
|
|
|
return module
|