I have a VCF file with SNPs from a bacterial genome and want to find if the SNPs are located inside genes, is there some CLI-tool where you can pass a VCF file and a gff or gbk file and it returns the name of the genes?
Find gene at position from gff or gbk file
snp
Via BEDOPS:$ gff2bed < annotations.gff > annotations.bed$ vcf2bed < snps.vcf > snps.bed$ bedmap --echo --echo-map-id-uniq snps.bed annotations.bed > answer.bedThis can be reduced to a one-liner if you're using bash:$ bedmap --echo --echo-map-id-uniq <(vcf2bed < snps.vcf) <(gff2bed < annotations.gff) > answer.bed