Hi Daryl,
I have been giving this some thought and wonder if perhaps it would be better to simply filter out lines (or lines with specific columns) having the "missing" value with things like "grep -vw "\."" or awk '$3 != "."', where the former excludes lines where any column on the line has solely the missing character, and the latter only allows lines where, for example, the 3rd column is not the missing character.
So, you'd do something like:
> cat foo.txt | grep -vw "." | bedtools groupby -g 1,2,3 -c 4 -o sum
Would that satisfy your needs? If so, I'd be inclined to use this instead so as to not overly complicate groupby.
Thanks,
Aaron