62746b4dd3909b50dce1928ca75d3ba8316f83e6
braney
  Tue Jul 14 15:42:46 2020 -0700
changes from user Sergej Nowoshilow on github

diff --git src/hg/lib/genePred.c src/hg/lib/genePred.c
index 7edbfc4..8127e9a 100644
--- src/hg/lib/genePred.c
+++ src/hg/lib/genePred.c
@@ -820,60 +820,60 @@
 
 /* make sure stop has frame if some exons in the gene had frame */
 if (haveFrame)
     fixStopFrame(gp);
 checkForNoFrames(gp);
 }
 
 static struct genePred *mkFromGroupedGxf(struct gffFile *gff, struct gffGroup *group, char *name,
                                          boolean isGtf, char *exonSelectWord, unsigned optFields,
                                          unsigned options)
 /* common function to create genePreds from GFFs or GTFs.  This is a little
  * ugly with to many check of isGtf, however the was way to much identical
  * code the other way. Options are from genePredFromGxfOpts */
 {
 struct genePred *gp;
-int stopCodonStart = -1, stopCodonEnd = -1;
-int cdsStart = BIGNUM, cdsEnd = -BIGNUM;
+long stopCodonStart = -1, stopCodonEnd = -1;
+long cdsStart = -1, cdsEnd = -1;
 int exonCount = 0;
 boolean haveStartCodon = FALSE, haveStopCodon = FALSE;
 struct gffLine *gl;
 unsigned *eStarts, *eEnds;
 int i;
 
 /* should we count on start/stop codon annotation in GFFs? */
 boolean useStartStops = isGtf || haveStartStopCodons(gff);
 
 int geneStart = 0, geneEnd = 0;
 
 /* Count up exons and figure out cdsStart and cdsEnd. */
 for (gl = group->lineList; gl != NULL; gl = gl->next)
     {
     boolean exonishLine = FALSE;
     if (ignoreGxfLine(gl, isGtf))
         continue;
     if (isExon(gl->feature, isGtf, exonSelectWord))
 	{
 	exonishLine = TRUE;
 	++exonCount;
 	}
     if (isCds(gl->feature))
         {
 	exonishLine = TRUE;
-	if (gl->start < cdsStart)
+	if ((cdsStart < 0) || (gl->start < cdsStart))
             cdsStart = gl->start;
-	if (gl->end > cdsEnd)
+	if ((cdsEnd < 0) || (gl->end > cdsEnd))
             cdsEnd = gl->end;
 	}
     if (exonishLine)
         {
 	if (geneStart == geneEnd)  // Not initialized yet
 	     {
 	     geneStart = gl->start;
 	     geneEnd = gl->end;
 	     }
 	else
 	     {
 	     geneStart = min(gl->start, geneStart);
 	     geneEnd = max(gl->end, geneEnd);
 	     }
 	}