65a21f5c7cdda8de27c2054ddffdd391284c3aa1 hiram Mon Jun 1 09:03:06 2026 -0700 switching entirely to genome-centdb hgcentral refs #31811 diff --git src/hg/utils/otto/userRequests/kegAlignLastz.sh src/hg/utils/otto/userRequests/kegAlignLastz.sh index d71cbf51d5a..af71984abd6 100755 --- src/hg/utils/otto/userRequests/kegAlignLastz.sh +++ src/hg/utils/otto/userRequests/kegAlignLastz.sh @@ -1,46 +1,48 @@ #!/bin/bash set -eEu -o pipefail export userName="`whoami`" export bigHub="hgwdev" export workHorse="hgwdev" export smallClusterHub="hgwdev" export fileServer="hgwdev" # a python virtual environment to run this export planemoCmd="/hive/users/hiram/galaxy/venv3.12/bin/planemo" +export centDb="hgcentral" +export hgSql="hgsql -hgenome-centdb" # parse optional -force flag to skip genark table verification export forceRun=0 if [ $# -gt 0 ] && [ "$1" = "-force" ]; then forceRun=1 shift fi if [ $# != 4 ]; then printf "ERROR: arg count: %d != 4\n" "$#" 1>&2 printf "usage: kegAlignLastz.sh [-force] <target> <query> <tClade> <qClade> Where target/query is either a UCSC db name, or is an assembly hub identifier, e.g.: GCA_002844635.1_USMARCv1.0.1 And [tq]Clade is one of: primate|mammal|other -The -force option skips the hgcentraltest.genark table verification +The -force option skips the ${centDb}.genark table verification for GenArk assembly identifiers. Will create directory to work in, for example if, UCSC db: /hive/data/target/bed/lastzQuery.yyyy-mm-dd/ Or, in the assembly hub build directory: /hive/data/genomes/asmHubs/allBuild/GCA/002/844/635/GCA_002844635.1_USMARCv1.0/trackData/lastzQuery.yyyy-mm-dd Will set up a DEF file there, and a kegAlign.sh script to run all steps and output makeDoc text to document what happened. Also sets up a lastzRun.sh script that could be used to run the UCSC lastz procedure. AND MORE, it will run the swap operation into the corresponding blastz.target.swap directory in the query genome work space. @@ -118,31 +120,31 @@ esac printf "%s" "${count}" } # obtain the organism name out of the assembly_report.txt file function orgName() { export asmName=$1 case $asmName in GC[AF]_*) gcxPath=$(gcPath $asmName) asmDir="/hive/data/outside/ncbi/genomes/${gcxPath}/${asmName}" asmRpt="${asmDir}/${asmName}_assembly_report.txt" oName=`egrep -m 1 -i "^# organism name:" ${asmRpt} | tr -d '\r' | sed -e 's/.*(//; s/).*//'` ;; *) - oName=`/cluster/bin/x86_64/hgsql -N -e "select organism from dbDb where name=\"${asmName}\";" hgcentraltest` + oName=`/cluster/bin/x86_64/${hgSql} -N -e "select organism from dbDb where name=\"${asmName}\";" "${centDb}"` ;; esac printf "%s" "${oName}" } # generate URL to the fa.gz files to pass off to galaxy function faGzUrl() { export asmName=$1 case $asmName in GC[AF]_*) gcxPath=$(gcPath $asmName) id=$(accId $asmName) printf "https://hgdownload.soe.ucsc.edu/hubs/%s/%s/%s.fa.gz" "${gcxPath}" "${id}" "${id}" ;; *) @@ -156,59 +158,59 @@ export asmName=$1 case $asmName in GC[AF]_*) gcxPath=$(gcPath $asmName) asmDir="/hive/data/outside/ncbi/genomes/${gcxPath}/${asmName}" asmRpt="${asmDir}/${asmName}_assembly_report.txt" oDate=`egrep -m 1 -i "^#[[:space:]]*Date:" ${asmRpt} | tr -d '\r' | sed -e 's/.*ate: \+//;'` ;; *) oDate="" ;; esac printf "%s" "${oDate}" } -# verifyGenark - verify a GenArk accession exists in hgcentraltest.genark +# verifyGenark - verify a GenArk accession exists in ${centDb}.genark # returns 0 if found, 1 if not found function verifyGenark() { local asmAccession=$1 local fullName=$2 - local count=$(/cluster/bin/x86_64/hgsql -N -e "SELECT COUNT(*) FROM genark WHERE gcAccession='${asmAccession}';" hgcentraltest) + local count=$(/cluster/bin/x86_64/${hgSql} -N -e "SELECT COUNT(*) FROM genark WHERE gcAccession='${asmAccession}';" "${centDb}") if [ "$count" -eq 0 ]; then printf "ERROR: assembly '%s' not found in GenArk\n" "$fullName" 1>&2 return 1 fi return 0 } ############################################################################## ############################################################################## ### start seconds export startT=`date "+%s"` export target="$1" export query="$2" export tClade="$3" export qClade="$4" export tGcPath=$(gcPath $target) export qGcPath=$(gcPath $query) export tAccId=$(accId $target) export qAccId=$(accId $query) -# verify GenArk assemblies exist in hgcentraltest.genark unless -force +# verify GenArk assemblies exist in ${centDb}.genark unless -force if [ "$forceRun" -eq 0 ]; then export genarkErrors=0 case $target in GC[AF]_*) verifyGenark "$tAccId" "$target" || genarkErrors=$((genarkErrors+1)) ;; esac case $query in GC[AF]_*) verifyGenark "$qAccId" "$query" || genarkErrors=$((genarkErrors+1)) ;; esac if [ "$genarkErrors" -gt 0 ]; then printf "Use -force to skip this check\n" 1>&2 exit 255 fi fi printf "# tq: '${target}' '${query}' '${tClade}' '${qClade}'\n" 1>&2