5fe6a3b2ce5a7099de38022ab8875d5651797780 tdreszer Fri Dec 16 11:41:01 2011 -0800 Just a changed name tree wide. The 'compositeLevel' paramter to closestToHome cart functions was confusing. What it means is the request is for a setting one step above the tdb passed in. It is used for view level controls where the model tdb is a subtrack. This checkin has NO functional affect. diff --git src/hg/lib/vcfUi.c src/hg/lib/vcfUi.c index 859455b..209dc7c 100644 --- src/hg/lib/vcfUi.c +++ src/hg/lib/vcfUi.c @@ -1,335 +1,335 @@ /* vcfUi - Variant Call Format user interface controls that are shared * between more than one CGI. */ #include "common.h" #include "cheapcgi.h" #include "errCatch.h" #include "hCommon.h" #include "hui.h" #include "jsHelper.h" #include "vcf.h" #include "vcfUi.h" #if (defined USE_TABIX && defined KNETFILE_HOOKS) #include "knetUdc.h" #include "udc.h" #endif//def USE_TABIX && KNETFILE_HOOKS INLINE char *nameOrDefault(char *thisName, char *defaultVal) /* If thisName is not a placeholder value, return it; otherwise return default. */ { if (isNotEmpty(thisName) && !sameString(thisName, ".")) return thisName; return defaultVal; } #define VCF_HAPLOSORT_DEFAULT_DESC "middle variant in viewing window" static void vcfCfgHaplotypeCenterHiddens(char *track, char *ctrName, char *ctrChrom, int ctrPos) /* Make hidden form inputs and button for setting the center variant for haplotype * clustering/sorting in hgTracks. */ { char cartVar[1024]; safef(cartVar, sizeof(cartVar), "%s.centerVariantChrom", track); cgiMakeHiddenVar(cartVar, ctrChrom); safef(cartVar, sizeof(cartVar), "%s.centerVariantPos", track); char ctrPosStr[16]; safef(ctrPosStr, sizeof(ctrPosStr), "%d", ctrPos); cgiMakeHiddenVar(cartVar, ctrPosStr); safef(cartVar, sizeof(cartVar), "%s.centerVariantName", track); cgiMakeHiddenVar(cartVar, ctrName); } void vcfCfgHaplotypeCenter(struct cart *cart, struct trackDb *tdb, char *track, - boolean compositeLevel, struct vcfFile *vcff, + boolean parentLevel, struct vcfFile *vcff, char *thisName, char *thisChrom, int thisPos, char *formName) /* If vcff has genotype data, show status and controls for choosing the center variant * for haplotype clustering/sorting in hgTracks. */ { if (vcff != NULL && vcff->genotypeCount > 1) { printf("
" "Haplotype sorting order: using "); - char *centerChrom = cartOptionalStringClosestToHome(cart, tdb, compositeLevel, + char *centerChrom = cartOptionalStringClosestToHome(cart, tdb, parentLevel, "centerVariantChrom"); if (isEmpty(centerChrom)) { // Unspecified in cart -- describe the default action printf(VCF_HAPLOSORT_DEFAULT_DESC " as anchor. |
"); vcfCfgHaplotypeCenterHiddens(track, thisName, thisChrom, thisPos); char label[256]; safef(label, sizeof(label), "Use %s", nameOrDefault(thisName, "this variant")); cgiMakeButton("submit", label); printf(" as anchor |
To anchor the sorting to a particular variant, " "click on the variant in the genome browser, " "and then click on the 'Use this variant' button on the next page." " |
\n", nameOrDefault(centerName, "variant"), centerChrom, centerPos+1); char label[256]; safef(label, sizeof(label), "Use %s", nameOrDefault(thisName, "this variant")); cgiMakeButton("submit", label); printf(" as anchor |
"); struct dyString *onClick = dyStringNew(0); dyStringPrintf(onClick, "updateOrMakeNamedVariable(%s, '%s.centerVariantChrom', ''); ", formName, track); dyStringPrintf(onClick, "updateOrMakeNamedVariable(%s, '%s.centerVariantName', ''); ", formName, track); dyStringPrintf(onClick, "updateOrMakeNamedVariable(%s, '%s.centerVariantPos', 0);", formName, track); dyStringPrintf(onClick, "document.%s.submit(); return false;", formName); cgiMakeButtonWithOnClick("submit", "Clear selection", NULL, onClick->string); printf(" (use " VCF_HAPLOSORT_DEFAULT_DESC ") |
", boxed ? " width='100%'" : "");
struct vcfFile *vcff = vcfHopefullyOpenHeader(cart, tdb);
if (vcff != NULL)
{
- boolean compositeLevel = isNameAtCompositeLevel(tdb, name);
+ boolean parentLevel = isNameAtParentLevel(tdb, name);
if (vcff->genotypeCount > 1)
{
puts("Haplotype sorting display"); puts("When this display mode is enabled and genotypes are phased or homozygous, " "each genotype is split into two independent haplotypes. " "These local haplotypes are clustered by similarity around a central variant. " "Haplotypes are reordered for display using the clustering tree, which is " "drawn in the left label area. " "Local haplotype blocks can often be identified using this display. "); - vcfCfgHapCluster(cart, tdb, vcff, name, compositeLevel); + vcfCfgHapCluster(cart, tdb, vcff, name, parentLevel); } puts("Filters"); - vcfCfgMinQual(cart, tdb, vcff, name, compositeLevel); - vcfCfgFilterColumn(cart, tdb, vcff, name, compositeLevel); - vcfCfgMinAlleleFreq(cart, tdb, vcff, name, compositeLevel); + vcfCfgMinQual(cart, tdb, vcff, name, parentLevel); + vcfCfgFilterColumn(cart, tdb, vcff, name, parentLevel); + vcfCfgMinAlleleFreq(cart, tdb, vcff, name, parentLevel); } else { printf("Sorry, couldn't access VCF file.\n"); } puts(" | ");
if (boxed && fileExists(hHelpFile("hgVcfTrackHelp")))
printf("VCF configuration help | "); printf("