acd43c8cb2e79ad5c456c9589b1b5b0b49e4c723
angie
Tue Dec 13 09:50:04 2011 -0800
MLQ #6291 (pgSNP format): the pgSnp lib function printSeqCodDisplaywas firing off a query to knownGene without first testing whether
knownGene exists, causing error for knownGene-less databases.
Now the lib function takes genePredTable as argument and tests
existence before querying.
diff --git src/hg/hgc/vcfClick.c src/hg/hgc/vcfClick.c
index 0e7f45d..4ca7b5e 100644
--- src/hg/hgc/vcfClick.c
+++ src/hg/hgc/vcfClick.c
@@ -229,37 +229,38 @@
printf(", ");
vcfPrintDatum(stdout, el->values[k], formatTypes[j]);
}
printf("");
}
puts("");
}
hTableEnd();
jsEndCollapsibleSection();
}
static void pgSnpCodingDetail(struct vcfRecord *rec)
/* Translate rec into pgSnp (with proper chrom name) and call Belinda's
* coding effect predictor from pgSnp details. */
{
-if (hTableExists(database, "knownGene"))
+char *genePredTable = "knownGene";
+if (hTableExists(database, genePredTable))
{
struct pgSnp *pgs = pgSnpFromVcfRecord(rec);
if (!sameString(rec->chrom, seqName))
// rec->chrom might be missing "chr" prefix:
pgs->chrom = seqName;
- printSeqCodDisplay(database, pgs);
+ printSeqCodDisplay(database, pgs, genePredTable);
}
}
static void vcfRecordDetails(struct trackDb *tdb, struct vcfRecord *rec)
/* Display the contents of a single line of VCF, assumed to be from seqName
* (using seqName instead of rec->chrom because rec->chrom might lack "chr"). */
{
printf("Name: %s
\n", rec->name);
printCustomUrl(tdb, rec->name, TRUE);
static char *formName = "vcfCfgHapCenter";
printf("