I would like to extract all the mutations in a single gene of interest from the VCF file. For example I would like to extract all the mutations in the NFKB1 gene from the whole genome VCF file.
2 Answers
Find the location of the gene of interest and then filter the vcf for that location using vcftools, bcftools, plink, or some other software. There is a lot of good documentation available online for these tools.
As mentioned, there are many options to go (eg. vcftools and bcftools). The Broad Institute provides a valuable toolset (GATK) for this very purpose and extended procedures for various variant selection tasks.
SelectVariants function can be good for this purpose, though the location of a gene of interest should be addressed: https://gatk.broadinstitute.org/hc/en-us/articles/13832694334235-SelectVariants
bcftools view
has an option to extract by coordinates or by annotation if your VCF had the gene annotation. If you used custom annotation tools, they may have their own filtering utilities. $\endgroup$