3ec039397b40eaa784d02994512b9bc5d69ae1c8 braney Sun Jun 11 15:50:34 2017 -0700 ongoing work on hgComposite diff --git src/hg/hgComposite/hgComposite.c src/hg/hgComposite/hgComposite.c index 32658c4..494f981 100644 --- src/hg/hgComposite/hgComposite.c +++ src/hg/hgComposite/hgComposite.c @@ -24,67 +24,96 @@ #include "memalloc.h" #include "textOut.h" #include "trackHub.h" #include "hubConnect.h" #include "twoBit.h" #include "gpFx.h" #include "bigGenePred.h" #include "udc.h" #include "knetUdc.h" #include "cartTrackDb.h" #include "trashDir.h" #include "customComposite.h" #define hgCompEditPrefix "hgCompositeEdit_" #define hgsAddTrack hgCompEditPrefix "addTrack" +#define hgsAddMathTrack hgCompEditPrefix "addMathTrack" +#define hgsDeleteMathTrack hgCompEditPrefix "deleteMathTrack" +#define hgsDeleteTrack hgCompEditPrefix "deleteTrack" #define hgsAddVisTrack hgCompEditPrefix "addVisTrack" #define hgsChangeGroup hgCompEditPrefix "changeGroup" #define hgsCurrentGroup hgCompEditPrefix "currentGroup" #define hgsCurrentComposite hgCompEditPrefix "currentComposite" +#define hgsMakeMathTrack hgCompEditPrefix "makeMathTrack" +#define hgsCurrentMathTrack hgCompEditPrefix "currentMathTrack" #define hgsNewCompositeName hgCompEditPrefix "newCompositeName" +#define hgsNewMathTrackShortLabel hgCompEditPrefix "newMathTrackShortLabel" +#define hgsNewMathTrackLongLabel hgCompEditPrefix "newMathTrackLongLabel" #define hgsNewCompositeShortLabel hgCompEditPrefix "newCompositeShortLabel" #define hgsNewCompositeLongLabel hgCompEditPrefix "newCompositeLongLabel" //#define hgCompositePrefix "hgComposite_" #define hgDoNewComposite hgCompEditPrefix "doNewComposite" struct track { struct track *next; char *name; char *shortLabel; char *longLabel; +void *reserved; }; struct composite { struct composite *next; char *name; char *shortLabel; char *longLabel; struct track *trackList; }; +struct mathTrack +{ +struct mathTrack *next; +char *name; +char *shortLabel; +char *longLabel; +struct track *trackList; +}; + /* 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. */ struct grp *fullGroupList = NULL; /* List of all groups. */ // Null terminated list of CGI Variables we don't want to save permanently: -char *excludeVars[] = {"Submit", "submit", "hgva_startQuery", hgsAddTrack, hgsNewCompositeName, hgsNewCompositeShortLabel, hgsNewCompositeLongLabel, hgsChangeGroup, hgsAddVisTrack, NULL}; +char *excludeVars[] = {"Submit", "submit", "hgva_startQuery", hgsAddTrack, hgsNewCompositeName, hgsNewCompositeShortLabel, hgsNewCompositeLongLabel, hgsNewMathTrackShortLabel, hgsNewMathTrackLongLabel, hgsChangeGroup, hgsAddVisTrack, hgsAddMathTrack, hgsDeleteMathTrack, "createNewComposite", "deleteComposite", "makeMathWig", NULL}; + +static struct trackDb *findTrack(char *name, struct trackDb *fullTrackList) +{ +struct trackDb *tdb; +for (tdb = fullTrackList; tdb != NULL; tdb = tdb->next) + { + if (sameString(name, tdb->track)) + return tdb; + } +errAbort("cannot find track"); +return NULL; +} void nbSpaces(int count) /* Print some non-breaking spaces. */ { int i; for (i=0; i\n" "div.sectionLite { border-width: 1px; border-color: #"HG_COL_BORDER"; border-style: solid;" " background-color: #FFFFFF; padding-left: 10px; padding-right: 10px; " @@ -144,31 +173,31 @@ /* Return javascript executed when they change database. */ { struct dyString *dy = onChangeStart(); jsDropDownCarryOver(dy, "clade"); jsDropDownCarryOver(dy, "db"); 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("