fcb3971566d6570959c4cd8022972d8f7c455ebc chmalee Mon Aug 19 13:21:18 2019 -0700 Remove links to lssnp from dbSnp hgc pages, and change lssnp links to mupit on hgGene pages, refs #22953 diff --git src/hg/lib/lsSnpPdbChimera.c src/hg/lib/lsSnpPdbChimera.c index c3fbf35..a7ce67c 100644 --- src/hg/lib/lsSnpPdbChimera.c +++ src/hg/lib/lsSnpPdbChimera.c @@ -132,58 +132,47 @@ char query[256], buf[32]; sqlSafef(query, sizeof(query), "SELECT structType FROM lsSnpPdb WHERE (pdbId = \"%s\")", pdbId); char *structType = sqlNeedQuickQuery(conn, query, buf, sizeof(buf)); if (sameString(structType, "XRay")) return "X-Ray"; else if (sameString(structType, "NMR")) return "NMR"; else return NULL; } boolean lsSnpPdbHasPdb(struct sqlConnection *conn, char *pdbId) /* determine if the specified PDB has any entries in LS-SNP */ { -if (!sqlTableExists(conn, "lsSnpPdb")) +if (!sqlTableExists(conn, "knownToMupit")) return FALSE; char query[256], buf[64]; -sqlSafef(query, sizeof(query), "SELECT chain FROM lsSnpPdb WHERE (pdbId = \"%s\")", pdbId); +sqlSafef(query, sizeof(query), "SELECT value FROM knownToMupit WHERE value = \"%s\" limit 1", pdbId); return (sqlQuickQuery(conn, query, buf, sizeof(buf)) != NULL); } -static char *fmtParam(char sep, char *name, char *val) -/* format a parameter to the URL; WARNING: static return */ -{ -static char param[64]; -safef(param, sizeof(param), "%c%s=%s", sep, name, val); -return param; -} - char *lsSnpPdbGetUrlPdbSnp(char *pdbId, char *snpId) /* get LS-SNP/PDB URL for a particular PDB and/or SNP. One or the two * ids maybe null */ { -char url[256], sep='?'; -safecpy(url, sizeof(url), "http://ls-snp.icm.jhu.edu/ls-snp-pdb/inquire"); +char url[256]; +safecpy(url, sizeof(url), "http://mupit.icm.jhu.edu/MuPIT_Interactive/?structure_id="); if (pdbId != NULL) { - safecat(url, sizeof(url), fmtParam(sep, "pdbId", pdbId)); - sep = '&'; + safecat(url, sizeof(url), pdbId); } -if (snpId != NULL) - safecat(url, sizeof(url), fmtParam(sep, "snpId", snpId)); return cloneString(url); } void lsSnpPdbChimeraGenericLink(char *pdbSpec, char *script, char *trashDirName, char *trashBaseName, struct tempName *chimerax) /* Generate a chimerax file for the given pdbSpec, which can be a PDB id or a * URL. Copies in the lsSnpPdbChimera.py file and then adds optional script python code. * Fills in chimerax structure. * FIXME: This is an experiment for H1N1 flu browser, this function has * nothing to do with LS/SNP. If we decide to keep this, this should be * split into a generic chimera module. */ { trashDirFile(chimerax, trashDirName, trashBaseName, ".chimerax");