b8e0d71f2c84ad4a431c467094183671d5e81c3e braney Wed Feb 10 10:59:21 2016 -0800 assume BAM index is in fileName.bai #16800 diff --git src/lib/bamFile.c src/lib/bamFile.c index 3c4dbc0..ebd3408 100644 --- src/lib/bamFile.c +++ src/lib/bamFile.c @@ -7,31 +7,34 @@ #include "portable.h" #include "bamFile.h" #ifdef USE_BAM #include "htmshell.h" #include "udc.h" #ifdef KNETFILE_HOOKS // If KNETFILE_HOOKS is used (as recommended!), then we can simply call bam_index_load // without worrying about the samtools lib creating local cache files in cgi-bin: #ifdef USE_HTS static bam_index_t *bamOpenIdx(samfile_t *sam, char *fileOrUrl) /* If fileOrUrl has a valid accompanying .bai file, parse and return the index; * otherwise return NULL. */ { -bam_index_t *idx = sam_index_load(sam, fileOrUrl); +char indexName[4096]; +// assume that index is a .bai file +safef(indexName, sizeof indexName, "%s.bai", fileOrUrl); +bam_index_t *idx = sam_index_load2(sam, fileOrUrl, indexName); return idx; } #else static bam_index_t *bamOpenIdx(char *fileOrUrl) /* If fileOrUrl has a valid accompanying .bai file, parse and return the index; * otherwise return NULL. */ { bam_index_t *idx = bam_index_load(fileOrUrl); return idx; } #endif #else// no KNETFILE_HOOKS // Oh well. The unmodified samtools lib downloads .bai files into the current // working directory, which is cgi-bin -- not good. So we need to temporarily