d1b4008e10a8d4fc32b21e78cdefd6914c45550b
cline
  Mon May 23 16:07:06 2011 -0700
I previously modified txCdsToGene so that it would issue a warning and not errAbort when it came across a CDS with a premature stop codon.  That change was at the urging of Markd, who pointed out that the CDS transcripts in question had not been provisionally accepted or rejected yet, and that it's now accepted that we don't understand NMD as well as we'd thought.  But when I changed the premature stop codon condition from an errAbort to warning condition, I'd neglected to do the second part: addressing what sort of thick start and end to have in the output bed.  I decided that if a PTC is detected when trying to generate a protein sequence (which yields no protein sequence), then the thickStart and thickEnd should be the same
diff --git src/hg/lib/cdsEvidence.c src/hg/lib/cdsEvidence.c
index 69c0eb4..ff4d18e 100644
--- src/hg/lib/cdsEvidence.c
+++ src/hg/lib/cdsEvidence.c
@@ -207,34 +207,35 @@
 struct lineFile *lf = lineFileOpen(fileName, TRUE);
 struct hash *hash = hashNew(18);
 char *row[CDSEVIDENCE_NUM_COLS];
 while (lineFileRowTab(lf, row))
     {
     struct cdsEvidence *cds = cdsEvidenceLoad(row);
     if (hashLookup(hash, cds->name))
         errAbort("%s duplicated in %s, perhaps you want to run txCdsPick?",
 		cds->name, fileName);
     hashAdd(hash, cds->name, cds);
     }
 lineFileClose(&lf);
 return hash;
 }
 
-void cdsEvidenceSetBedThick(struct cdsEvidence *cds, struct bed *bed)
+void cdsEvidenceSetBedThick(struct cdsEvidence *cds, struct bed *bed,
+			    const boolean freeOfCdsErrors)
 /* Set thickStart/thickEnd on bed from cdsEvidence. */
 {
-if (cds == NULL)
+if (cds == NULL || !freeOfCdsErrors)
     {
     bed->thickStart = bed->thickEnd = bed->chromStart;
     return;
     }
 int txCdsStart = cds->start, txCdsEnd = cds->end;
 if (bed->strand[0] == '-')
     {
     int txSize = bedTotalBlockSize(bed);
     reverseIntRange(&txCdsStart, &txCdsEnd, txSize);
     }
 int i;
 int txStart = 0, txEnd;
 for (i=0; i<bed->blockCount; ++i)
     {
     int blockSize = bed->blockSizes[i];