src/hg/instinct/inc/featuresLib.h 1.15

1.15 2009/06/04 03:47:22 jsanborn
added copyright notices, removed cluster library
Index: src/hg/instinct/inc/featuresLib.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/inc/featuresLib.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -b -B -U 1000000 -r1.14 -r1.15
--- src/hg/instinct/inc/featuresLib.h	12 Jan 2009 20:47:10 -0000	1.14
+++ src/hg/instinct/inc/featuresLib.h	4 Jun 2009 03:47:22 -0000	1.15
@@ -1,132 +1,136 @@
+/********************************************************************************/
+/* Copyright 2007-2009 -- The Regents of the University of California           */
+/********************************************************************************/
+
 /* ispyFeatures.h - interfaces to plug features into feature sorter.  The must important
  * thing here is the column structure. */
 
 #ifndef ISPYFEATURES_H
 #define ISPYFEATURES_H
 
 #include "cart.h"
 #include "jksql.h"
 
 #define colOrderVar "heat.colOrder"     /* Order of columns. */
 #define colConfigPrefix "heat.col." /* Prefix for stuff set in configuration pages for feature columns */
 #define colInfoVarName "heat.do.colInfo"/* Display column info. */
 
 struct column
 /* A column in the big table. The central data structure for
  * hgNear. */
 {
     /* Data set during initialization that is guaranteed to be in each column.  */
     struct column *next;/* Next column. */
     char *name;/* Column name, not allocated here. */
     char *shortLabel;/* Column label. */
     char *longLabel;/* Column description. */
     boolean on;/* True if turned on. */
     boolean defaultOn;/* On by default? */
     float priority;/* Order displayed. */
     char *type;/* Type - encodes which methods to used etc. */
     char *itemUrl;/* printf formatted URL string for linking.
 		   * May be NULL.  Should contain one %s, which
 		   * get's filled in with whatever cellVal
 		   * returns. */
     char *itemUrlQuery;/* SQL query. Does lookup from cellVal
 			* to the desired value to use in itemUrl in
 			* place of cellVal */
     char *group;  /* Name of section feature belongs to, for subjectView */
     
     int cellSortDirection; /* Sort direction for column (1, 0, -1) */
     
     struct hash *settings;/* Settings from ra file. */
 
     /* -- Methods -- */
     boolean (*exists)(struct column *col, struct sqlConnection *conn);
     /* Return TRUE if column exists in database. */
     
     char *(*cellVal)(struct column *col, struct slName *id,
                    struct sqlConnection *conn);
     /* Get value of one cell as string.  FreeMem this when done.  Note that
      * gp->chrom may be NULL legitimately. */
 
     boolean (*cellCoded)(struct column *col, struct sqlConnection *conn);
 
     char *(*cellCodedVal)(struct column *col, struct slName *id,
                    struct sqlConnection *conn);
     /* Get value of one cell in coded form. If cell is not coded, return numeric form */
 
     struct slName *(*cellCodedVals)(struct column *col, struct sqlConnection *conn);
     /* Get codes for current column, if available */
     
     char *(*cellMinVal)(struct column *col, struct sqlConnection *conn);
     /* Get minimum value of lookup column */
     
     char *(*cellMaxVal)(struct column *col, struct sqlConnection *conn);
     /* Get maximum value of lookup column */
     
     char *(*cellAvgVal)(struct column *col, struct sqlConnection *conn);
     /* Get average value of lookup column */
 
     char *(*cellMinCutVal)(struct column *col, struct sqlConnection *conn);
     /* Get minimum cutoff value of column in database, any value smaller than this will be displayed as null */
     
     char *(*cellMaxCutVal)(struct column *col, struct sqlConnection *conn);
     /* Get maximum cutoff value of column in database, any value greater than this will be displayed as null */
 
     char *(*cellOffsetVal)(struct column *col);
     /* Get offset value of lookup column */
 
     char *(*cellColorReverseVal)(struct column *col);
     /* Get reverse of lookup column */
 
     char *(*cellColorSchemeVal)(struct column *col);
     /* Get color scheme of lookup column */
     
     void (*cellPrint)(struct column *col, struct slName *id,
                     struct sqlConnection *conn);
     /* Print one cell of this column in HTML.  Note that gp->chrom may be
      * NULL legitimately. */
 
     void (*labelPrint)(struct column *col);
     /* Print the label in the label row. */
 
     int (*tableColumns)(struct column *col);
     /* How many html columns this uses. */
     
     void (*configControls)(struct column *col, char *patDb);
     /* Print out configuration controls. */
     
     /* ---------- filtering and subgrouping related ------------ */
     struct slName *(*advFilter)(struct column *col, struct sqlConnection *conn, 
 				struct slName *inputList, char *ghName, int subset);
     /* Return list of samples that pass all advanced filter filters.*/
 
     void (*filterControls)(struct column *col, char *ghName, int subset);
     /* Print out controls for advanced filter. */
 
     /* -- Data that may be column-specific. -- */
     /* Most columns that need any extra data at all use the next few fields. */
     char *table;/* Name of associated table. */
     char *keyField;/* GeneId field in associated table. */
     char *valField;/* Value field in associated table. */
     char *filterType; /* type of filter to be applied to the column*/
 };
 
 char *configVarName(struct column *col, char *varName, char *patDb);
 /* Return variable name for configuration. */
 
 void setupColumnType(struct column *col, char *patDb);
 /* Set up methods and column-specific variables based on
  * track type. */
 
 struct column *getColumns(struct sqlConnection *conn, char *raName, char *patDb);
 /* Return list of columns for big table. */
 
 int columnCmpPriority(const void *va, const void *vb);
 /* Compare to sort columns based on priority. */
 
 void refinePriorities(struct hash *colHash, char *patDb);
 /* Consult colOrderVar if it exists to reorder priorities. */
 
 void refineVisibility(struct column *colList);
 /* Consult cart to set on/off visibility. */
 
 
 #endif /* ISPYFEATURES_H */