ecc8358a1e03a67aba51417799cca013f98eacc5
hiram
  Mon Feb 17 16:38:17 2020 -0800
correct construction of name index file from the gtfToGenePred infoOut.txt newer format refs #23891

diff --git src/hg/utils/automation/doEnsGeneUpdate.pl src/hg/utils/automation/doEnsGeneUpdate.pl
index a6a6445..6451c8c 100755
--- src/hg/utils/automation/doEnsGeneUpdate.pl
+++ src/hg/utils/automation/doEnsGeneUpdate.pl
@@ -536,32 +536,34 @@
 genePredToBed $db.allGenes.gp.gz stdout | sort -k1,1 -k2,2n > $db.ensGene.bed
 _EOF_
 	  );
       if (-s "$chromSizes") {
       $bossScript->add(<<_EOF_
 bedToBigBed -extraIndex=name $db.ensGene.bed $chromSizes bbi/$db.ensGene.bb
 _EOF_
 	  );
       } else {
       $bossScript->add(<<_EOF_
 bedToBigBed -extraIndex=name $db.ensGene.bed ../../../chrom.sizes bbi/$db.ensGene.bb
 _EOF_
 	  );
       }
       $bossScript->add(<<_EOF_
-grep -v "^#" infoOut.txt | awk '{printf "%s\\t%s,%s,%s,%s,%s\\n", \$1,\$2,\$3,\$8,\$9,\$10}' > $db.ensGene.nameIndex.txt
-ixIxx $db.ensGene.nameIndex.txt $db.ensGene.name.ix $db.ensGene.name.ixx
+grep -v "^#" infoOut.txt \\
+  | awk -F\$'\\t' '{printf "%s\\t%s,%s,%s,%s\\n", \$1,\$2,\$8,\$9,\$10}' \\
+    | sed -e 's/,,/,/g; s/,\$//;' > $db.ensGene.nameIndex.txt
+ixIxx $db.ensGene.nameIndex.txt $db.ensGene.ix $db.ensGene.ixx
 
 _EOF_
 	  );
       }
   $bossScript->execute() if (! $opt_debug);
 } # doProcess
 
 #########################################################################
 # * step: download [dbHost]
 sub doDownload {
   my $runDir = "$buildDir/download";
   # check if been already done
   if (-s "$runDir/$ensGtfFile" && -s "$runDir/$ensPepFile" ) {
      &HgAutomate::verbose(1,
          "# step download is already completed, continuing...\n");