I have a 1000 genomes vcf file for chromosome 14. And I want to remove variants in repetitive regions flagged by repeatMasker. I have a bed file for those repeats. I downloaded that file from UCSC. How can I eliminate/remove those sites in vcf file using repeat masker's bed file? Insights will be appreciated.
2 Answers
A couple fast alternatives:
$ bedops --chrom chr14 -n 1 <(vcf2bed < variants.vcf) <(sort-bed repeats.bed) > answer.bed
$ bedops --chrom chr14 -n 1 <(vcf2bed < variants.vcf) <(rmsk2bed < repeats.rmsk) > answer.bed
Using --chrom chr14
focuses set operations on that chromosome.
-
-
1$\begingroup$ probably better to use
bcftools view -R .bedfile
- vcftools isn't maintained any more and a fair bit slower than bcftools. $\endgroup$ May 27, 2021 at 13:47