src/hg/overlapSelect/coordCols.h 1.3
1.3 2010/01/30 01:14:00 markd
allow specifying location of name when specifying column indices so that -statsOutput is useful
Index: src/hg/overlapSelect/coordCols.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/overlapSelect/coordCols.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 4 -r1.2 -r1.3
--- src/hg/overlapSelect/coordCols.h 24 Jul 2006 19:36:08 -0000 1.2
+++ src/hg/overlapSelect/coordCols.h 30 Jan 2010 01:14:00 -0000 1.3
@@ -9,8 +9,9 @@
int chromCol;
int startCol;
int endCol;
int strandCol; /* -1 if unspecified */
+ int nameCol; /* -1 if unspecified */
int minNumCols; /* min number of cols */
};
struct coordColVals
@@ -19,20 +20,28 @@
char *chrom;
int start;
int end;
char strand;
+ char *name; // dynamic
};
struct coordCols coordColsParseSpec(char *optName, char* optValue);
/* parse coordinate specified in an option. Can be in the form
* - chromCol - chrom in this column followed by start and end.
- * - chromCol,startCol,endCol - chrom, start, and end in specified
- * columns.
- * - chromCol,startCol,endCol,strandCol - chrom, start,, end, and
- * strand in specified columns.
+ * - chromCol,startCol,endCol,strandCol,name - chrom, start, end, and
+ * strand in specified columns. With unneeded columns empty or dropped
+ * from the end.
*/
struct coordColVals coordColParseRow(struct coordCols* cols,
struct rowReader *rr);
-/* parse coords from a row */
+/* parse coords from a row, call coordColsRelease when done with result */
+
+
+INLINE void coordColsValsRelease(struct coordColVals *colVals)
+/* free any dynamic memory in colVals. ColVals is automatic, so is not
+ * freed */
+{
+freez(&colVals->name);
+}
#endif