bc5f960c316fcd863ff01af154b8bd67a4dc041a
angie
Mon Aug 14 15:08:45 2017 -0700
hgVai: offer HGVS output options only when using RefSeq transcripts. refs #19968 note-8
diff --git src/hg/hgVai/hgVai.c src/hg/hgVai/hgVai.c
index 4784225..41a6b31 100644
--- src/hg/hgVai/hgVai.c
+++ src/hg/hgVai/hgVai.c
@@ -547,31 +547,49 @@
printf("
Select Genes
\n");
if (gotGP)
printf("The gene predictions selected here will be used ");
else
printf("Gene predictions are required in order ");
printf("to determine the effect of "
"each variant on genes, for example intronic, missense, splice site, intergenic etc.");
if (!gotGP)
printf(" Since this assembly has no gene prediction tracks, "
"the VAI can't provide functional annotations. "
"Please select a different genome. ");
printf(" \n");
if (! gotGP)
return NULL;
char *firstTrack = ((struct trackDb *)(trackRefList->val))->track;
-char *selected = cartUsualString(cart, "hgva_geneTrack", firstTrack);
+char *cartGeneTrack = cartOptionalString(cart, "hgva_geneTrack");
+if (isNotEmpty(cartGeneTrack))
+ {
+ // Make sure it's actually in trackRefList (might have been carried over from other db)
+ boolean exists = FALSE;
+ struct slRef *ref;
+ for (ref = trackRefList; ref != NULL; ref = ref->next)
+ {
+ struct trackDb *tdb = ref->val;
+ if (sameString(cartGeneTrack, tdb->track))
+ {
+ exists = TRUE;
+ break;
+ }
+ }
+ if (!exists)
+ cartGeneTrack = NULL;
+ }
+char *selected = isNotEmpty(cartGeneTrack) ? cartGeneTrack : firstTrack;
//#*** should show more info about each track... button to pop up track desc?
if (gotGP)
{
printf(" ");
}
@@ -968,54 +986,62 @@
isVisible ? "block" : "none");
cartMakeCheckBox(cart, "hgva_txStatus_refSeqStatus", FALSE);
puts("Include the "
"RefSeq status of each transcript. ");
puts("");
}
printf("
",
somethingIsVisible ? "none" : "block");
puts("No transcript status data are available for the selected gene track.");
puts("
");
puts(" ");
endCollapsibleSection();
}
-static void selectHgvsOut()
-/* Offer HGVS output choices */
+static void selectHgvsOut(char *geneTrack)
+/* Offer HGVS output choices if RefSeq Genes are selected */
{
startCollapsibleSection("hgvsOut", "HGVS variant nomenclature", TRUE);
printf("The Human Genome Variation Society (HGVS) "
"has established a "
"sequence variant nomenclature, "
"an international standard used to report variation in "
"genomic, transcript and protein sequences. \n");
+boolean refSeqSelected = sameString(geneTrack, "refGene") || startsWith("ncbiRefSeq", geneTrack);
+printf("
", refSeqSelected ? "block" : "none");
cartMakeCheckBox(cart, "hgva_hgvsG", FALSE);
printf("Include HGVS genomic (g.) terms in output \n");
cartMakeCheckBox(cart, "hgva_hgvsCN", FALSE);
printf("Include HGVS coding (c.) terms if applicable, otherwise noncoding (n.) terms, in output"
" \n");
cartMakeCheckBox(cart, "hgva_hgvsP", FALSE);
printf("Include HGVS protein (p.) terms (if applicable) in output \n");
cartMakeCheckBox(cart, "hgva_hgvsPAddParens", FALSE);
printf("When including HGVS protein (p.) terms, add parentheses around changes to emphasize "
"that they are predictions \n");
cartMakeCheckBox(cart, "hgva_hgvsBreakDelIns", FALSE);
printf("For variants that involve both a deletion and insertion, "
"including multi-nucleotide variants, "
"include the deleted sequence (e.g. show \"delAGinsTT\" instead of only \"delinsTT\")"
" \n");
+puts("
");
+printf("
",
+ refSeqSelected ? "none" : "block");
+printf("Select RefSeq Genes in the \"Select Genes\" section above "
+ "in order to make options appear.\n");
+puts("
");
puts(" ");
endCollapsibleSection();
}
boolean isHg19RegulatoryTrack(struct trackDb *tdb, void *filterData)
/* For now, just look for a couple specific tracks by tableName. */
{
//#*** NEED METADATA
return (sameString("wgEncodeRegDnaseClusteredV3", tdb->table) ||
sameString("wgEncodeRegTfbsClusteredV3", tdb->table));
}
boolean isHg38RegulatoryTrack(struct trackDb *tdb, void *filterData)
/* For now, just look for a couple specific tracks by tableName. */
{
@@ -1145,31 +1171,31 @@
struct slName *dbNsfpTables = findDbNsfpTables();
boolean gotSnp = findSnpBed4("", NULL, NULL);
struct slRef *elTrackRefList = NULL, *scoreTrackRefList = NULL;
findCons(&elTrackRefList, &scoreTrackRefList);
struct slRef *cosmicTrackRefList = findTrackRefByName("cosmic");
boolean hasTxStat = hasTxStatus();
if (dbNsfpTables == NULL && !gotSnp && elTrackRefList == NULL && scoreTrackRefList == NULL &&
cosmicTrackRefList == NULL && !hasTxStat)
return;
puts(" ");
printf("
Select More Annotations (optional)
\n");
// Make wrapper table for collapsible sections:
puts("