Extract mutations for a specific gene from a vcf file
I downloaded more than 4000+ VCF files from TCGA but I am only interested in mutations of one gene, IDH1. I am wondering what is the best way to extract the mutations of this gene from these VCF files. Desired output would be a data matrix. Is there a vcf tools can realize this?
• 5,107 views
•
link
2 answers
tabix is the best tool to extract regions of interest from vcf files
bgzip my.vcf # tabix works on block compressed data only (output my.vcf.gz)
tabix -p vcf my.vcf.gz # index vcf file
tabix my.vcf.gz chr1:1-1000000
See other options of tabix http://www.htslib.org/doc/tabix.html
• 0 views
•
link
If you know the coordinates of the gene, you could use awk or bedtools to get all mutations in a specific genomic interval.
• 0 views
•
link
Log in to answer this question.
I think you can use
bedtools intersecthere where the option-awould be a bed file for the coordinate of your interest gene and-bwould be the vcf filesIf you're working with somatic mutations, you should download MAF file of each cohort rather than vcf for each patient/sample.