This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to pruned the SNPs to be at least 100 kb apart from each other? Is there any software that can be implemented?

I want to prune pruned the SNPs to be at least 100 kb apart from each other. But I don't know how to do that, maybe there is some software can do that? just based on the distance ,not the LD and others.

snp software error

2 answers

You could use vcf2bed and closest-features for verification.

I just looked it up, but I can't find the right way. Could you explain it in more detail? Thank u very much!!!

Maybe something like this:

$ vcf2bed --sort-tmpdir=${PWD} < snps.vcf > snps.bed
$ closest-features --dist snps.bed snps.bed | awk -v FS="|" -v OFS="\t" '(($2<=-100000)||($3>=100000)){ print $1 }' > filteredSNPs.bed

I wrote https://github.com/lindenb/bcfprune

./bcfprune -d 100 test.bcf

I installed htslib by conda, and what should "HTSLIB=/path/to/htslib" be? I got error in make and I don't have sudo permission. Thank you!

git clone "https://github.com/lindenb/bcfprune"
cd bcfprune
# set the path to a compiled C htslib directory
make HTSLIB=/path/to/htslib

search somewhere under the output of which tabix. This must be a directory containing some *.so files.

Log in to answer this question.