04f51b90a6a1e3237013c7883e3e7d5ae3900a7b
jcasper
Fri Jul 22 14:45:10 2016 -0700
Minor changes following code review, refs #17723
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index c1276d6..6de4d7d 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -9858,46 +9858,49 @@
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)
+ if (row != NULL)
+ {
+ if (isNotEmpty(row[1]))
{
printf("Mean Ratio: %s\n
\n", row[1]);
}
- if ((row != NULL) && strlen(row[2]) >= 1)
+ if (isNotEmpty(row[2]))
{
printf("Inheritance: %s\n
\n", row[2]);
}
- if ((row != NULL) && strlen(row[3]) >= 1)
+ if (isNotEmpty(row[3]))
{
printf("Pathogenicity: %s\n
\n", row[3]);
}
- if ((row != NULL) && strlen(row[3]) >= 1)
+ if (isNotEmpty(row[4]))
{
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]);