496e6d0ac50bc1eab5f38ebaa0da717119f712d4 tdreszer Tue Nov 2 14:45:35 2010 -0700 Added raReadWithFilter to read an ra file and collect a set of related stanza. Useful for cv.ra processing to get all antibodies or all cells diff --git src/inc/ra.h src/inc/ra.h index 200c177..4e8d085 100644 --- src/inc/ra.h +++ src/inc/ra.h @@ -41,17 +41,22 @@ void raFoldIn(char *fileName, struct hash *hashOfHash); /* Read ra's in file name and fold them into hashOfHash. * This will add ra's and ra fields to whatever already * exists in the hashOfHash, overriding fields of the * 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 */ + #endif /* RA_H */