Any fast options to query large VCF bed intervals? I'm doing some analysis and I need to subset a large VCF file (~8GB gziped) given a bed interval and identify within a subset of rsid. 

Unfortunately, both my normal choices to do this analysis (snpSift and bedtools) are taking way to long or failing due to memory issues in my local computer and a remote server.

Do you guys know any other options or suggestions to speed up this process?

Follow the commands I use:

bedtools intersect -a &lt;myvcf&gt;.vcf.gz -b &lt;myinterval&gt;.bed -wa | \
    java -Xmx10g -jar snpSift.jar filter --set &lt;myrsid&gt;.txt "ID in SET[0]"


or

gzcat &lt;myvcf&gt;.vcf.gz | \
    java -Xmx10g -jar snpSift.jar intervals &lt;mybed&gt;.bed | \
    java -Xmx10g -jar snpSift.jar filter --set &lt;myrsid&gt;.txt "ID in SET[0]"


The bedtools command usually fail due to unknown reason and SnpSift runs over 6 hours even given 10GB of ram. My local machine have 8GB of RAM, but the server have 32GB.
this:

bedtools intersect -a &lt;myvcf&gt;.vcf.gz -b &lt;myinterval&gt;.bed -wa | \
    java -Xmx10g -jar snpSift.jar filter --set &lt;myrsid&gt;.txt "ID in SET[0]"


can be replaced with one GATK SelectVariants https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_gatk_tools_walkers_variantutils_SelectVariants.php

java -jar gatk.jar -T SelectVariants -R ref.fa \
  -L myinterval.bed --keepIDs myrsid.txt -V myvcf.vcf.gz -o out.vcf


and furthermore, you can also work in parallel by splitting your bed file (e.g. by chromosomes), and merge the results.