e70152e44cc66cc599ff6b699eb8adc07f3e656a
kent
Sat May 24 21:09:34 2014 -0700
Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment.
diff --git src/hg/hgGene/localization.c src/hg/hgGene/localization.c
index 0954126..01715ca 100644
--- src/hg/hgGene/localization.c
+++ src/hg/hgGene/localization.c
@@ -1,140 +1,143 @@
/* localization - info/predictions from various sources about protein
* localization in cellular compartments */
+/* Copyright (C) 2013 The Regents of the University of California
+ * See README in this or parent directory for licensing information. */
+
#include "common.h"
#include "hash.h"
#include "linefile.h"
#include "dystring.h"
#include "spDb.h"
#include "hgGene.h"
static boolean localizationExists(struct section *section,
struct sqlConnection *conn, char *geneId)
/* Return TRUE if localization and existance tables exist and have something
* on this one. */
{
char query[256];
/* mitopred - prediction of nuclear-encoded mitochondrial proteins */
if (swissProtAcc != NULL && sqlTableExists(conn, "mitopred"))
{
sqlSafef(query, sizeof(query),
"select count(*) from mitopred where name = '%s' or name = '%s'",
swissProtAcc, spAnyAccToId(spConn, swissProtAcc));
if (sqlQuickNum(conn, query) > 0)
return TRUE;
}
/* SGD (Sacchromyces Genome Database) localization & abundance data */
if (sqlTablesExist(conn, "sgdLocalization sgdAbundance"))
{
sqlSafef(query, sizeof(query),
"select count(*) from sgdLocalization where name = '%s'", geneId);
if (sqlQuickNum(conn, query) > 0)
return TRUE;
sqlSafef(query, sizeof(query),
"select count(*) from sgdAbundance where name = '%s'", geneId);
if (sqlQuickNum(conn, query) > 0)
return TRUE;
}
return FALSE;
}
static void localizationPrint(struct section *section,
struct sqlConnection *conn, char *geneId)
/* Print out localization and abundance links. */
{
char query[256], **row, *s = NULL;
struct sqlResult *sr;
boolean firstTime = TRUE;
/* mitopred - prediction of nuclear-encoded mitochondrial proteins */
if (swissProtAcc != NULL && sqlTableExists(conn, "mitopred"))
{
sqlSafef(query, sizeof(query),
"select confidence from mitopred where name = '%s' or name = '%s'",
swissProtAcc, spAnyAccToId(spConn, swissProtAcc));
sr = sqlGetResult(conn, query);
firstTime = TRUE;
while ((row = sqlNextRow(sr)) != NULL)
{
if (firstTime)
{
hPrintf("Mitopred: mitochondrion, confidence level: ");
firstTime = FALSE;
}
else
{
hPrintf(", ");
}
hPrintf("%s", row[0]);
}
sqlFreeResult(&sr);
if (!firstTime)
{
hPrintf("
");
hPrintf("Prediction of nuclear-encoded mitochondrial proteins from "
"Guda et al., Bioinformatics. 2004 Jul 22;20(11):1785-94.
"
"For more information see "
""
"http://mitopred.sdsc.edu/.
");
}
}
/* SGD (Sacchromyces Genome Database) localization & abundance data */
if (sqlTablesExist(conn, "sgdLocalization sgdAbundance"))
{
sqlSafef(query, sizeof(query),
"select value from sgdLocalization where name = '%s'", geneId);
sr = sqlGetResult(conn, query);
firstTime = TRUE;
while ((row = sqlNextRow(sr)) != NULL)
{
if (firstTime)
{
hPrintf("SGD Localization: ");
firstTime = FALSE;
}
else
{
hPrintf(", ");
}
hPrintf("%s", row[0]);
}
sqlFreeResult(&sr);
if (!firstTime)
{
hPrintf("
");
}
sqlSafef(query, sizeof(query),
"select abundance from sgdAbundance where name = '%s'", geneId);
s = sqlQuickString(conn, query);
if (s != NULL)
{
hPrintf("SGD Abundance: %s (range from 41 to 1590000)
\n",
s);
freez(&s);
}
hPrintf("Protein localization data from "
"Huh et al. (2003), Nature 425:686-691
"
"Protein abundance data from "
"Ghaemmaghami et al. (2003) Nature 425:737-741
"
"For more information see "
""
"http://yeastgfp.yeastgenome.org.");
}
}
struct section *localizationSection(struct sqlConnection *conn,
struct hash *sectionRa)
/* Create Localization section. */
{
struct section *section = sectionNew(sectionRa, "localization");
if (section != NULL)
{
section->exists = localizationExists;
section->print = localizationPrint;
}
return section;
}