15d0836b4dba65919e83ce5ef0aaafe5a0edc72f angie Wed Apr 17 12:49:53 2013 -0700 Making annoGratorGpVar able to handle VCF input too. In order for a grator tosee what type of input is coming from the primary source, the streamer should be passed in along with the primary row, as it is for formatters now. refs #6152 diff --git src/inc/annoStreamer.h src/inc/annoStreamer.h index 4536688..4151e99 100644 --- src/inc/annoStreamer.h +++ src/inc/annoStreamer.h @@ -43,30 +43,37 @@ /* Close connection to source and free self. */ // Public members -- callers are on the honor system to access these read-only. struct annoAssembly *assembly; // Genome assembly that provides coords for annotations struct asObject *asObj; // Annotation data definition char *name; // Short identifier, e.g. name of file or database table struct annoFilter *filters; // Filters to constrain output char *chrom; // Non-NULL if querying a particular region uint regionStart; // If chrom is non-NULL, region start coord uint regionEnd; // If chrom is non-NULL, region end coord boolean positionIsGenome; // True if doing a whole-genome query enum annoRowType rowType; // Type of annotations (words or wiggle data) int numCols; // For word-based annotations, number of words/columns }; +struct annoStreamRows +/* An annoStreamer and (possibly NULL) list of rows it generated. */ + { + struct annoStreamer *streamer; // annoStreamer interface for metadata about row data + struct annoRow *rowList; // row data + }; + // ---------------------- annoStreamer default methods ----------------------- struct asObject *annoStreamerGetAutoSqlObject(struct annoStreamer *self); /* Return parsed autoSql definition of this streamer's data type. */ void annoStreamerSetAutoSqlObject(struct annoStreamer *self, struct asObject *asObj); /* Use new asObj and update internal state derived from asObj. */ void annoStreamerSetRegion(struct annoStreamer *self, char *chrom, uint rStart, uint rEnd); /* Set genomic region for query; if chrom is NULL, position is genome. * Many subclasses should make their own setRegion method that calls this and * configures their data connection to change to the new position. */ struct annoFilter *annoStreamerGetFilters(struct annoStreamer *self); /* Return supported filters with current settings. Callers can modify and free when done. */ @@ -81,16 +88,23 @@ * In general, subclasses' constructors will call this first; override nextRow, close, * and probably setRegion; and then initialize their private data. */ void annoStreamerFree(struct annoStreamer **pSelf); /* Free self. This should be called at the end of subclass close methods, after * subclass-specific connections are closed and resources are freed. */ boolean annoStreamerFindBed3Columns(struct annoStreamer *self, int *retChromIx, int *retStartIx, int *retEndIx, char **retChromField, char **retStartField, char **retEndField); /* Scan autoSql for recognized column names corresponding to BED3 columns. * Set ret*Ix to list index of each column if found, or -1 if not found. * Set ret*Field to column name if found, or NULL if not found. * If all three are found, return TRUE; otherwise return FALSE. */ +// ----------------------------------------------------------------------------- + +struct annoStreamRows *annoStreamRowsNew(struct annoStreamer *streamerList); +/* Returns an array of aSR, one for each streamer in streamerList. + * Typically array is reused by overwriting elements' rowList pointers. + * Free array when done. */ + #endif//ndef ANNOSTREAMER_H