Their availability on CSD3 can be seen with

module avail tabix
module avail htslib

Its utility to extract data has only been realised recently

tabix 20:46120612-46120613
tabix 1:1-1000000

with earlier versions possibly giving error messages; we install the latest,

module load gcc/6
wget -qO- | \
tar -vxjf -
cd htslib-1.12/
autoreconf -i
./configure --enable-libcurl --prefix=${HPC_WORK}
make install

One could obtain a list of outcomes as follows,

Rscript -e "write.table(TwoSampleMR::available_outcomes(),file='ao.txt',quote=FALSE,row.names=FALSE,sep='\t')"


It also works with VCF files, e.g.,

tabix -p vcf TSLP.vcf.gz -h 1:100-100000

where the -h option is used to preserve the header information.

See specific section on bcftools for additional information.

bcftools query works similarly on a local VCF file nevertheless the option -r is necessary.

bcftools query -f '%ID\t%ALT\t%REF\t%AF\t[%ES]\t[%SE]\t[%LP]\t[%SS]\t%CHROM\t%POS\n' -r 1:1-1000000 \

The rather perplexing syntax (cut and paste from here in which case) gains its appeal for an output in a well-defined format.