7fabe103beef41f9c2c14da4f23f8a964182d741 kate Tue Mar 15 19:12:22 2011 -0700 Add -composite to encodeExp. Extract modules to lib. diff --git src/hg/inc/mdb.h src/hg/inc/mdb.h index c29fcaa..017a932 100644 --- src/hg/inc/mdb.h +++ src/hg/inc/mdb.h @@ -80,30 +80,34 @@ #define mdbTabOut(el,f) mdbOutput(el,f,'\t','\n'); /* Print out mdb as a line in a tab-separated file. */ #define mdbCommaOut(el,f) mdbOutput(el,f,',',','); /* Print out mdb as a comma separated list including final comma. */ void mdbJsonOutput(struct mdb *el, FILE *f); /* Print out mdb in JSON format. */ /* -------------------------------- End autoSql Generated Code -------------------------------- */ #include "trackDb.h" #define MDB_DEFAULT_NAME "metaDb" +/* metaDb project used for production ENCODE */ +// TODO: move to ENCODE-specific mdb header file when it exists +#define ENCODE_MDB_PROJECT "wgEncode" + // The mdb holds metadata primarily for tables. // Many types of objects could be supported, though currently files are the only other type. // It is easy to imagine using the current mdb to support hierarchical trees of metadata. // For example a composite type object called "myComposte" could have metadata that is valid for // all tables that have the var=composite val=myComposte metadata defined. // // There are 2 ways to look at the metadata: By Obj: obj->[var=val] and By Var: var->[val->[obj]]. // By Obj: an object has many var/val pairs but only one val for each unique var. Querying by // object creates a single (2 level) one to many structure. // By Var: a variable has many possible values and each value may be defined for more than one object. // Therefore, querying by var results in a (3 level) one to many to many structure. struct mdbVar // The metadata var=val construct. This is contained by mdbObj { @@ -399,15 +403,21 @@ cvsNotSearchable =0, // Txt is default cvsSearchByMultiSelect =1, // Search by drop down multi-select of supplied list (NOT YET IMPLEMENTED) cvsSearchBySingleSelect =2, // Search by drop down single-select of supplied list cvsSearchByFreeText =3, // Search by free text field (NOT YET IMPLEMENTED) cvsSearchByDateRange =4, // Search by discovered date range (NOT YET IMPLEMENTED) cvsSearchByIntegerRange =5 // Search by discovered integer range (NOT YET IMPLEMENTED) }; enum mdbCvSearchable mdbCvSearchMethod(char *term); // returns whether the term is searchable // TODO: replace with mdbCvWhiteList() returning struct const char *cvLabel(char *term); // returns cv label if term found or else just term #endif /* MDB_H */ +int mdbObjIsEncode(struct mdbObj *mdb); +/* Return true if this metaDb object is for ENCODE */ + +int mdbObjInComposite(struct mdbObj *mdb, char *composite); +/* Return true if metaDb object is in specified composite. + If composite is NULL, always return true */