4727e0251c76f69905d0748adab43484166d6870 angie Fri Mar 14 16:42:14 2014 -0700 In code review, Max pointed out that it's non-standard to conditionallyinclude header files in the middle of a .c file. While looking at it, I realized that there were a lot of unnecessary #ifdef's for KNETFILE_HOOKS in general, all because there was not yet an #else implementation of knetUdcInstall, which can be a no-op if KNETFILE_HOOKS is not used. So I yanked out a lot of unnecessary old stuff, and tested basic bam and vcf track operations with a few settings: USE_SAMTABIX USE_BAM USE_TABIX KNETFILE_HOOKS 1 (these tree are all implied by USE_SAMTABIX) 0 1 0 0 0 1 0 1 0 0 1 1 USE_TABIX without KNETFILE_HOOKS doesn't work because the tabix lib wants to download .tbi files into the current working directory, cgi-bin, and we don't allow that (and shouldn't!). If we were going to support that, we could add a change-dir solution as in bamFile.c, but I don't think we need to support it now that there's samtabix. refs #6235, refs #12850 diff --git src/hg/hgc/bamClick.c src/hg/hgc/bamClick.c index 37bb181..d46bbb6 100644 --- src/hg/hgc/bamClick.c +++ src/hg/hgc/bamClick.c @@ -1,28 +1,26 @@ /* bamClick - handler for alignments in BAM format (produced by MAQ, * BWA and some other short-read alignment tools). */ #ifdef USE_BAM #include "common.h" #include "hash.h" #include "hdb.h" #include "hgBam.h" #include "hgc.h" -#if (defined USE_BAM && defined KNETFILE_HOOKS) #include "knetUdc.h" #include "udc.h" -#endif//def USE_BAM && KNETFILE_HOOKS #include "hgBam.h" struct bamTrackData { int itemStart; char *itemName; struct hash *pairHash; }; /* Maybe make this an option someday -- for now, I find it too confusing to deal with * CIGAR that is anchored to positive strand while showing rc'd sequence. I think * to do it right, we would need to reverse the CIGAR string for display. */ static boolean useStrand = FALSE; @@ -164,35 +162,33 @@ return 0; } void doBamDetails(struct trackDb *tdb, char *item) /* Show details of an alignment from a BAM file. */ { if (item == NULL) errAbort("doBamDetails: NULL item name"); int start = cartInt(cart, "o"); if (!tdb || !trackDbSetting(tdb, "bamSkipPrintQualScore")) skipQualityScore = FALSE; else skipQualityScore = TRUE; // TODO: libify tdb settings table_pairEndsByName, stripPrefix and pairSearchRange -#if (defined USE_BAM && defined KNETFILE_HOOKS) knetUdcInstall(); if (udcCacheTimeout() < 300) udcSetCacheTimeout(300); -#endif//def USE_BAM && KNETFILE_HOOKS if (sameString(item, "zoom in")) printf("Zoom in to a region with fewer items to enable 'detail page' links for individual items.
"); char varName[1024]; safef(varName, sizeof(varName), "%s_pairEndsByName", tdb->track); boolean isPaired = cartUsualBoolean(cart, varName, (trackDbSetting(tdb, "pairEndsByName") != NULL)); char position[512]; safef(position, sizeof(position), "%s:%d-%d", seqName, winStart, winEnd); struct hash *pairHash = isPaired ? hashNew(0) : NULL; struct bamTrackData btd = {start, item, pairHash}; char *fileName = trackDbSetting(tdb, "bigDataUrl"); if (fileName == NULL) {