<p>Creating a FASTA file by applying variants found in a VCF file is called "creating a consensus FASTA file". You can use <a href="https://samtools.github.io/bcftools/bcftools.html#consensus" rel="nofollow noreferrer"><code>bcftools consensus</code></a>. Unfortunately, the tools only works genome-wide (at the FASTA level), so you might need to use a different tool to extract a gene sequence from the FASTA file using the gene's co-ordinates.</p>

<p>If the VCF file is annotated with HGVS notations for the variants, there might be a way to use those notations to apply the edit to the reference gene/transcript sequence directly. I know <a href="https://hgvs.readthedocs.io/en/stable/" rel="nofollow noreferrer">the hgvs python module</a> works well with the HGVS notation, but I don't see a way to "apply" the variant to the reference sequence.</p>

CC BY-SA 4.0
2020-02-26T16:37:19.170Z
2020-02-26T16:37:19.170Z
Ram RS
<p>Is there some tool that will convert a vcf/bcf file to some gene annotation, based on the fact that I have the gene annotation of the already exsisting reference genome. Or some tool that will give me the genes based on the most probable chance.</p>

CC BY-SA 4.0
2020-02-24T18:51:59.493Z
VCF files contain information on variants. Each position in a VCF file can be attributed to a gene (if it falls within a gene), is that what you're looking for? By "gene annotation of the already existing reference genome", are you referring to a GTF/GFF file?
Ram RS
CC BY-SA 4.0
2020-02-24T19:33:07.580Z
I believe the question is about using VEP. https://www.ensembl.org/info/docs/tools/vep/index.html maybe?
Matteo Ferla
CC BY-SA 4.0
2020-02-24T20:46:43.597Z
People should really stop abusing the word "convert". Does OP wish to annotate their VCF or query a larger dataset based on some data in the VCF or do they think they can actually convert information about variants to information about genes?
Ram RS
CC BY-SA 4.0
2020-02-25T10:23:56.727Z
I already have annotate my VCF(actually bcf file) file with SnpEff. So I sort of doubt whether it was possible to convert it to information about genes. On one hand it would be logically if it could on a biological perspective, on a technical perspective however, it wouldn't be that strange it that isn't that easy.
hiddenhospitalresearch
CC BY-SA 4.0
2020-02-25T10:24:20.453Z
Yes I think I need VEP
hiddenhospitalresearch
CC BY-SA 4.0
2020-02-25T13:49:15.853Z
VEP and snpEff give you similar information, as does ANNOVAR. What is the "information about genes" that you are looking for?
Ram RS
CC BY-SA 4.0
2020-02-26T12:04:31.637Z
Like what the actual sequence is mutated and by reference
hiddenhospitalresearch
<vcf><gene>
vcf file to gene annotations and or genes
# vcf file to gene annotations and or genes

(Asked by: username_0 on 2020-02-24)

Is there some tool that will convert a vcf/bcf file to some gene annotation, based on the fact that I have the gene annotation of the already exsisting reference genome. Or some tool that will give me the genes based on the most probable chance.

**Tags:** vcf, gene
> **Comments:**
> **username_1**: VCF files contain information on variants. Each position in a VCF file can be attributed to a gene (if it falls within a gene), is that what you're looking for? By "gene annotation of the already existing reference genome", are you referring to a GTF/GFF file?  
> **username_2**: I believe the question is about using VEP. https://www.ensembl.org/info/docs/tools/vep/index.html maybe?  
> **username_1**: People should really stop abusing the word "convert". Does OP wish to annotate their VCF or query a larger dataset based on some data in the VCF or do they think they can actually convert information about variants to information about genes?  
> **username_0**: I already have annotate my VCF(actually bcf file) file with SnpEff. So I sort of doubt whether it was possible to convert it to information about genes. On one hand it would be logically if it could on a biological perspective, on a technical perspective however, it wouldn't be that strange it that isn't that easy.  
> **username_0**: Yes I think I need VEP  
> **username_1**: VEP and snpEff give you similar information, as does ANNOVAR. What is the "information about genes" that you are looking for?  
> **username_0**: Like what the actual sequence is mutated and by reference  

---

## 1 answers

### Answer by username_1 on 2020-02-26. Score: 2 | Accepted answer

Creating a FASTA file by applying variants found in a VCF file is called "creating a consensus FASTA file". You can use [`bcftools consensus`](https://samtools.github.io/bcftools/bcftools.html#consensus). Unfortunately, the tools only works genome-wide (at the FASTA level), so you might need to use a different tool to extract a gene sequence from the FASTA file using the gene's co-ordinates.

If the VCF file is annotated with HGVS notations for the variants, there might be a way to use those notations to apply the edit to the reference gene/transcript sequence directly. I know [the hgvs python module](https://hgvs.readthedocs.io/en/stable/) works well with the HGVS notation, but I don't see a way to "apply" the variant to the reference sequence.


---

