Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tests/e2e/align-read-count-gate-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/ancient-similarity-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "^<svg .*>${SAMPLE}</text>" "$(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 '<h2>Ancient Populations</h2>.*data:image/svg\+xml;base64,' "$(tr -d '\n' < "${CASE_TMP}/report.html")"
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/chip-clonal-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\)</h2>' "$(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 ----------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/traits-panel-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/y-private-report-1-private-and-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/y-str-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down