de23dd389f8e8e35c41880a85d74e9838a4df8e4
angie
  Thu Jun 18 15:11:49 2026 -0700
ssh to hgwdev for commands that need access to hgwdev-only directories, because these scripts run elsewhere now.  Tweak shell variables usherDir and friends to make it easier to try out different build directories.

diff --git src/hg/utils/otto/rsv/buildTree.sh src/hg/utils/otto/rsv/buildTree.sh
index ec5ff126f65..3ab050748b9 100755
--- src/hg/utils/otto/rsv/buildTree.sh
+++ src/hg/utils/otto/rsv/buildTree.sh
@@ -1,33 +1,33 @@
 #!/bin/bash
 source ~/.bashrc
 set -beEu -o pipefail
 
 # Align INSDC sequences to reference and build two trees, one for RSV-A and one for RSV-B.
 
 rsvScriptDir=$(dirname "${BASH_SOURCE[0]}")
 
 today=$(date +%F)
 
 rsvDir=/hive/data/outside/otto/rsv
 rsvNcbiDir=$rsvDir/ncbi/ncbi.latest
 
-usherDir=~angie/github/usher
-usherSampled=$usherDir/build/usher-sampled
-usher=$usherDir/build/usher
-matUtils=$usherDir/build/matUtils
-matOptimize=$usherDir/build/matOptimize
+usherDir=~angie/github/usher/build
+usherSampled=$usherDir/usher-sampled
+usher=$usherDir/usher
+matUtils=$usherDir/matUtils
+matOptimize=$usherDir/matOptimize
 
 # RSV-A reference: Nextstrain uses KJ627695.1 but RefSeq is NC_038235.1 (M74568)
 asmAccA=GCF_002815475.1
 gbffA=$rsvDir/NC_038235.1.gbff
 nextcladeNameA=rsv_a
 refFaA=$rsvDir/NC_038235.1.fa
 archiveRootA=/hive/users/angie/publicTreesRsvA
 
 # RSV-B reference: Nextstrain uses ? but RefSeq is NC_001781.1 (AF013254)
 asmAccB=GCF_000855545.1
 gbffB=$rsvDir/NC_001781.1.gbff
 nextcladeNameB=rsv_b
 refFaB=$rsvDir/NC_001781.1.fa
 archiveRootB=/hive/users/angie/publicTreesRsvB
 
@@ -201,63 +201,62 @@
 
     # Make a taxonium view
     usher_to_taxonium --input rsv$aOrB.$today.pb \
         --metadata rsv$aOrB.$today.metadata.tsv.gz \
         --columns genbank_accession,country,location,date,authors,GCC_nextclade,GCC_usher,GCC_assigned_2023-11 \
         --clade_types=placeholder,pango \
         --genbank $gbff \
         --name_internal_nodes \
         --title "RSV-"$aOrB" $today tree with $sampleCountComma genomes from INSDC" \
         --output rsv$aOrB.$today.taxonium.jsonl.gz \
         >& usher_to_taxonium.$aOrB.log
 
     # Update links to latest protobuf and metadata in /gbdb directories
     nc=$(basename $gbff .gbff)
     dir=/gbdb/wuhCor1/hgPhyloPlaceData/rsv/$nc
-    mkdir -p $dir
-    ln -sf $(pwd)/rsv$aOrB.$today.pb $dir/rsv$aOrB.latest.pb
-    ln -sf $(pwd)/rsv$aOrB.$today.metadata.tsv.gz $dir/rsv$aOrB.latest.metadata.tsv.gz
-    ln -sf $(pwd)/hgPhyloPlace.description.$aOrB.txt $dir/rsv$aOrB.latest.version.txt
+    ssh hgwdev mkdir -p $dir
+    ssh hgwdev ln -sf $(pwd)/rsv$aOrB.$today.pb $dir/rsv$aOrB.latest.pb
+    ssh hgwdev ln -sf $(pwd)/rsv$aOrB.$today.metadata.tsv.gz $dir/rsv$aOrB.latest.metadata.tsv.gz
+    ssh hgwdev ln -sf $(pwd)/hgPhyloPlace.description.$aOrB.txt $dir/rsv$aOrB.latest.version.txt
 
     # Extract Newick and VCF for anyone who wants to download those instead of protobuf
     $matUtils extract -i rsv$aOrB.$today.pb \
         -t rsv$aOrB.$today.nwk \
         -v rsv$aOrB.$today.vcf >& tmp.log
     pigz -p 8 -f rsv$aOrB.$today.nwk rsv$aOrB.$today.vcf
 
     # Link to public trees download directory hierarchy
     read y m d < <(echo $today | sed -re 's/-/ /g')
     archive=$archiveRoot/$y/$m/$d
     mkdir -p $archive
     ln -f $(pwd)/rsv$aOrB.$today.{nwk,vcf,metadata.tsv,taxonium.jsonl}.gz $archive/
     gzip -c rsv$aOrB.$today.pb > $archive/rsv$aOrB.$today.pb.gz
     ln -f $(pwd)/hgPhyloPlace.description.$aOrB.txt $archive/rsv$aOrB.$today.version.txt
 
     # Update 'latest' in $archiveRoot
     for f in $archive/rsv$aOrB.$today.*; do
         latestF=$(echo $(basename $f) | sed -re 's/'$today'/latest/')
         ln -f $f $archiveRoot/$latestF
     done
 
     # Update hgdownload-test link for archive
     asmDir=$(echo $asmAcc \
         | sed -re 's@^(GC[AF])_([0-9]{3})([0-9]{3})([0-9]{3})\.([0-9]+)@\1/\2/\3/\4/\1_\2\3\4.\5@')
-    mkdir -p /data/apache/htdocs-hgdownload/hubs/$asmDir/UShER_RSV-$aOrB/$y/$m
-    ln -sf $archive /data/apache/htdocs-hgdownload/hubs/$asmDir/UShER_RSV-$aOrB/$y/$m
+    ssh hgwdev ln -sf $archiveRoot/rsv$aOrB.latest.* /data/apache/htdocs-hgdownload/hubs/$asmDir/UShER_RSV-$aOrB/
     # rsync to hgdownload{1,2} hubs dir
-    for h in hgdownload1 hgdownload3; do
-        if rsync -a -L --delete /data/apache/htdocs-hgdownload/hubs/$asmDir/UShER_RSV-$aOrB/* \
+    for h in hgdownload1 hgdownload2 hgdownload3; do
+        if ssh hgwdev rsync -a -L --delete /data/apache/htdocs-hgdownload/hubs/$asmDir/UShER_RSV-$aOrB/* \
                  qateam@$h:/mirrordata/hubs/$asmDir/UShER_RSV-$aOrB/; then
             true
         else
             echo ""
             echo "*** rsync to $h failed; disk full? ***"
             echo ""
         fi
     done
 done
 
 set +o pipefail
 grep 'Could not' annotate.*.log | cat
 grep skipping annotate.*.log | cat
 set -o pipefail