f5c96c14557e69252db6935d20ea55bdd250e519 max Fri Sep 4 17:12:57 2026 -0700 DANIO-CODE as native danRer11 tracks, alpha only. Converts the DANIO-CODE consortium's public track hub for danRer11 into a native trackDb: 897 stanzas under one superTrack, with 11 containers for RNA-seq, CAGE-seq, ChIP-seq, 3P-seq, Hi-C, regulatory elements, cell types, COPEs/DOPEs, validated enhancers, conservation and consensus promoters. The 879 data files, 69 GB, are mirrored under /gbdb/danRer11/danioCode and are byte-identical to the consortium's copies. Four cell-type subtracks are left out because their files 404 on the consortium's server. refs #38265 diff --git src/hg/makeDb/scripts/danioCode/danioCodeDownload.sh src/hg/makeDb/scripts/danioCode/danioCodeDownload.sh new file mode 100755 index 00000000000..d2d63f86a7e --- /dev/null +++ src/hg/makeDb/scripts/danioCode/danioCodeDownload.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Mirror the DANIO-CODE data files listed in a URL file into an output directory. +# Resumes partial files, skips files that are already complete, and prints the +# URLs that failed so they can be retried. +# +# danioCodeDownload.sh <urlListFile> <outDir> [jobs] +# +# 2026-09-04, Claude + Max. +set -o pipefail +urlFile=$1 +outDir=$2 +jobs=${3:-10} +[ -z "$outDir" ] && { echo "usage: $0 <urlListFile> <outDir> [jobs]" >&2; exit 1; } +mkdir -p "$outDir" + +fetch() { + local url=$1 out=$2 + local f="$out/$(basename "$url")" + # remote size, so a complete file is not fetched again + local remote + remote=$(curl -sIL --max-time 60 "$url" \ + | awk 'BEGIN{IGNORECASE=1} /^content-length:/{n=$2} END{gsub(/\r/,"",n); print n+0}') + if [ -s "$f" ] && [ "$(stat -c %s "$f")" = "$remote" ]; then + return 0 + fi + curl -sSfL -C - --retry 3 --retry-delay 5 --max-time 7200 -o "$f" "$url" || { + echo "FAILED $url" >&2 + return 1 + } + local got=$(stat -c %s "$f" 2>/dev/null || echo 0) + if [ "$remote" -gt 0 ] && [ "$got" != "$remote" ]; then + echo "SHORT $url got=$got want=$remote" >&2 + return 1 + fi +} +export -f fetch + +parallel -j "$jobs" fetch {} "$outDir" :::: "$urlFile"