bf8bc3e644840db50ab957b4f13c04b9cfa58f57
braney
  Mon Aug 19 11:47:18 2013 -0700
add vcfTabix support to hubCheck
diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c
index 06eebcb..8b567dd 100644
--- src/hg/lib/trackHub.c
+++ src/hg/lib/trackHub.c
@@ -28,30 +28,31 @@
 #include "errCatch.h"
 #include "hgBam.h"
 #include "bigWig.h"
 #include "bigBed.h"
 #include "hdb.h"
 #include "chromInfo.h"
 #include "grp.h"
 #include "twoBit.h"
 #include "dbDb.h"
 #include "net.h"
 #include "bbiFile.h"
 #include "bPlusTree.h"
 #include "hgFind.h"
 #include "hubConnect.h"
 #include "trix.h"
+#include "vcf.h"
 
 static struct hash *hubCladeHash;  // mapping of clade name to hub pointer
 static struct hash *hubAssemblyHash; // mapping of assembly name to genome struct
 static struct hash *hubOrgHash;   // mapping from organism name to hub pointer
 struct trackHub *globalAssemblyHubList; // list of trackHubs in the user's cart
 
 char *trackHubRelativeUrl(char *hubUrl, char *path)
 /* Return full path (in URL form if it's a remote hub) given
  * path possibly relative to hubUrl. Do a freeMem of result
  * when done. */
 {
 /* If path itself is a URL then just return a copy of it. */
 if (hasProtocol(path))
     return cloneString(path);
 
@@ -818,30 +819,39 @@
 	char *type = trackDbRequiredSetting(tdb, "type");
 	verbose(2, "checking %s.%s type %s at %s\n", genome->name, tdb->track, type, bigDataUrl);
 
 	if (startsWithWord("bigWig", type))
 	    {
 	    /* Just open and close to verify file exists and is correct type. */
 	    struct bbiFile *bbi = bigWigFileOpen(bigDataUrl);
 	    bbiFileClose(&bbi);
 	    }
 	else if (startsWithWord("bigBed", type))
 	    {
 	    /* Just open and close to verify file exists and is correct type. */
 	    struct bbiFile *bbi = bigBedFileOpen(bigDataUrl);
 	    bbiFileClose(&bbi);
 	    }
+	else if (startsWithWord("vcfTabix", type))
+	    {
+	    /* Just open and close to verify file exists and is correct type. */
+	    struct vcfFile *vcf = vcfFileMayOpen(bigDataUrl, 1, 1, FALSE);
+
+	    if (vcf == NULL)
+	       errAbort("%s is not a VCF file", bigDataUrl);
+	    vcfFileFree(&vcf);
+	    }
 	else if (startsWithWord("bam", type))
 	    {
 	    /* For bam files, the following call checks both main file and index. */
 	    bamFileExists(bigDataUrl);
 	    }
 	else
 	    errAbort("unrecognized type %s in genome %s track %s", type, genome->name, tdb->track);
 	freez(&bigDataUrl);
 	}
     errCatchEnd(errCatch);
     if (errCatch->gotError)
 	{
 	retVal = 1;
 	dyStringPrintf(errors, "%s", errCatch->message->string);
 	}