e19de49c3685111d42c4e5cf7a8be2130d2ef3d8 markd Wed Dec 28 09:31:19 2011 -0800 added annotation level to gencode details page diff --git src/hg/hgc/gencodeClick.c src/hg/hgc/gencodeClick.c index 973c429..099c211 100644 --- src/hg/hgc/gencodeClick.c +++ src/hg/hgc/gencodeClick.c @@ -109,53 +109,67 @@ static char *getMethodDesc(char *source) /* return the annotation method name based gene or transcript source */ { // looks for being havana and/or ensembl // classifies other sources as automatic (mt_genbank_import ncrna ncrna_pseudogene) bool hasHav = containsStringNoCase(source, "havana") != NULL; bool hasEns = containsStringNoCase(source, "ensembl") != NULL; if (hasHav && hasEns) return "manual & automatic"; else if (hasHav) return "manual"; else return "automatic"; } +static char *getLevelDesc(int level) +/* return english description for level */ +{ +if (level == 1) + return "validated"; +else if (level == 2) + return "manual"; +else if (level == 3) + return "automatic"; +else + return "unknown"; +} + static char *mkExtIdUrl(struct trackDb *tdb, char *id, char *settingName, char *urlBuf) /* generate a url to a external database given an id and the name of a setting * containing the sprintf URL template.*/ { safef(urlBuf, urlBufSize, trackDbRequiredSetting(tdb, settingName), id); return urlBuf; } static void prExtIdAnchor(struct trackDb *tdb, char *id, char *settingName) /* if an id to an external database is not empty, print an HTML anchor to it */ { char urlBuf[urlBufSize]; if (!isEmpty(id)) printf("%s", mkExtIdUrl(tdb, id, settingName, urlBuf), id); } static void prTdExtIdAnchor(struct trackDb *tdb, char *id, char *settingName) /* print a table data element with an anchor for a id */ { printf(""); prExtIdAnchor(tdb, id, settingName); } + static void writePosLink(char *chrom, int chromStart, int chromEnd) /* write link to a genomic position */ { printf("%s:%d-%d", hgTracksPathAndSettings(), database, chrom, chromStart, chromEnd, chrom, chromStart+1, chromEnd); } static void writeBasicInfoHtml(struct trackDb *tdb, char *gencodeId, struct genePred *transAnno, struct wgEncodeGencodeAttrs *transAttrs, int geneChromStart, int geneChromEnd, struct wgEncodeGencodeGeneSource *geneSource, struct wgEncodeGencodeTranscriptSource *transcriptSource) /* write basic HTML info for all genes */ { /* * notes: @@ -180,31 +194,32 @@ // FIXME: white-space style should be in CCS, but don't want to risk breaking // other things. printf("Position"); printf(""); writePosLink(transAnno->chrom, transAnno->txStart, transAnno->txEnd); printf(""); writePosLink(transAnno->chrom, geneChromStart, geneChromEnd); printf("\n"); printf("Strand%s\n", transAnno->strand); printf("Biotype%s%s\n", transAttrs->transcriptType, transAttrs->geneType); /* FIXME: add href o */ printf("Status%s%s\n", transAttrs->transcriptStatus, transAttrs->geneStatus); -printf("Method%s%s\n", getMethodDesc(transcriptSource->source), getMethodDesc(geneSource->source)); +printf("Annotation Level%s (%d)\n", getLevelDesc(transAttrs->level), transAttrs->level); +printf("Annotation Method%s%s\n", getMethodDesc(transcriptSource->source), getMethodDesc(geneSource->source)); printf("HUGO gene%s\n", transAttrs->geneName); printf("CCDS%s\n", transAttrs->ccdsId); // FIXME: add sequence here?? printf("\n"); } static void writeSequenceHtml(struct trackDb *tdb, char *gencodeId, struct genePred *transAnno) /* write links to get sequences */ { printf("\n"); printf("\n"); printf("\n"); if (transAnno->cdsStart < transAnno->cdsEnd) { // protein coding @@ -287,31 +302,31 @@ { printf(""); for (i = 0; i < 3; i++) { if (pubMed != NULL) { writePubMedEntry(pubMed); pubMed = pubMed->next; } else printf("\n"); rowCnt++; } -printf("
Sequences
"); } printf("
\n"); +printf("\n"); } static void writeRefSeqEntry(struct wgEncodeGencodeRefSeq *refSeq) /* write HTML table entry for a RefSeq */ { printf("rnaAcc); printf("\" target=_blank>%s", refSeq->rnaAcc); printf(""); if (!isEmpty(refSeq->pepAcc)) { printf("pepAcc); printf("\" target=_blank>%s", refSeq->pepAcc); }