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/lib/hdb.c src/hg/lib/hdb.c index 5632fbf..e8bf818 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -5830,30 +5830,53 @@ accHash = sqlQuickHash(conn, NOSQLINJ "select chrom, alias from chromAlias where source = 'refseq'"); if (hashNumEntries(accHash) == 0) // No RefSeq accessions -- make accHash NULL hashFree(&accHash); hFreeConn(&conn); checkExistence = FALSE; } if (accHash) seqAcc = cloneString(hashFindVal(accHash, chrom)); if (seqAcc == NULL) seqAcc = cloneString(chrom); return seqAcc; } +char *abbreviateRefSeqSummary(char *summary) +/* strip off the uninformative parts from the RefSeq Summary text: the repetitive note + * about the publication subset and the Evidence-Data-Notes */ +{ +if (!summary) + return summary; + +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 *hdbGetMasterGeneTrack(char *knownDb) /* Get the native gene track for a knownGene database. */ { static char *masterGeneTrack = NULL; if (masterGeneTrack) // if we already know it, return it. return masterGeneTrack; struct sqlConnection *conn = hAllocConn(knownDb); char query[4096]; sqlSafef(query, ArraySize(query), "select name from masterGeneTrack"); masterGeneTrack = sqlQuickString(conn, query); hFreeConn(&conn);