This question has gone through some iterations and commentary, so I've decided to just answer it, though it's more of a "homework" question. What you need to do is to look at the VCF file, the main thing you want is already in there.
Go to the VCF of interest. I chose the mtDNA because it's smaller and more convenient. You can zless
into the bgz file to see what it looks like, but if you want uncompressed you can run this (head -1000 just to be a tractable example):
gzip -dc gnomad.genomes.v3.1.sites.chrM.vcf.bgz | grep -v intergenic | head -1000 > mt.vcf
I grep -v intergenic
because one of the first things that pops up is that most of the first variants in the file are specifically annotated as intergenic_variant
, so that answers part of your question. For those variants you can just run a bedtools closest against the right GFF3 version, if you think the nearest gene will be informative.
For variants in genes, what you want is already in the VCF. See the entry for this variant:
chrM 1492 . A C . npg filters=npg;variant_colla
psed=A1492C;vep=C|non_coding_transcript_exon_variant|MODIFIER|MT-RNR1|ENSG0000021
1459|Transcript|ENST00000389680|Mt_rRNA|1/1||ENST00000389680.2:n.845A>C||845|||||
1||1|SNV||HGNC|HGNC:7470|YES||||||||1||||||||||||;base_qual_hist=0|0|0|0|0|0|0|0|
0|0;position_hist=0|0|0|0|0|0|0|0|0|0;strand_bias_hist=0|0|0|0|0|0|0|0|0|0;weak_e
vidence_hist=0|0|0|0|0|0|0|0|0|0;contamination_hist=0|0|0|0|0|0|0|0|0|0;heteropla
smy_below_min_het_threshold_hist=2|0|0|0|0|0|0|0|0|0;excluded_AC=2;AN=56432;AC_ho
m=0;AC_het=0;hl_hist=0|0|0|0|0|0|0|0|0|0;dp_mean=2976.53;mq_mean=.;tlod_mean=.;AF
_hom=0.00000;AF_het=0.00000;max_hl=0.00000;hap_AN=2680|1537|868|603|34|282|91|147
83|701|934|3144|2732|663|2977|4724|5672|126|1|1298|366|7|393|3079|6037|1234|819|5
46|12|89;hap_AC_het=0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0;hap
_AC_hom=0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0;hap_AF_hom=0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00|0.00000e+00;hap_AF_het=0.00000e+00|0.00000e+00|0.00 ...
# this is of course a very long line!!! it goes on but all the interesting stuff already happened.
You can see that this variant lies within the RNR1 rRNA gene of the mitochondrial genome (MT-RNR1
in the file). Granted it mangles it a little bit by describing a variant in a non-protein-coding gene as a non_coding_transcript_exon_variant
, but that's the kind of thing that you can work around.
Indeed, if you look at the header of the file, you can see that quite extensive annotations are included (where available):
##INFO=<ID=vep,Number=.,Type=String,Description="Consequence annotations from Ensembl VEP; note that the SINGLE_EXON flag and END_TRUNC filters have been removed from the LOFTEE annotations to avoid misinterpretation in context of the mitochondrial genome. Format: Allele|Consequence|IMPACT|SYMBOL|Gene|Feature_type|Feature|BIOTYPE|EXON|INTRON|HGVSc|HGVSp|cDNA_position|CDS_position|Protein_position|Amino_acids|Codons|ALLELE_NUM|DISTANCE|STRAND|VARIANT_CLASS|MINIMISED|SYMBOL_SOURCE|HGNC_ID|CANONICAL|TSL|APPRIS|CCDS|ENSP|SWISSPROT|TREMBL|UNIPARC|GENE_PHENO|SIFT|PolyPhen|DOMAINS|HGVS_OFFSET|MOTIF_NAME|MOTIF_POS|HIGH_INF_POS|MOTIF_SCORE_CHANGE|LoF|LoF_filter|LoF_flags|LoF_info">
In conclusion, look at your data!