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/hgTracks/bamTrack.c src/hg/hgTracks/bamTrack.c
index 63ee2d5..e144932 100644
--- src/hg/hgTracks/bamTrack.c
+++ src/hg/hgTracks/bamTrack.c
@@ -2,34 +2,32 @@
  * BWA and some other short-read alignment tools). */
 
 #ifdef USE_BAM
 
 #include "common.h"
 #include "hCommon.h"
 #include "hash.h"
 #include "linefile.h"
 #include "htmshell.h"
 #include "jksql.h"
 #include "hdb.h"
 #include "hgTracks.h"
 #include "cds.h"
 #include "hgBam.h"
 #include "wigCommon.h"
-#if (defined USE_BAM && defined KNETFILE_HOOKS)
 #include "knetUdc.h"
 #include "udc.h"
-#endif//def USE_BAM && KNETFILE_HOOKS
 #include "bigWarn.h"
 #include "errCatch.h"
 
 
 struct bamTrackData
     {
     struct track *tg;
     struct hash *pairHash;
     int minAliQual;
     char *colorMode;
     char *grayMode;
     char *userTag;
     int aliQualShadeMin;
     int aliQualShadeMax;
     int baseQualShadeMin;
@@ -767,33 +765,31 @@
 if (!hashLookup(settings, SHOW_DIFF_BASES_ALL_SCALES))
     hashAdd(settings, SHOW_DIFF_BASES_ALL_SCALES, cloneString("."));
 if (!hashLookup(settings, INDEL_DOUBLE_INSERT))
     hashAdd(settings, INDEL_DOUBLE_INSERT, cloneString("on"));
 if (!hashLookup(settings, INDEL_QUERY_INSERT))
     hashAdd(settings, INDEL_QUERY_INSERT, cloneString("on"));
 if (!hashLookup(settings, INDEL_POLY_A))
     hashAdd(settings, INDEL_POLY_A, cloneString("on"));
 if (!hashLookup(settings, "showDiffBasesMaxZoom"))
     hashAdd(settings, "showDiffBasesMaxZoom", cloneString(BAM_DEFAULT_SHOW_DIFF_BASES_MAX_ZOOM));
 }
 
 void bamMethods(struct track *track)
 /* Methods for BAM alignment files. */
 {
-#if (defined USE_BAM && defined KNETFILE_HOOKS)
 knetUdcInstall();
-#endif//def USE_BAM && KNETFILE_HOOKS
 
 track->canPack = TRUE;
 boolean isPaired = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE,
 			 BAM_PAIR_ENDS_BY_NAME,
 			 (trackDbSettingClosestToHome(track->tdb, BAM_PAIR_ENDS_BY_NAME) != NULL));
 char *tdbShowNames = trackDbSetting(track->tdb, BAM_SHOW_NAMES);
 boolean showNames = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE,
 						  BAM_SHOW_NAMES, SETTING_IS_ON(tdbShowNames));
 char *colorMode = cartOrTdbString(cart, track->tdb, BAM_COLOR_MODE, BAM_COLOR_MODE_DEFAULT);
 char *userTag = cartOrTdbString(cart, track->tdb, BAM_COLOR_TAG, BAM_COLOR_TAG_DEFAULT);
 if (sameString(colorMode, BAM_COLOR_MODE_TAG) && userTag != NULL)
     {
     if (! (isalpha(userTag[0]) && isalnum(userTag[1]) && userTag[2] == '\0'))
 	{
 	warn("%s: BAM tag '%s' is not valid -- must be a letter followed by a letter or number.",