d89c874346552fbb921d6a1d038a79605f6ce613
jcasper
Wed Jul 13 11:45:07 2016 -0700
DECIPHER pipeline now runs on their new file format. Also added more data to the hgc output. refs #14465
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index af4b2a8..739c2c6 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -9842,47 +9842,83 @@
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 */
+/* print phenotypes and other information, if available */
+if (sqlFieldIndex(conn, "decipherRaw", "phenotypes") >= 0)
+ {
+ sqlSafef(query, sizeof(query),
+ "select phenotypes, mean_ratio, inheritance, pathogenicity, contribution "
+ "from decipherRaw where id = '%s'", itemName);
+ sr = sqlMustGetResult(conn, query);
+ row = sqlNextRow(sr);
+ if ((row != NULL) && strlen(row[0]) >= 1)
+ {
+ char *phenoString = replaceChars(row[0], "|", "\n");
+ printf("Phenotypes:\n\n", phenoString);
+ // freeMem(phenoString);
+ }
+ if ((row != NULL) && strlen(row[1]) >= 1)
+ {
+ printf("Mean Ratio: %s\n
\n", row[1]);
+ }
+ if ((row != NULL) && strlen(row[2]) >= 1)
+ {
+ printf("Inheritance: %s\n
\n", row[2]);
+ }
+ if ((row != NULL) && strlen(row[3]) >= 1)
+ {
+ printf("Pathogenicity: %s\n
\n", row[3]);
+ }
+ if ((row != NULL) && strlen(row[3]) >= 1)
+ {
+ printf("Contribution: %s\n
\n", row[4]);
+ }
+ sqlFreeResult(&sr);
+ }
+else
+ {
sqlSafef(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) && strlen(row[0]) >= 1)
{
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/patient/", itemName);
printf("DECIPHER.
");
/* print position info */
printPosOnChrom(chrom, start, end, strand, TRUE, itemName);
/* print UCSC Genes in the reported region */
sqlSafef(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);