f8458ca93f0c0abe5456789dd7a9618d63e55e5b
kent
  Sun Jul 3 15:01:40 2022 -0700
Fixing bug on reverse strand and improving cache behavior.  Making it so you can ask for a cached sequence without aborting if it doesn't exist.

diff --git src/inc/cacheTwoBit.h src/inc/cacheTwoBit.h
index 706b25e..0695786 100644
--- src/inc/cacheTwoBit.h
+++ src/inc/cacheTwoBit.h
@@ -1,27 +1,35 @@
 #ifndef CACHETWOBIT_H
 #define CACHETWOBIT_H
 
 /* cacheTwoBit - system for caching open two bit files and ranges of sequences in them */
 
 
 struct cacheTwoBitRanges
 /* Cache open two bit files and sequences */
     {
     struct cacheTwoBitRanges *next;	/* Next in list of such caches if you need. */
     struct hash *urlHash;	/* Hash of cacheTwoBitUrl structs */
     struct cacheTwoBitUrl *urlList;  /* List of values in urlHash */
+    boolean doUpper;	/* If true then force all sequence to upper case. */
     };
 
-struct cacheTwoBitRanges *cacheTwoBitRangesNew();
+struct cacheTwoBitRanges *cacheTwoBitRangesNew(boolean doUpper);
 /* Create a new cache for ranges or complete sequence in two bit files */
 
 void cacheTwoBitRangesPrintStats(struct cacheTwoBitRanges *cache);
 /* print cache statistics - Debugging routine */
 
-struct dnaSeq *cacheTwoBitRangesFetch(struct cacheTwoBitRanges *cacheAll, char *url, char *seqName, 
-    int start, int end, boolean doRc, int *retOffset);
+struct dnaSeq *cacheTwoBitRangesFetch(struct cacheTwoBitRanges *cacheAll, 
+	char *url, char *seqName, int start, int end, boolean doRc, int *retOffset);
 /* Fetch a sequence from a twoBit cache. The result in retOffset is where the return dnaSeq
  * sits within the named sequence, the whole of which is stored in the subtracted 
  * associated twoBit file. Do not free the returned sequence. */
 
+struct dnaSeq *cacheTwoBitRangesMayFetch(struct cacheTwoBitRanges *cacheAll, 
+	char *url, char *seqName, int start, int end, boolean doRc, int *retOffset);
+/* Fetch a sequence from a twoBit cache. The result in retOffset is where the return dnaSeq
+ * sits within the named sequence, the whole of which is stored in the subtracted 
+ * associated twoBit file. Do not free the returned sequence. Returns NULL if sequence not
+ * found */
+
 #endif /* CACHETWOBIT_H */