b1a9de0fd2ebab6d3caf4197eecc2e75eb74162d
markd
  Mon May 24 13:53:35 2021 -0700
Added better handling of GTFs without correct frames on CDS. This also simplified the handling of GTF stop codons

diff --git src/hg/inc/genePred.h src/hg/inc/genePred.h
index f5a896d..6840a41 100644
--- src/hg/inc/genePred.h
+++ src/hg/inc/genePred.h
@@ -315,31 +315,36 @@
  * to file errFh (open /dev/null to discard).  Lookup chromosome size in database if
  * db is not NULL. Returns count of errors. */
 
 int genePredCheckChromSizes(char *desc, FILE* errFh, struct genePred* gp,
                             struct hash* chromSizes);
 /* Validate a genePred for consistency.  desc is printed the error messages
  * to file errFh (open /dev/null to discard).  Lookup chromosome size in hash.
  */
 
 boolean genePredNmdTarget(struct genePred *gp);
 /* Return TRUE if cds end is more than 50bp upstream of
    last intron. */
 
 void genePredAddExonFrames(struct genePred *gp);
 /* Add exonFrames array to a genePred that doesn't have it. Frame is assumed
- * to be contiguous. */
+ * to be contiguous.  NOTE: suggest using genePredFixExonFrames for new code. */
+
+void genePredFixExonFrames(struct genePred *gp);
+/* Add exonFrames array to a genePred that has frame on only some or no
+ * features. Frame is assumed to be contiguous when an existing frame is not
+ * present. */
 
 void genePredRc(struct genePred *gp, int chromSize);
 /* Reverse complement a genePred (project it to the opposite strand).  Useful
  * when doing analysis that is simplified by having things on the same strand.
  */
 
 struct genePred *genePredNew(char *name, char *chrom, char strand,
                              unsigned txStart, unsigned txEnd,
                              unsigned cdsStart, unsigned cdsEnd,
                              unsigned optFields, unsigned exonSpace);
 /* create a new gene with space for the specified number of exons allocated.
  * genePredGrow maybe used to expand this space if needed. */
 
 void genePredGrow(struct genePred *gp, unsigned *exonSpacePtr);
 /* Increase memory allocated to a psl to hold more exons.  exonSpacePtr