From de6202e15068042d3074f18dc92831b660dab480 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Sun, 22 Nov 2026 04:26:27 +0100 Subject: [PATCH] test(e2e): render reports with og in the last e2e cases that still call the Python renderer Six cases still ran bin/render_report.py by file to check the text and HTML reports. They now run og report render with the same arguments and the same assertions, so they keep working once the Python renderer is removed. The two renders of one summary in align-read-count-gate-1 become one call with both -o names. Bead: port-e2e-render-callers --- tests/e2e/align-read-count-gate-1.sh | 5 ++--- tests/e2e/ancient-similarity-1.sh | 2 +- tests/e2e/chip-clonal-1.sh | 4 ++-- tests/e2e/traits-panel-1.sh | 4 ++-- tests/e2e/y-private-report-1-private-and-tree.sh | 2 +- tests/e2e/y-str-1.sh | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/e2e/align-read-count-gate-1.sh b/tests/e2e/align-read-count-gate-1.sh index 097ffab67..772504786 100755 --- a/tests/e2e/align-read-count-gate-1.sh +++ b/tests/e2e/align-read-count-gate-1.sh @@ -51,7 +51,7 @@ check_eq "input_reads equals fastp's total_reads" "$(val input_reads "$TT")" "$F check_eq "the BAM's primary records equal fastp's total_reads" "$(primary "${T}/aligned/${T}_sorted.bam")" "$FASTP" check_eq "read_count_check" "$(val read_count_check "$TT")" ok "${REPO}/bin/og" summary collect --sample "$T" --sample-dir "${G}/${T}" --assets "${REPO}/assets" --out "${CASE_TMP}/T.json" >/dev/null -python3 "${REPO}/bin/render_report.py" --summary "${CASE_TMP}/T.json" -o "${CASE_TMP}/T.txt" >/dev/null +"${REPO}/bin/og" report render --summary "${CASE_TMP}/T.json" -o "${CASE_TMP}/T.txt" >/dev/null check "the text report shows both counts" \ has "^ Alignment: ${FASTP} reads in, ${FASTP} primary records in the BAM\$" "$(cat "${CASE_TMP}/T.txt" 2>/dev/null)" @@ -142,8 +142,7 @@ check_eq "the published table: missing_reads" "$(val missing_reads "${R}/qc/${X} check_eq "the published BAM's primary records" "$(primary "${R}/aligned/${X}_sorted.bam")" 24000 check "the table is not published beside the BAM" test ! -e "${G}/${R}/aligned/${X}_read_count.tsv" "${REPO}/bin/og" summary collect --sample "$X" --sample-dir "${G}/${R}" --assets "${REPO}/assets" --out "${CASE_TMP}/X.json" >/dev/null -python3 "${REPO}/bin/render_report.py" --summary "${CASE_TMP}/X.json" -o "${CASE_TMP}/X.txt" >/dev/null -python3 "${REPO}/bin/render_report.py" --summary "${CASE_TMP}/X.json" -o "${CASE_TMP}/X.html" >/dev/null +"${REPO}/bin/og" report render --summary "${CASE_TMP}/X.json" -o "${CASE_TMP}/X.txt" -o "${CASE_TMP}/X.html" >/dev/null check "the text report flags the missing reads" \ has '^ Alignment: 32000 reads in, 24000 primary records in the BAM: 8000 reads missing .*READS LOST IN ALIGNMENT' \ "$(cat "${CASE_TMP}/X.txt" 2>/dev/null)" diff --git a/tests/e2e/ancient-similarity-1.sh b/tests/e2e/ancient-similarity-1.sh index 7118bd598..3003e69f8 100755 --- a/tests/e2e/ancient-similarity-1.sh +++ b/tests/e2e/ancient-similarity-1.sh @@ -91,7 +91,7 @@ check_eq "three ancient groups ranked" "$(awk 'NR > 1' "$TSV" 2>/dev/null | wc - SVG="${OUT}/${SAMPLE}_ancient_pca.svg" check "the plot is an SVG with the sample's label" has "^${SAMPLE}" "$(tr -d '\n' < "$SVG" 2>/dev/null)" check "the text carries the caveat" has 'not descent' "$(cat "${OUT}/${SAMPLE}_ancient.txt" 2>/dev/null)" -python3 "${REPO}/bin/render_report.py" --sample "$SAMPLE" --sample-dir "${G}/${SAMPLE}" --json "${CASE_TMP}/summary.json" \ +"${REPO}/bin/og" report render --assets "${REPO}/assets" --sample "$SAMPLE" --sample-dir "${G}/${SAMPLE}" --json "${CASE_TMP}/summary.json" \ -o "${CASE_TMP}/report.txt" -o "${CASE_TMP}/report.html" > /dev/null check "text report: the section with Planted_HG002 first" has '^ +1\. Planted_HG002 \(3050 BCE, Testland; 6 people\)' "$(cat "${CASE_TMP}/report.txt")" check "HTML report: the card and the plot" has '

Ancient Populations

.*data:image/svg\+xml;base64,' "$(tr -d '\n' < "${CASE_TMP}/report.html")" diff --git a/tests/e2e/chip-clonal-1.sh b/tests/e2e/chip-clonal-1.sh index e19580aef..006d99f8a 100755 --- a/tests/e2e/chip-clonal-1.sh +++ b/tests/e2e/chip-clonal-1.sh @@ -116,11 +116,11 @@ check_eq "and the germline-looking call is not counted" \ "$(awk -F'\t' '$13 == "chip" && $3 == p' p="$R882" "${G}/${H}/chip/${H}_chip.tsv" 2>/dev/null | wc -l | tr -d ' ')" 0 # --- the reports ---------------------------------------------------------------------- -python3 "${REPO}/bin/render_report.py" --sample "$P" --sample-dir "${G}/${P}" -o "${T}/P.txt" -o "${T}/P.html" >/dev/null +"${REPO}/bin/og" report render --assets "${REPO}/assets" --sample "$P" --sample-dir "${G}/${P}" -o "${T}/P.txt" -o "${T}/P.html" >/dev/null check "the text report has the CHIP section with R882H" has 'DNMT3A R882H: VAF 0\.[0-9]+' "$(cat "${T}/P.txt" 2>/dev/null)" check "and the detection limit" has 'Detection limit: a clone of VAF about [0-9]+% or more' "$(cat "${T}/P.txt" 2>/dev/null)" check "the HTML report has the CHIP card" has 'Clonal Haematopoiesis \(CHIP\)' "$(cat "${T}/P.html" 2>/dev/null)" -python3 "${REPO}/bin/render_report.py" --sample "$U" --sample-dir "${G}/${U}" -o "${T}/U.txt" >/dev/null +"${REPO}/bin/og" report render --assets "${REPO}/assets" --sample "$U" --sample-dir "${G}/${U}" -o "${T}/U.txt" >/dev/null check "control: the unplanted report says no CHIP call" has 'No CHIP call\.' "$(cat "${T}/U.txt" 2>/dev/null)" # --- Nextflow against the bash step ---------------------------------------------------- diff --git a/tests/e2e/traits-panel-1.sh b/tests/e2e/traits-panel-1.sh index 028860b07..ce1bbbb35 100644 --- a/tests/e2e/traits-panel-1.sh +++ b/tests/e2e/traits-panel-1.sh @@ -15,7 +15,7 @@ # homozygous gives that row the table's hom_alt reading, not HG002's; # - the call floor: the same planted call at GQ 5, and at GQ 40 with FILTER # LowQual, reads low_gq ("not read"), and every other row is as in HG002; -# - both reports (bin/render_report.py on the sample folder) carry the +# - both reports (og report render on the sample folder) carry the # section, the HTML one with the APOE lines folded away; # - nextflow run main.nf --tools traits,html_report on the same VCF and # gVCF publishes the same two files as the bash step, byte for byte, and @@ -171,7 +171,7 @@ done in_genome "$BCFTOOLS_IMAGE" rm -rf "$P2" # --- both reports --------------------------------------------------------------------- -python3 "${REPO}/bin/render_report.py" --sample "$SAMPLE" --sample-dir "${G}/${SAMPLE}" --json "${CASE_TMP}/summary.json" \ +"${REPO}/bin/og" report render --assets "${REPO}/assets" --sample "$SAMPLE" --sample-dir "${G}/${SAMPLE}" --json "${CASE_TMP}/summary.json" \ -o "${CASE_TMP}/report.txt" -o "${CASE_TMP}/report.html" > /dev/null TXT=$(cat "${CASE_TMP}/report.txt" 2>/dev/null) HTML=$(cat "${CASE_TMP}/report.html" 2>/dev/null) ONE=$(awk -F'\t' '$7 == "called" { print $1; exit }' "$OUT") diff --git a/tests/e2e/y-private-report-1-private-and-tree.sh b/tests/e2e/y-private-report-1-private-and-tree.sh index dcf009db9..a2b6dca94 100755 --- a/tests/e2e/y-private-report-1-private-and-tree.sh +++ b/tests/e2e/y-private-report-1-private-and-tree.sh @@ -181,7 +181,7 @@ if [ -s "$NF_TREE" ] && [ -s "${R}/${SAMPLE}_report.html" ]; then rm -rf "$CC"; mkdir -p "${CC}/${SAMPLE}" cp -R "${R}/y_haplogroup" "${CC}/${SAMPLE}/y_haplogroup" rm -f "${CC}/${SAMPLE}/y_haplogroup/${SAMPLE}_y_tree.txt" "${CC}/${SAMPLE}/y_haplogroup/${SAMPLE}_y_tree_path.tsv" - python3 "${REPO}/bin/render_report.py" --sample "$SAMPLE" --sample-dir "${CC}/${SAMPLE}" \ + "${REPO}/bin/og" report render --sample "$SAMPLE" --sample-dir "${CC}/${SAMPLE}" \ --assets "${REPO}/assets" --json "${CC}/${SAMPLE}/summary.json" -o "${CC}/${SAMPLE}/report.html" \ > "${CASE_TMP}/nf-control.log" 2>&1 || true tail -3 "${CASE_TMP}/nf-control.log" diff --git a/tests/e2e/y-str-1.sh b/tests/e2e/y-str-1.sh index e0f918174..8b6cd5fc2 100755 --- a/tests/e2e/y-str-1.sh +++ b/tests/e2e/y-str-1.sh @@ -188,7 +188,7 @@ step "$F" check "a table left from an earlier run is removed when the step skips" test ! -e "${G}/${F}/y_str/${F}_y_str.tsv" # --- both reports ------------------------------------------------------------------------- -python3 "${REPO}/bin/render_report.py" --sample "$H" --sample-dir "${G}/${H}" --json "${T}/summary.json" \ +"${REPO}/bin/og" report render --assets "${REPO}/assets" --sample "$H" --sample-dir "${G}/${H}" --json "${T}/summary.json" \ -o "${T}/report.txt" -o "${T}/report.html" > /dev/null TXT=$(cat "${T}/report.txt" 2>/dev/null) HTML=$(cat "${T}/report.html" 2>/dev/null) check "text report: the Y-STR section" has '^## Y-STR Markers \(HipSTR\)$' "$TXT"