814da1fd6d9e117ec28ae41a2d560dbd957669de tdreszer Tue Nov 29 12:47:39 2011 -0800 Improved cv efficiency by only reading the cv.ra file once. diff --git src/inc/ra.h src/inc/ra.h index bbb2d4c..96d38bc 100644 --- src/inc/ra.h +++ src/inc/ra.h @@ -56,20 +56,26 @@ * same name if they exist already. */ struct hash *raReadSingle(char *fileName); /* Read in first ra record in file and return as hash. */ struct hash *raReadAll(char *fileName, char *keyField); /* Return hash that contains all ra records in file keyed * by given field, which must exist. The values of the * hash are themselves hashes. */ struct hash *raReadWithFilter(char *fileName, char *keyField,char *filterKey,char *filterValue); /* Return hash that contains all filtered ra records in file keyed by given field, which must exist. * The values of the hash are themselves hashes. The filter is a key/value pair that must exist. * Example raReadWithFilter(file,"term","type","antibody"): returns hash of hashes of every term with type=antibody */ +struct hash *raReadThreeLevels(char *fileName, char *lowKeyField, char *middleKeyField); +/* Return 3 level hash that contains all ra records in file keyed by lowKeyField, which must exist. + * and broken into sub hashes based upon middleKeyField that must exist. + * Example raReadThreeLevels("cv.ra","term","type"): + * returns hash of 'type' hashes of 'term' hashes of every stanza in cv.ra */ + struct hash *raTagVals(char *fileName, char *tag); /* Return a hash of all values of given tag seen in any stanza of ra file. */ #endif /* RA_H */