5cf1ee59682c50bc606cd49b04118ed8630b91a4
fanhsu
Mon Dec 6 11:11:03 2010 -0800
Refine DECIPHER processing to be genomic position specific.
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 221f3fc..333635e 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -8918,68 +8918,63 @@
printTrackHtml(tdb);
}
void printDecipherDetails(struct trackDb *tdb, char *itemName, boolean encode)
/* Print details of a DECIPHER entry. */
{
struct sqlConnection *conn = hAllocConn(database);
char query[256];
struct sqlResult *sr;
char **row;
struct sqlConnection *conn2 = hAllocConn(database);
char query2[256];
struct sqlResult *sr2;
char **row2;
char *strand={"+"};
+int start = cartInt(cart, "o");
+int end = cartInt(cart, "t");
+char *chrom = cartString(cart, "c");
printf("
Patient %s
", itemName);
/* print phenotypes */
safef(query, sizeof(query),
"select distinct phenotype from decipherRaw where id ='%s' order by phenotype", itemName);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
printf("Phenotype: ");
while (row != NULL)
{
printf("- ");
printf("%s\n", row[0]);
row = sqlNextRow(sr);
}
printf("
");
}
sqlFreeResult(&sr);
/* link to Ensembl DECIPHER Patient View page */
printf("Patient View: \n");
printf("More details on patient %s at ", itemName);
printf("",
"https://decipher.sanger.ac.uk/application/patient/", itemName);
printf("DECIPHER.
");
/* print position info */
-safef(query, sizeof(query),
- "select chrom, chromStart, chromEnd from decipher where name ='%s'", itemName);
-sr = sqlMustGetResult(conn, query);
-row = sqlNextRow(sr);
-if (row != NULL)
- {
- printPosOnChrom(row[0], atoi(row[1]), atoi(row[2]), strand, TRUE, itemName);
- }
-sqlFreeResult(&sr);
+printPosOnChrom(chrom, start, end, strand, TRUE, itemName);
/* print UCSC Genes in the reported region */
safef(query, sizeof(query),
"select distinct t.name from knownCanonToDecipher t, kgXref x where value ='%s' and x.kgId=t.name order by geneSymbol", itemName);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
printf("
UCSC Canonical Gene(s) in this genomic region: ");
while (row != NULL)
{
safef(query2, sizeof(query2),
"select geneSymbol, kgId, description from kgXref where kgId ='%s'", row[0]);
sr2 = sqlMustGetResult(conn2, query2);
row2 = sqlNextRow(sr2);