4951a3f2ca22c980a415c231e59958197baec741
hiram
  Wed Oct 5 10:41:05 2022 -0700
correct Gene model labels on the ncbiGene (not really NCBI gene) track no redmine

diff --git src/hg/utils/automation/asmHubTrackDb.sh src/hg/utils/automation/asmHubTrackDb.sh
index a313a6c..c051b5c 100755
--- src/hg/utils/automation/asmHubTrackDb.sh
+++ src/hg/utils/automation/asmHubTrackDb.sh
@@ -5,42 +5,51 @@
 if [ $# -ne 3 ]; then
   printf "usage: trackDb.sh <asmId> <ncbiAsmId> <pathTo/assembly hub build directory> > trackDb.txt\n" 1>&2
   printf "expecting to find *.ucsc.2bit and bbi/ files at given path\n" 1>&2
   printf "asmId may be equal to ncbiAsmId if it is a GenArk build\n" 1>&2
   printf "or asmId might be a default dbName if it is a UCSC style\n" 1>&2
   printf "browser build.\n" 1>&2
   exit 255
 fi
 
 export asmId=$1
 export ncbiAsmId=$2
 export buildDir=$3
 
 export scriptDir="$HOME/kent/src/hg/utils/automation"
 
+export asmType="n/a"
+
 # technique to set variables based on the name in another variable:
 
 if [ -s "$buildDir/dropTracks.list" ]; then
   printf "# reading dropTracks.list\n" 1>&2
   for dropTrack in `cat "$buildDir/dropTracks.list"`
   do
      notTrack="not_${dropTrack}"
 #      printf "# %s\n" "${notTrack}" 1>&2
      eval $notTrack="1"
   done
 fi
 
+case "${asmId}" in
+  GCA_*) asmType="genbank"
+    ;;
+  GCF_*) asmType="refseq"
+    ;;
+esac
+
 mkdir -p $buildDir/bbi
 mkdir -p $buildDir/ixIxx
 
 # may or may not have a searchTrix for assembly, assume none
 export searchTrix=""
 # check to see if there is a searchTrix assembly index
 if [ -s ${buildDir}/trackData/assemblyGap/${asmId}.assembly.ix ]; then
   rm -f $buildDir/ixIxx/${asmId}.assembly.ix*
   ln -s ../trackData/assemblyGap/${asmId}.assembly.ix $buildDir/ixIxx
   ln -s ../trackData/assemblyGap/${asmId}.assembly.ixx $buildDir/ixIxx
   searchTrix="
 searchTrix ixIxx/${asmId}.assembly.ix"
 fi
 
 if [ -s ${buildDir}/trackData/assemblyGap/${asmId}.assembly.bb ]; then
@@ -579,36 +588,42 @@
 if [ "${haveNcbiRefSeq}" = "no" ]; then
 
 # may or may not have a searchTrix for ncbiGene, assume none
 searchTrix=""
 # check to see if there is a index for ncbiGene
 if [ -s ${buildDir}/trackData/ncbiGene/$asmId.ncbiGene.ix ]; then
   searchTrix="
 searchTrix ixIxx/$asmId.ncbiGene.ix"
 fi
 
 
 if [ -s ${buildDir}/trackData/ncbiGene/$asmId.ncbiGene.bb ]; then
 rm -f $buildDir/bbi/${asmId}.ncbiGene.bb
 rm -f $buildDir/ixIxx/${asmId}.ncbiGene.ix
 rm -f $buildDir/ixIxx/${asmId}.ncbiGene.ixx
+export longLabel="Gene models submitted to NCBI"
+export shortLabel="Gene models"
+if [ "$asmType" = "refseq" ]; then
+  longLabel="NCBI gene predictions"
+  shortLabel="NCBI Genes"
+fi
 ln -s ../trackData/ncbiGene/$asmId.ncbiGene.bb $buildDir/bbi/${asmId}.ncbiGene.bb
 ln -s ../trackData/ncbiGene/$asmId.ncbiGene.ix $buildDir/ixIxx/${asmId}.ncbiGene.ix
 ln -s ../trackData/ncbiGene/$asmId.ncbiGene.ixx $buildDir/ixIxx/${asmId}.ncbiGene.ixx
   printf "track ncbiGene
-longLabel NCBI gene predictions
-shortLabel NCBI Genes
+longLabel $longLabel
+shortLabel $shortLabel
 visibility pack
 color 0,80,150
 altColor 150,80,0
 colorByStrand 0,80,150 150,80,0
 bigDataUrl bbi/%s.ncbiGene.bb
 type bigGenePred
 html html/%s.ncbiGene
 searchIndex name%s
 url https://www.ncbi.nlm.nih.gov/gene/?term=\$\$
 urlLabel Entrez gene
 labelFields geneName,geneName2
 group genes\n\n" "${asmId}" "${asmId}" "${searchTrix}"
 
   $scriptDir/asmHubNcbiGene.pl $asmId $ncbiAsmId $buildDir/html/$asmId.names.tab $buildDir/trackData > $buildDir/html/$asmId.ncbiGene.html