First, the newer versions of tabix have removed the -B option (read regions from BED file) which is needed for the script to work. This means you will need this version of tabix: https://github.com/samtools/tabix, rather than the newer version from HTSlib.
Second, annotationAnalysis requires that all inputs be BGZF compressed.
There are two issues.
First, the newer versions of tabix have removed the -B option (read regions from BED file) which is needed for the script to work. This means you will need this version of tabix: https://github.com/samtools/tabix, rather than the newer version from HTSlib.
Second, annotationAnalysis requires that all inputs be BGZF compressed.
bgzip tmp1.bed bgzip tmp2.bed annotationAnalysis tmp1.bed.gz tmp2.bed.gz
should give correct results.
So, if you want to fix the first problem permanently while simultaneously having HTSlib installed on your system, you will need to do the following
sudo mkdir /opt/tabix-0.2.5 sudo chmod a+rw /opt/tabix-0.2.5 git clone https://github.com/samtools/tabix /opt/tabix-0.2.5 cd /opt/tabix-0.2.5 make
export PATH="/opt/tabix-0.2.5:$PATH"