e2863d01dfb07e37992f4130c8cccb699370a398
chmalee
  Thu Nov 12 09:46:29 2020 -0800
Fix boneheaded startsWith() mistake in vcfToBed

diff --git src/hg/utils/vcfToBed/vcfToBed.c src/hg/utils/vcfToBed/vcfToBed.c
index d1eeab3..94627a8 100644
--- src/hg/utils/vcfToBed/vcfToBed.c
+++ src/hg/utils/vcfToBed/vcfToBed.c
@@ -46,34 +46,34 @@
     char *tag = tempKeepFields[i];
     struct vcfInfoDef *def = NULL;
     if ( (def = vcfInfoDefForKey(vcff, tag)) == NULL)
         verbose(2, "Warning: skipping desired tag '%s', does not exist in INFO fields.\n", tag);
     else
         {
         keepFields[keepIx++] = cloneString(tag);
         }
     }
 return keepIx;
 }
 
 char *fixupChromName(char *chrom)
 /* Prepend "chr" if missing */
 {
-if (!startsWith(chrom, "chr"))
-    return catTwoStrings("chr", chrom);
-else
+if (startsWith("chr", chrom))
     return chrom;
+else
+    return catTwoStrings("chr", chrom);
 }
 
 #define VCF_MAX_INFO (4*1024)
 
 void fixupLeftPadding(int *start, char *ref, char *alt)
 /* If an indel is left padded fix up the start position */
 {
 char *altTmp = cloneString(alt);
 char *alleles[VCF_MAX_INFO+1];
 alleles[0] = cloneString(ref);
 char *altAlleles[VCF_MAX_INFO];
 int altCount = chopCommas(altTmp, altAlleles);
 int alleleCount = 1 + altCount;
 if (alleleCount > 1)
     {