quinlan-lab / vcf2db

create a gemini-compatible database from a VCF
MIT License
55 stars 13 forks source link

vcf2db loads Symbol not Ensembl_gene_id into variant_impacts/gene column #48

Closed naumenko-sa closed 5 years ago

naumenko-sa commented 5 years ago

Hello @brentp !

Thanks for vcf2db tool!

I'm loading VEP-annotated vcf, i.e.

1   14464   rs546169444 A   T   72.8    PASS    AC=1;AF=0.5;AN=2;BaseQRankSum=0.674;CALLERS=gatk-haplotype,samtools,freebayes;ClippingRankSum=0;DP=4;ExcessHet=3.0103;FS=0;MLEAC=1;MLEAF=0.5;MQ=34.53;MQ0=0;MQRankSum=0.319;QD=18.2;ReadPosRankSum=-0.319;SOR=1.609;CSQ=T|non_coding_transcript_exon_variant|MODIFIER|WASH7P|ENSG00000227232|Transcript|ENST00000423562|unprocessed_pseudogene|10/10||ENST00000423562.1:n.1568T>A||1568/1669|||||rs546169444|1||-1||SNV|HGNC|38034||||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|non_coding_transcript_exon_variant|MODIFIER|WASH7P|ENSG00000227232|Transcript|ENST00000438504|unprocessed_pseudogene|12/12||ENST00000438504.2:n.1682T>A||1682/1783|||||rs546169444|1||-1||SNV|HGNC|38034|YES|||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000450305|transcribed_unprocessed_pseudogene||||||||||rs546169444|1|794|1||SNV|HGNC|37102||||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000456328|processed_transcript||||||||||rs546169444|1|55|1||SNV|HGNC|37102|YES|||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|non_coding_transcript_exon_variant|MODIFIER|WASH7P|ENSG00000227232|Transcript|ENST00000488147|unprocessed_pseudogene|11/11||ENST00000488147.1:n.1291T>A||1291/1351|||||rs546169444|1||-1||SNV|HGNC|38034||||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000515242|transcribed_unprocessed_pseudogene||||||||||rs546169444|1|52|1||SNV|HGNC|37102||||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000518655|transcribed_unprocessed_pseudogene||||||||||rs546169444|1|55|1||SNV|HGNC|37102||||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|non_coding_transcript_exon_variant|MODIFIER|WASH7P|ENSG00000227232|Transcript|ENST00000538476|unprocessed_pseudogene|13/13||ENST00000538476.1:n.1530T>A||1530/1583|||||rs546169444|1||-1||SNV|HGNC|38034||||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|non_coding_transcript_exon_variant|MODIFIER|WASH7P|ENSG00000227232|Transcript|ENST00000541675|unprocessed_pseudogene|9/9||ENST00000541675.1:n.1315T>A||1315/1416|||||rs546169444|1||-1||SNV|HGNC|38034||||||||||Ensembl|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|non_coding_transcript_exon_variant|MODIFIER|WASH7P|653635|Transcript|NR_024540.1|pseudogene|11/11||NR_024540.1:n.1667T>A||1667/1769|||||rs546169444|1||-1||SNV|EntrezGene|38034|YES|||||||||RefSeq|A|A|OK||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|downstream_gene_variant|MODIFIER|DDX11L1|100287102|Transcript|NR_046018.2|pseudogene||||||||||rs546169444|1|55|1||SNV|EntrezGene|37102|YES|||||||||RefSeq|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|downstream_gene_variant|MODIFIER|MIR6859-1|102466751|Transcript|NR_106918.1|miRNA||||||||||rs546169444|1|2905|-1||SNV|EntrezGene||YES|||||||||RefSeq|A|A|||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||,T|regulatory_region_variant|MODIFIER|||RegulatoryFeature|ENSR00000000002|open_chromatin_region||||||||||rs546169444|1||||SNV|||||||||||||||||||||0.0958|0.0144|0.1138|0.005|0.1859|0.1943||||||||||||0.1943|SAS||||||||||||||||;gnomad_ac_gs=5015;gnomad_af_gs=0.3152;af_1kg_amr=0.1138;af_1kg_eas=0.005;af_1kg_sas=0.1943;af_1kg_afr=0.0144;af_1kg_eur=0.1859;af_1kg_all=0.0958;rs_ids=rs546169444;af_1kg=0.1943;max_af=0.3152    GT:AD:DP:GQ:PL  0/1:1,3:4:22:101,0,22

VEP annotates a variant with Gene (= Ensembl stable gene id) and Symbol https://useast.ensembl.org/info/docs/tools/vep/vep_formats.html#output

It looks like vcf2db writes Symbol CSQ record into variant_impacts/gene field rather than Gene CSQ record, and in the result there is no Ensembl Gene ID in the table for a variant.

Would it be possible to load Gene CSQ record as Gene field of variant_impacts table, and Symbol CSQ record as Symbol field of variant_impacts table?

Thanks! Sergey

brentp commented 5 years ago

Hi, I'm having trouble understanding the issue. Are you saying that

  1. the gene name in the variants table is correctly using the actual gene name
  2. the gene name in the variant_impacts table is the ensembl gene name ?
naumenko-sa commented 5 years ago

No, they (variants/gene and variant_impacts/gene) both are gene symbols (WASH7P), and ensembl_gene_id (Gene in terms of VEP) is absent.

brentp commented 5 years ago

can you share a VEP-annotated 1 line VCF + header so I can debug?

naumenko-sa commented 5 years ago

Sure https://github.com/naumenko-sa/cre/blob/master/data/test.vcf

brentp commented 5 years ago

I see what you mean. So, given a Gene of ENSG00000223972 and a SYMBOL of DDX11L1 from VEP, vcf2db stores DDX11L1 as the gene and keeps no record of the ENSG.

Storing the SYMBOL into gene is intentional as that's what most people want. It's an oversight to not also store the ENSG id, and I'd be happy to accept a PR to fix this, but that's easily added either to the database with a look-up table or post-hoc after the query is done.