48fa5f889b1e569f319332bbba32b391969030d9
cline
  Tue Sep 27 12:32:52 2011 -0700
Adding back some changes that were previously lost ina failed effort to neatly go back, review the commits, and write a better commit message.  With that said, (1) hdb.h, hdb.c, and utrFa.c were all revised to allow utrFa to take a user-specified path to the nib files rather than looking up the path in dbDb.  This allowed me to run utrFa on the transcripts in the temporary staging directory for the new UCSC Genes build, before those transcripts were in hg19 (the temporary directory was not in dbDb, and probably shouldn't be).  (2) Copied some code from hg19.txt (thanks, Fan) to generate the keggPathway table.  The previous code missed a lot of associations: since making this change, keggPathway has grown from about 9K to 60K lines
diff --git src/hg/inc/hdb.h src/hg/inc/hdb.h
index e7bf03d..6e27196 100644
--- src/hg/inc/hdb.h
+++ src/hg/inc/hdb.h
@@ -216,62 +216,75 @@
 
 struct chromInfo *hGetChromInfo(char *db, char *chrom);
 /* Get chromInfo for named chromosome (case-insens.) from db.
  * Return NULL if no such chrom. */
 
 struct dnaSeq *hFetchSeq(char *fileName, char *seqName, int start, int end);
 /* Fetch sequence from file.  If it is a .2bit file then fetch the named sequence.
 If it is .nib then just ignore seqName. */
 
 struct dnaSeq *hFetchSeqMixed(char *fileName, char *seqName, int start, int end);
 /* Fetch mixed case sequence. */
 
 struct dnaSeq *hChromSeq(char *db, char *chrom, int start, int end);
 /* Return lower case DNA from chromosome. */
 
+struct dnaSeq *hChromSeqFromPath(char *nibPath, char *db, char *chrom, 
+				 int start, int end);
+/* Return lower case DNA from chromosome. */
+
 struct dnaSeq *hChromSeqMixed(char *db, char *chrom, int start, int end);
 /* Return mixed case (repeats in lower case) DNA from chromosome. */
 
+struct dnaSeq *hChromSeqMixedFromPath(char *nibPath, char *db, char *chrom, 
+				      int start, int end);
+/* Return mixed case (repeats in lower case) DNA from chromosome, given an
+ * input nib path. */
+
 struct dnaSeq *hSeqForBed(char *db, struct bed *bed);
 /* Get the sequence associated with a particular bed concatenated together. */
 
 boolean hChromBand(char *db, char *chrom, int pos, char retBand[HDB_MAX_BAND_STRING]);
 /* Fill in text string that says what band pos is on.
  * Return FALSE if not on any band, or table missing. */
 
 boolean hChromBandConn(struct sqlConnection *conn,
 	char *chrom, int pos, char retBand[HDB_MAX_BAND_STRING]);
 /* Fill in text string that says what band pos is on.
  * Return FALSE if not on any band, or table missing. */
 
 boolean hScaffoldPos(char *db, char *chrom, int start, int end,
                      char **retScaffold, int *retStart, int *retEnd);
 /* Return the scaffold, and start end coordinates on a scaffold, for
  * a chromosome range.  If the range extends past end of a scaffold,
  * it is truncated to the scaffold end.
  * Return FALSE if unable to convert */
 
 struct dnaSeq *hDnaFromSeq(char *db, char *seqName,
 	int start, int end, enum dnaCase dnaCase);
 /* Fetch DNA in a variety of cases.  */
 
 struct dnaSeq *hLoadChrom(char *db, char *chromName);
 /* Fetch entire chromosome into memory. */
 
 void hNibForChrom(char *db, char *chromName, char retNibName[HDB_MAX_PATH_STRING]);
 /* Get .nib file associated with chromosome. */
 
+void hNibForChromFromPath(char *nibPath, char *db, char *chromName, 
+			  char retNibName[HDB_MAX_PATH_STRING]);
+/* Get .nib file associated with chromosome, given a nib file path. */
+
 struct slName *hAllChromNames(char *db);
 /* Get list of all chromosomes in database. */
 
 char *hExtFileNameC(struct sqlConnection *conn, char *extFileTable, unsigned extFileId);
 /* Get external file name from table and ID.  Typically
  * extFile table will be 'extFile' or 'gbExtFile'
  * Abort if the id is not in the table or if the file
  * fails size check.  Please freeMem the result when you
  * are done with it. (requires conn passed in) */
 
 char *hExtFileName(char *db, char *extFileTable, unsigned extFileId);
 /* Get external file name from table and ID.  Typically
  * extFile table will be 'extFile' or 'gbExtFile'
  * Abort if the id is not in the table or if the file
  * fails size check.  Please freeMem the result when you