c6e82cfec526eeec7abb93e0610e303406d03820
hiram
  Wed Mar 25 14:53:49 2026 -0700
allow hgGcPercent to read a 2bit file from a URL and add unit tests as suggested by claude refs #35958

diff --git src/hg/makeDb/hgGcPercent/hgGcPercent.c src/hg/makeDb/hgGcPercent/hgGcPercent.c
index 4e19a52d684..c7977202d07 100644
--- src/hg/makeDb/hgGcPercent/hgGcPercent.c
+++ src/hg/makeDb/hgGcPercent/hgGcPercent.c
@@ -329,31 +329,31 @@
     
     while (lineFileRow(lf, row))
 	{
 	if (startsWith(row[0],"#"))
 	    continue;
 	bed = bedLoad3(row);
 	slAddHead(&bedRegionList, bed);
 	}
     lineFileClose(&lf);
     slReverse(&bedRegionList);
     }
 if (twoBitIsFile(nibDir))
     safef(twoBitFile, sizeof(twoBitFile), "%s", nibDir);
 else
     safef(twoBitFile, sizeof(twoBitFile), "%s/%s.2bit", nibDir, database);
-if (fileExists(twoBitFile))
+if (twoBitIsFile(twoBitFile))
     {
     verbose(1, "#\tUsing twoBit: %s\n", twoBitFile);
     makeGcTabFromTwoBit(twoBitFile, tabFile, bedRegionList);
     }  
 else
     {
     struct fileInfo *nibList, *nibEl;
     boolean gotNib = FALSE;
     nibList = listDirX(nibDir, "*.nib", TRUE);
     for (nibEl = nibList; nibEl != NULL; nibEl = nibEl->next)
         {
 	char dir[PATH_LEN], chrom[FILENAME_LEN], ext[FILEEXT_LEN];
         splitPath(nibEl->name, dir, chrom, ext);
 	if (noRandom && endsWith(chrom,"random"))
 	    continue;