bb980c3fec4419e38c0ffe11710e3081d9e0b138
angie
  Mon Jul 8 13:56:57 2013 -0700
Partially fixing the vcf tabix region logic in annoStreamVcf.c.Still need to figure out a way to skip to the next row of VCF *after*
a minChrom region that has no elements!  refs #6152

diff --git src/lib/annoStreamVcf.c src/lib/annoStreamVcf.c
index 28856b1..a13f9e9 100644
--- src/lib/annoStreamVcf.c
+++ src/lib/annoStreamVcf.c
@@ -86,42 +86,37 @@
 uint regionEnd = sSelf->regionEnd;
 if (minChrom != NULL)
     {
     if (regionChrom == NULL)
 	{
 	regionChrom = minChrom;
 	regionStart = minEnd;
 	regionEnd = annoAssemblySeqSize(sSelf->assembly, minChrom);
 	}
     else
 	{
 	regionStart = max(regionStart, minEnd);
 	}
     }
 char **words = nextRowRaw(self);
-if (minChrom != NULL && words != NULL)
+if (regionChrom != NULL && words != NULL)
     {
-    if (self->isTabix && strcmp(words[0], minChrom) < 0)
-	{
-	uint regionEnd = sSelf->regionEnd;
-	if (sSelf->chrom == NULL)
-	    regionEnd = annoAssemblySeqSize(sSelf->assembly, minChrom);
-	lineFileSetTabixRegion(self->vcff->lf, minChrom, minEnd, regionEnd);
-	}
+    if (self->isTabix && strcmp(words[0], regionChrom) < 0)
+	lineFileSetTabixRegion(self->vcff->lf, regionChrom, regionStart, regionEnd);
     while (words != NULL &&
-	   (strcmp(words[0], minChrom) < 0 ||
-	    (sameString(words[0], minChrom) && self->record->chromEnd < minEnd)))
+	   (strcmp(words[0], regionChrom) < 0 ||
+	    (sameString(words[0], regionChrom) && self->record->chromEnd < regionEnd)))
 	words = nextRowRaw(self);
     }
 return words;
 }
 
 static char *getProperChromName(struct annoStreamVcf *self, char *vcfChrom)
 /* We tolerate chr-less chrom names in VCF and BAM ("1" for "chr1" etc); to avoid
  * confusing the rest of the system, return the chr-ful version if it exists. */
 {
 char *name = hashFindVal(self->chromNameHash, vcfChrom);
 if (name == NULL)
     {
     name = vcfChrom;
     struct twoBitFile *tbf = self->streamer.assembly->tbf;
     char buf[256];