2b5eb866f050d964d8964ec5a84f7b63889cc6b1 angie Mon Jun 3 14:39:36 2013 -0700 New CGI, hgVai (Variant Annotation Integrator): simple checklist-styleUI by which user can select variants that they have uploaded; gene predictions to identify which part of a gene, if any, is hit by each variant; several additional sources of annotations/predictions e.g. dbNSFP scores and conserved elements/scores; and several filters to constrain output to the variants most likely to have a functional effect. Along with the new CGI, there are various lib bugfixes and improvements, a new hg/lib/tests/ testcase, and some test file changes to accomodate data updates to both knownGene and the pg* tables in knownGene. refs #6152 diff --git src/hg/hgVai/hgVai.c src/hg/hgVai/hgVai.c new file mode 100644 index 0000000..d7d9dc7 --- /dev/null +++ src/hg/hgVai/hgVai.c @@ -0,0 +1,1105 @@ +/* hgVai - Variant Annotation Integrator. */ +#include "common.h" +#include "linefile.h" +#include "hash.h" +#include "options.h" +#include "jksql.h" +#include "htmshell.h" +#include "web.h" +#include "cheapcgi.h" +#include "cart.h" +#include "hui.h" +#include "grp.h" +#include "hCommon.h" +#include "hgFind.h" +#include "hPrint.h" +#include "jsHelper.h" +#include "memalloc.h" +#include "textOut.h" +#include "trackHub.h" +#include "hubConnect.h" +#include "udc.h" +#include "knetUdc.h" +#include "annoGratorQuery.h" +#include "annoGratorGpVar.h" +#include "annoFormatVep.h" +#include "annoStreamBigBed.h" + +#include "libifyMe.h" + +/* Global Variables */ +struct cart *cart; /* CGI and other variables */ +struct hash *oldVars = NULL; /* The cart before new cgi stuff added. */ +char *genome = NULL; /* Name of genome - mouse, human, etc. */ +char *database = NULL; /* Current genome database - hg17, mm5, etc. */ +char *regionType = NULL; /* genome, ENCODE pilot regions, or specific position range. */ +struct grp *fullGroupList = NULL; /* List of all groups. */ +struct trackDb *fullTrackList = NULL; /* List of all tracks in database. */ +static struct pipeline *compressPipeline = (struct pipeline *)NULL; + + +// Null terminated list of CGI Variables we don't want to save permanently: +char *excludeVars[] = {"Submit", "submit", NULL,}; + +#define hgvaRange "position" +#define hgvaRegionType "hgva_regionType" +#define hgvaRegionTypeEncode "encode" +#define hgvaRegionTypeGenome "genome" +#define hgvaRegionTypeRange "range" +#define hgvaPositionContainer "positionContainer" + +void addSomeCss() +/*#*** This should go in a .css file of course. */ +{ +printf("\n"); +} + + +INLINE void startCollapsibleSection(char *sectionSuffix, char *title, boolean onByDefault) +// Wrap shared args to jsBeginCollapsibleSectionFontSize +{ +jsBeginCollapsibleSectionFontSize(cart, "hgva", sectionSuffix, title, FALSE, "1.1em"); +} + +#define endCollapsibleSection jsEndCollapsibleSection + + +static struct dyString *onChangeStart() +/* Start up a javascript onChange command */ +{ +struct dyString *dy = jsOnChangeStart(); +jsTextCarryOver(dy, hgvaRegionType); +jsTextCarryOver(dy, hgvaRange); +return dy; +} + +static char *onChangeClade() +/* Return javascript executed when they change clade. */ +{ +struct dyString *dy = onChangeStart(); +jsDropDownCarryOver(dy, "clade"); +dyStringAppend(dy, " document.hiddenForm.org.value=0;"); +dyStringAppend(dy, " document.hiddenForm.db.value=0;"); +dyStringAppend(dy, " document.hiddenForm." hgvaRange ".value='';"); +return jsOnChangeEnd(&dy); +} + +static char *onChangeOrg() +/* Return javascript executed when they change organism. */ +{ +struct dyString *dy = onChangeStart(); +jsDropDownCarryOver(dy, "clade"); +jsDropDownCarryOver(dy, "org"); +dyStringAppend(dy, " document.hiddenForm.db.value=0;"); +dyStringAppend(dy, " document.hiddenForm." hgvaRange ".value='';"); +return jsOnChangeEnd(&dy); +} + +static char *onChangeDb() +/* Return javascript executed when they change database. */ +{ +struct dyString *dy = onChangeStart(); +jsDropDownCarryOver(dy, "clade"); +jsDropDownCarryOver(dy, "db"); +dyStringAppend(dy, " document.hiddenForm." hgvaRange ".value='';"); +return jsOnChangeEnd(&dy); +} + +INLINE void printOption(char *val, char *selectedVal, char *label) +/* For rolling our own select without having to build conditional arrays/lists. */ +{ +printf("