9a49290fedc8b4f9c7a631dedcfe8ac3aa2b4cee
chinhli
Thu Oct 20 14:10:43 2011 -0700
merge conflict resolved
diff --git src/hg/lib/vcfUi.c src/hg/lib/vcfUi.c
index 171e5ae..04d9c35 100644
--- src/hg/lib/vcfUi.c
+++ src/hg/lib/vcfUi.c
@@ -182,30 +182,31 @@
printf("first base of allele (A = red, C = blue, G = green, T = magenta)
\n");
}
static void vcfCfgHapClusterHeight(struct cart *cart, struct trackDb *tdb, struct vcfFile *vcff,
char *name, boolean compositeLevel)
/* Let the user specify a height for the track. */
{
if (vcff != NULL && vcff->genotypeCount > 1)
{
printf("Haplotype sorting display height: \n");
int cartHeight = cartUsualIntClosestToHome(cart, tdb, compositeLevel,
VCF_HAP_HEIGHT_VAR, VCF_DEFAULT_HAP_HEIGHT);
char varName[1024];
safef(varName, sizeof(varName), "%s." VCF_HAP_HEIGHT_VAR, name);
cgiMakeIntVarInRange(varName, cartHeight, "Height (in pixels) of track", 5, "10", "2500");
+ puts("
");
}
}
static void vcfCfgHapCluster(struct cart *cart, struct trackDb *tdb, struct vcfFile *vcff,
char *name, boolean compositeLevel)
/* Show controls for haplotype-sorting display, which only makes sense to do when
* the VCF file describes multiple genotypes. */
{
vcfCfgHapClusterEnable(cart, tdb, name, compositeLevel);
vcfCfgHaplotypeCenter(cart, tdb, vcff, NULL, NULL, 0, "mainForm");
vcfCfgHapClusterColor(cart, tdb, name, compositeLevel);
vcfCfgHapClusterHeight(cart, tdb, vcff, name, compositeLevel);
// thicken lines?
// outline center variant?
}
@@ -248,43 +249,58 @@
for (i=0, filt=vcff->filterDefs; filt != NULL; i++, filt = filt->next)
{
values[i] = filt->key;
struct dyString *dy = dyStringNew(0);
dyStringAppend(dy, filt->key);
if (isNotEmpty(filt->description))
dyStringPrintf(dy, " (%s)", filt->description);
labels[i] = dyStringCannibalize(&dy);
}
struct slName *selectedValues = NULL;
if (cartListVarExists(cart, cartVar))
selectedValues = cartOptionalSlNameList(cart, cartVar);
cgiMakeCheckboxGroupWithVals(cartVar, labels, values, filterCount, selectedValues, 1);
}
+static void vcfCfgMinAlleleFreq(struct cart *cart, struct trackDb *tdb, struct vcfFile *vcff,
+ char *name, boolean compositeLevel)
+/* Show input for minimum allele frequency, if we can extract it from the VCF INFO column. */
+{
+printf("Minimum minor allele frequency (if INFO column includes AF or AC+AN):\n");
+double cartMinFreq = cartUsualDoubleClosestToHome(cart, tdb, compositeLevel,
+ VCF_MIN_ALLELE_FREQ_VAR, VCF_DEFAULT_MIN_ALLELE_FREQ);
+char varName[1024];
+safef(varName, sizeof(varName), "%s." VCF_MIN_ALLELE_FREQ_VAR, name);
+cgiMakeDoubleVarInRange(varName, cartMinFreq, "minor allele frequency between 0.0 and 0.5", 5,
+ "0.0", "0.5");
+puts("
");
+}
+
void vcfCfgUi(struct cart *cart, struct trackDb *tdb, char *name, char *title, boolean boxed)
/* VCF: Variant Call Format. redmine #3710 */
{
boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
printf("
", boxed ? " width='100%'" : "");
struct vcfFile *vcff = vcfHopefullyOpenHeader(cart, tdb);
if (vcff != NULL)
{
boolean compositeLevel = isNameAtCompositeLevel(tdb, name);
if (vcff->genotypeCount > 1)
vcfCfgHapCluster(cart, tdb, vcff, name, compositeLevel);
vcfCfgMinQual(cart, tdb, vcff, name, compositeLevel);
vcfCfgFilterColumn(cart, tdb, vcff, name, compositeLevel);
+ vcfCfgMinAlleleFreq(cart, tdb, vcff, name, compositeLevel);
}
else
{
printf("Sorry, couldn't access VCF file. \n"); } puts(" | ");
if (boxed && fileExists(hHelpFile("hgVcfTrackHelp")))
printf("VCF configuration help | "); printf("