199af1bfc7e950026d4392777113e6bf6d8d61f9
max
  Mon Nov 9 03:27:48 2020 -0800
libifying refseq summary abbreviator and also running on the refGene hgc
page. refs #26454

diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c
index 2a97f7c..bc7e738 100644
--- src/hg/hgGene/hgGene.c
+++ src/hg/hgGene/hgGene.c
@@ -188,70 +188,52 @@
 
 boolean idInRefseq(char *id, struct sqlConnection *conn)
 /* Return TRUE if id is in refGene table */
 {
 char query[256];
 if (!sqlTableExists(conn, "refGene"))
     {
     return(FALSE);
     }
 
 sqlSafef(query, sizeof(query),
 	"select count(*) from refGene where name = '%s'", id);
 return sqlQuickNum(conn, query) > 0;
 }
 
-char *abbreviateSummary(char *summary)
-/* Get rid of some repetitious stuff. */
-{
-char *pattern =
-"Publication Note:  This RefSeq record includes a subset "
-"of the publications that are available for this gene. "
-"Please see the Gene record to access additional publications.";
-stripString(summary, pattern);
-
-// remove anything after ##Evidence-Data-START##
-char *findStr = "##Evidence-Data-START##";
-char *start = memMatch(findStr, strlen(findStr), summary, strlen(summary));
-if (start)
-    *start = 0;
-
-return summary;
-}
-
 char *descriptionString(char *id, struct sqlConnection *conn)
 /* return description as it would be printed in html, can free after use */
 {
 char *descrBySql = NULL;
 char *summaryTables = genomeOptionalSetting("summaryTables");
 struct dyString *description = dyStringNew(0);
 
 descrBySql = genoQuery(id, "descriptionSql", conn);
 dyStringPrintf(description, "<B>Description:</B> ");
 if (descrBySql != NULL)
     dyStringPrintf(description, "%s<BR>\n", descrBySql);
 else
     dyStringPrintf(description, "%s<BR>\n", "No description available");
 freez(&descrBySql);
 if (summaryTables != NULL)
     {
     if (sqlTablesExist(conn, summaryTables))
 	{
 	char *summary = genoQuery(id, "summarySql", conn);
 	if (summary != NULL && summary[0] != 0)
 	    {
-	    summary = abbreviateSummary(summary);
+	    summary = abbreviateRefSeqSummary(summary);
 	    dyStringPrintf(description, "<B>%s",
 		genomeSetting("summarySource"));
 	    if (genomeOptionalSetting("summaryIdSql"))
 	        {
 		char *summaryId = genoQuery(id, "summaryIdSql", conn);
 		if (summaryId != NULL)
 		    dyStringPrintf(description, " (%s)", summaryId);
 		}
 	    dyStringPrintf(description, ":</B> %s", summary);
 	    freez(&summary);
 	    dyStringPrintf(description, "<BR>\n");
 	    }
 	}
     }
 return dyStringCannibalize(&description);