241689958a2c3871e25ec78d53fd88f9ebb828e5
galt
  Thu Jan 16 16:38:17 2014 -0800
Fixes #12513. hgTables gtf output problem when table is a split-table. For example, dm3.rmsk
diff --git src/hg/hgTables/gffOut.c src/hg/hgTables/gffOut.c
index ef14f76..bcfb57c 100644
--- src/hg/hgTables/gffOut.c
+++ src/hg/hgTables/gffOut.c
@@ -390,38 +390,40 @@
 return hash;
 }
 
 void doOutGff(char *table, struct sqlConnection *conn, boolean outputGtf)
 /* Save as GFF/GTF. */
 {
 struct hTableInfo *hti = getHti(database, table, conn);
 struct bed *bedList;
 struct slName *exonFramesList = NULL;
 char source[HDB_MAX_TABLE_STRING];
 int itemCount;
 struct region *region, *regionList = getRegions();
 
 textOpen();
 
-int efIdx = sqlFieldIndex(conn, table, "exonFrames");
+int efIdx = -1;
+if (!hti->isSplit)
+    efIdx = sqlFieldIndex(conn, table, "exonFrames");
 
 safef(source, sizeof(source), "%s_%s", database, table);
 itemCount = 0;
 // regionList can have many thousands of items e.g. rheMac3 has 34000 chroms!
 struct hash *chromHash = NULL;
 int regionCount = slCount(regionList);
-if (regionCount > 400)
+if (!hti->isSplit && (regionCount > 400))
     {
     chromHash = makeChromHashForTable(conn, table);
     };
 for (region = regionList; region != NULL; region = region->next)
     {
     if (chromHash && (!hashFindVal(chromHash, region->chrom)))
 	    continue;
     struct lm *lm = lmInit(64*1024);
     int fieldCount;
     bedList = cookedBedList(conn, table, region, lm, &fieldCount);
     if (efIdx != -1)
 	exonFramesList = getExonFrames(table, conn, bedList);
     itemCount += bedToGffLines(bedList, exonFramesList, hti, fieldCount, source, outputGtf);
     lmCleanup(&lm);
     }