55f6362c793e0d7cc4d2ff0ec614a5e316354b82
markd
Thu Dec 19 21:53:29 2024 -0800
don't install lsSnpPdbChimera.py any more
diff --git src/hg/hgGene/domains.c src/hg/hgGene/domains.c
index df9977c..22736b3 100644
--- src/hg/hgGene/domains.c
+++ src/hg/hgGene/domains.c
@@ -1,226 +1,226 @@
/* domains - do protein domains section. */
/* Copyright (C) 2014 The Regents of the University of California
* See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
#include "common.h"
#include "trashDir.h"
#include "hash.h"
#include "linefile.h"
#include "dystring.h"
#include "spDb.h"
#include "hgGene.h"
#include "hdb.h"
-#include "lsSnpPdbChimera.h"
+#include "lsSnpPdbChimera.h" // only used for MuPIT, lsSNP/PDB is deceased
static boolean domainsExists(struct section *section,
struct sqlConnection *conn, char *geneId)
/* Return TRUE if there's some pfam domains in swissProt on this one.
* on this one. */
{
return swissProtAcc != NULL;
}
void modBaseAnchor(char *swissProtAcc)
/* Print out anchor to modBase. */
{
hPrintf("", swissProtAcc);
//hPrintf("", swissProtAcc);
}
static void domainsPrint(struct section *section,
struct sqlConnection *conn, char *geneId)
/* Print out protein domains. */
{
char *db = sqlGetDatabase(conn);
struct slName *el, *list;
list = spExtDbAcc1List(spConn, swissProtAcc, "Interpro");
if (list != NULL)
{
char query[256], **row, **row2;
struct sqlResult *sr, *sr2;
hPrintf("InterPro Domains: ");
hPrintf("",
swissProtAcc);
hPrintf("Graphical view of domain structure
");
sqlSafef(query, sizeof(query),
"select extAcc1,extAcc2 from extDbRef,extDb"
" where extDbRef.acc = '%s'"
" and extDb.val = 'Interpro' and extDb.id = extDbRef.extDb"
, swissProtAcc);
sr = sqlGetResult(spConn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
//hPrintf("", row[0]);
//hPrintf("%s - %s
\n", row[0], row[1]);
char interPro[256];
char *pdb = hPdbFromGdb(db);
safef(interPro, 128, "%s.interProXref", pdb);
if (hTableExists(db, interPro))
{
sqlSafef(query, sizeof(query),
"select description from %s where accession = '%s' and interProId = '%s'",
interPro, swissProtAcc, row[0]);
sr2 = sqlGetResult(conn, query);
if ((row2 = sqlNextRow(sr2)) != NULL)
{
hPrintf("", row[0]);
hPrintf("%s - %s
\n", row[0], row2[0]);
}
sqlFreeResult(&sr2);
}
else
{
hPrintf("", row[0]);
hPrintf("%s - %s
\n", row[0], row[1]);
}
}
hPrintf("
\n");
slFreeList(&list);
}
if (kgVersion == KG_III)
{
/* Do Pfam domains here. */
list = getPfamDomainList(conn, geneId);
if (list != NULL)
{
hPrintf("Pfam Domains:
");
for (el = list; el != NULL; el = el->next)
{
char query[256];
char *description;
sqlSafef(query, sizeof(query),
"select description from pfamDesc where pfamAC='%s'", el->name);
description = sqlQuickString(conn, query);
if (description == NULL)
description = cloneString("n/a");
hPrintf("",
el->name);
hPrintf("%s - %s
\n", el->name, description);
freez(&description);
}
slFreeList(&list);
hPrintf("
\n");
}
/* Do SCOP domains here */
list = getDomainList(conn, geneId, "Scop");
if (list != NULL)
{
hPrintf("SCOP Domains:
");
for (el = list; el != NULL; el = el->next)
{
char query[256];
char *description;
sqlSafef(query, sizeof(query),
"select description from scopDesc where acc='%s'", el->name);
description = sqlQuickString(conn, query);
if (description == NULL)
description = cloneString("n/a");
hPrintf("",
el->name);
hPrintf("%s - %s
\n", el->name, description);
freez(&description);
}
slFreeList(&list);
hPrintf("
\n");
}
}
else
{
list = spExtDbAcc1List(spConn, swissProtAcc, "Pfam");
if (list != NULL)
{
char *pfamDescSql = genomeSetting("pfamDescSql");
hPrintf("Pfam Domains:
");
for (el = list; el != NULL; el = el->next)
{
char query[256];
char *description;
sqlSafef(query, sizeof(query), pfamDescSql, el->name);
description = sqlQuickString(conn, query);
if (description == NULL)
description = cloneString("n/a");
hPrintf("",
el->name);
hPrintf("%s - %s
\n", el->name, description);
freez(&description);
}
slFreeList(&list);
hPrintf("
\n");
}
}
list = spExtDbAcc1List(spConn, swissProtAcc, "PDB");
if (list != NULL)
{
struct sqlConnection *conn2 = sqlConnect(db);
char query[256], **row;
struct sqlResult *sr;
hPrintf("Protein Data Bank (PDB) 3-D Structure
");
sqlSafef(query, sizeof(query),
"select extAcc1,extAcc2 from extDbRef,extDb"
" where extDbRef.acc = '%s'"
" and extDb.val = 'PDB' and extDb.id = extDbRef.extDb"
, swissProtAcc);
sr = sqlGetResult(spConn, query);
hPrintf("
\n");
hPrintf("MuPIT help\n");
while ((row = sqlNextRow(sr)) != NULL)
{
hPrintf("");
hPrintf("", row[0]);
hPrintf("%s - %s ", row[0], row[1]);
// include links to MuPIT (formerly LS-SNP)
if (lsSnpPdbHasPdb(conn2, row[0]))
hPrintf(" MuPIT", lsSnpPdbGetUrlPdbSnp(row[0], NULL));
hPrintf(" | \n");
}
hPrintf("
\n");
hPrintf("
\n");
slFreeList(&list);
sqlDisconnect(&conn2);
}
/* Do modBase link. */
{
hPrintf("ModBase Predicted Comparative 3D Structure on ");
modBaseAnchor(swissProtAcc);
hPrintf("%s", swissProtAcc);
hPrintf("
\n");
hPrintf("");
hPrintf("");
modBaseAnchor(swissProtAcc);
hPrintf("\n | ", swissProtAcc);
hPrintf("");
modBaseAnchor(swissProtAcc);
hPrintf("\n | ", swissProtAcc);
hPrintf("");
modBaseAnchor(swissProtAcc);
hPrintf("\n | ", swissProtAcc);
hPrintf("
\n");
hPrintf("Front | ");
hPrintf("Top | ");
hPrintf("Side | ");
hPrintf("
\n");
hPrintf("The pictures above may be empty if there is no "
"ModBase structure for the protein. The ModBase structure "
"frequently covers just a fragment of the protein. You may "
"be asked to log onto ModBase the first time you click on the "
"pictures. It is simplest after logging in to just click on "
"the picture again to get to the specific info on that model.");
}
}
struct section *domainsSection(struct sqlConnection *conn,
struct hash *sectionRa)
/* Create domains section. */
{
struct section *section = sectionNew(sectionRa, "domains");
section->exists = domainsExists;
section->print = domainsPrint;
return section;
}