e95b4385c1d7c9e464fb438be4dce684c030e19e angie Fri Oct 1 09:37:19 2010 -0700 Added -tab option to bedIntersect (chopping by spaces, printing out w/tabs caused incorrect column counts). diff --git src/hg/bedIntersect/bedIntersect.c src/hg/bedIntersect/bedIntersect.c index fb1162d..a716395 100644 --- src/hg/bedIntersect/bedIntersect.c +++ src/hg/bedIntersect/bedIntersect.c @@ -10,11 +10,13 @@ static boolean aHitAny = FALSE; static boolean bScore = FALSE; static float aCoverage = 0.00001; +static boolean strictTab = FALSE; static struct optionSpec optionSpecs[] = { {"aHitAny", OPTION_BOOLEAN}, {"bScore", OPTION_BOOLEAN}, {"aCoverage", OPTION_FLOAT}, + {"tab", OPTION_BOOLEAN}, {NULL, 0} }; @@ -30,6 +32,7 @@ " -aHitAny output all of a if any of it is hit by b\n" " -aCoverage=0.N min coverage of b to output match. Default .00001\n" " -bScore output score from b.bed (must be at least 5 field bed)\n" + " -tab chop input at tabs not spaces\n" ); } @@ -134,7 +137,7 @@ bHash = readBed5(bFile); else bHash = readBed(bFile); -while ((wordCount = lineFileChop(lf, row)) != 0) +while ((wordCount = (strictTab ? lineFileChopTab(lf, row) : lineFileChop(lf, row))) != 0) { name = row[0]; start = lineFileNeedNum(lf, row, 1); @@ -213,6 +216,7 @@ aHitAny = optionExists("aHitAny"); bScore = optionExists("bScore"); aCoverage = optionFloat("aCoverage", aCoverage); +strictTab = optionExists("tab"); if (argc != 4) usage(); bedIntersect(argv[1], argv[2], argv[3]);