ec51eb191d235e9f9fcd5346825aaf0815c69cf6 kent Thu Mar 21 11:27:00 2013 -0700 Renaming bedOutputN_Opt into bedOutFlexible and making it a public function. diff --git src/inc/basicBed.h src/inc/basicBed.h index 30fd522..c8c4bd8 100644 --- src/inc/basicBed.h +++ src/inc/basicBed.h @@ -158,37 +158,47 @@ /* Load bed entries from a tab-separated file that have the given chrom. * Dispose of this with bedFreeList(). */ struct bed *bedLoadNAll(char *fileName, int numFields); /* Load all bed from a tab-separated file. * Dispose of this with bedFreeList(). */ struct bed *bedLoadAll(char *fileName); /* Determines how many fields are in a bedFile and load all beds from * a tab-separated file. Dispose of this with bedFreeList(). */ void bedLoadAllReturnFieldCount(char *fileName, struct bed **retList, int *retFieldCount); /* Load bed of unknown size and return number of fields as well as list of bed items. * Ensures that all lines in bed file have same field count. */ +void bedLoadAllReturnFieldCountAndRgb(char *fileName, struct bed **retList, int *retFieldCount, + boolean *retRgb); +/* Load bed of unknown size and return number of fields as well as list of bed items. + * Ensures that all lines in bed file have same field count. Also returns whether + * column 9 is being used as RGB or not. */ + void bedOutputN(struct bed *el, int wordCount, FILE *f, char sep, char lastSep); /* Write a bed of wordCount fields. */ void bedOutputNitemRgb(struct bed *el, int wordCount, FILE *f, char sep, char lastSep); /* Write a bed of wordCount fields, interpret column 9 as RGB. */ +void bedOutFlexible(struct bed *el, int wordCount, FILE *f, + char sep, char lastSep, boolean useItemRgb); +/* Write a bed of wordCount fields, optionally interpreting field nine as R,G,B values. */ + #define bedTabOutNitemRgb(el,wordCount, f) bedOutputNitemRgb(el,wordCount,f,'\t','\n') /* Print out bed as a line in a tab-separated file. Interpret column 9 as RGB */ #define bedTabOutN(el,wordCount, f) bedOutputN(el,wordCount,f,'\t','\n') /* Print out bed as a line in a tab-separated file. */ #define bedCommaOutN(el,wordCount, f) bedOutputN(el,wordCount,f,',',',') /* Print out bed as a comma separated list including final comma. */ int bedTotalBlockSize(struct bed *bed); /* Return total size of all blocks. */ int bedTotalThickBlockSize(struct bed *bed); /* Return total size of all thick blocks. */