72f056ceabce7b9778635a48def6ee9be5b29ebe markd Fri Sep 21 03:05:03 2012 -0700 link GENCODE to APPRIS and HGNC diff --git src/hg/hgc/ccdsClick.c src/hg/hgc/ccdsClick.c index f5fce46..a33d3a0 100644 --- src/hg/hgc/ccdsClick.c +++ src/hg/hgc/ccdsClick.c @@ -1,78 +1,83 @@ /* ccdsClick - click handling for CCDS track and related functions */ #include "common.h" #include "hgc.h" #include "ccdsClick.h" #include "ccdsInfo.h" #include "ccdsNotes.h" #include "ccdsGeneMap.h" #include "geneSimilarities.h" #include "genbank.h" #include "genePred.h" #include "genePredReader.h" #include "ensFace.h" #include "mgcClick.h" #include "htmshell.h" -struct ccdsInfo *getCcdsUrlForSrcDb(struct sqlConnection *conn, char *acc) +static struct ccdsInfo *getCcdsInfoForSrcDb(struct sqlConnection *conn, char *acc) /* Get a ccdsInfo object for a RefSeq, ensembl, or vega gene, if it * exists, otherwise return NULL */ { if (sqlTableExists(conn, "ccdsInfo")) return ccdsInfoSelectByMrna(conn, acc); else return NULL; } -void printCcdsUrlForSrcDb(struct sqlConnection *conn, struct ccdsInfo *ccdsInfo) -/* Print out CCDS URL for a refseq, ensembl, or vega gene, if it +void printCcdsExtUrl(char *ccdsId) +/* Print out URL to link to CCDS database at NCBI */ +{ +printf("http://www.ncbi.nlm.nih.gov/CCDS/CcdsBrowse.cgi?REQUEST=CCDS&BUILDS=ALLBUILDS&DATA=%s", ccdsId); +} + +static void printCcdsUrlForSrcDb(struct sqlConnection *conn, struct ccdsInfo *ccdsInfo) +/* Print out CCDS hgc URL for a refseq, ensembl, or vega gene, if it * exists. */ { printf("../cgi-bin/hgc?%s&g=ccdsGene&i=%s&c=%s&o=%d&l=%d&r=%d&db=%s", cartSidUrlString(cart), ccdsInfo->ccds, seqName, winStart, winStart, winEnd, database); } void printCcdsForSrcDb(struct sqlConnection *conn, char *acc) -/* Print out CCDS link for a refseq, ensembl, or vega gene, if it +/* Print out CCDS hgc link for a refseq, ensembl, or vega gene, if it * exists. */ { -struct ccdsInfo *ccdsInfo = getCcdsUrlForSrcDb(conn, acc);; +struct ccdsInfo *ccdsInfo = getCcdsInfoForSrcDb(conn, acc);; if (ccdsInfo != NULL) { printf("<B>CCDS:</B> <A href=\""); printCcdsUrlForSrcDb(conn, ccdsInfo); printf("\">%s</A><BR>", ccdsInfo->ccds); } } struct ccdsGeneMap *getCcdsGenesForMappedGene(struct sqlConnection *conn, char *acc, char *mapTable) /* get a list of ccds genes associated with a current and window from a * mapping table, or NULL */ { struct ccdsGeneMap *ccdsGenes = NULL; if (sqlTableExists(conn, mapTable) && sqlTableExists(conn, "ccdsInfo")) ccdsGenes = ccdsGeneMapSelectByGeneOver(conn, mapTable, acc, seqName, winStart, winEnd, 0.0); slSort(&ccdsGenes, ccdsGeneMapCcdsIdCmp); return ccdsGenes; } - void printCcdsUrl(struct sqlConnection *conn, char *ccdsId) -/* Print out CCDS url for a gene */ +/* Print out CCDS hgc URL for a gene */ { printf("../cgi-bin/hgc?%s&g=ccdsGene&i=%s&c=%s&o=%d&l=%d&r=%d&db=%s", cartSidUrlString(cart), ccdsId, seqName, winStart, winStart, winEnd, database); } void printCcdsForMappedGene(struct sqlConnection *conn, char *acc, char *mapTable) /* Print out CCDS links for a gene mapped via a cddsGeneMap table */ { struct ccdsGeneMap *ccdsGenes = getCcdsGenesForMappedGene(conn, acc, mapTable); if (ccdsGenes != NULL) { printf("<B>CCDS:</B> "); struct ccdsGeneMap *gene; @@ -310,33 +315,33 @@ /* CCDS sequence links */ printf("<TR>\n"); printf("<TH>Sequences"); printf("<TD>"); hgcAnchorSomewhere("htcGeneMrna", ccdsId, "ccdsGene", seqName); printf("CDS</A>, "); hgcAnchorSomewhere("htcTranslatedPredMRna", ccdsId, "translate", seqName); printf("protein</A>, "); hgcAnchorSomewhere( "htcGeneInGenome", ccdsId, "ccdsGene", seqName); printf("genomic</A>"); printf("</TR>\n"); /* CCDS databases */ printf("<TR>\n"); -printf("<TH>CCDS database"); -printf("<TD> <A HREF=\"http://www.ncbi.nlm.nih.gov/CCDS/CcdsBrowse.cgi?REQUEST=CCDS&BUILDS=ALLBUILDS&DATA=%s\" TARGET=_blank>%s</A>", - ccdsId, ccdsId); +printf("<TH>CCDS database<TD> <A HREF=\""); +printCcdsExtUrl(ccdsId); +printf("\" TARGET=_blank>%s</A>", ccdsId); printf("</TR>\n"); printf("</TBODY></TABLE>\n"); printf("<BR>\n"); } } static void writeLinksHtml(struct sqlConnection *conn, char *ccdsId, struct ccdsInfo *rsCcds, struct ccdsInfo *vegaCcds, struct ccdsInfo *ensCcds) /* write table with links to other browser apps or external databases (3 columns) */ { printf("<H3>Associated Sequences</H3>\n"); printf("<TABLE class=\"hgcCcds\">\n"); printf("<THEAD>\n"); printf("<TR><TH> <TH>mRNA<TH>Protein</TR>\n"); printf("</THEAD><TBODY>\n");