VCF To FASTA
1
0
Entering edit mode
5.2 years ago
Myo Naung ▴ 10

Hi,

Do anyone know how to convert VCF files into FASTA files such as using R ?

Myo

next-gen genetic genome • 20k views
ADD COMMENT
1
Entering edit mode

Hello Myo Naung ,

what do you expect by this "conversion"? A vcf file contains information about differences compared to a given reference. What you can do is: Take your reference sequence and integrate your variants. This is called a consensus sequence. bcftools consensus is one tool that can do this (if this is what you want to do).

fin swimmer

ADD REPLY
0
Entering edit mode

Hello fin swimmer,

Thanks for the suggestions. What I would like to do is to calculate neutrality statistics like Tajima's D, and there I would like to see TD values of variant sites related to conserved regions. Not sure I can do directly from vcf.

Myo

ADD REPLY
0
Entering edit mode

Hi fin swimmer, creating consensus reference genome for a specific human population can be considered as a alternative for de novo genome assembly?

ADD REPLY
3
Entering edit mode
5.2 years ago
MatthewP ★ 1.4k

Hello, vcftools has a command vcf-consensus which can convert VCF to FASTA file if you got the reference. Command like:

cat ref.fa | vcf-consensus your_file.vcf.gz > out.fa
ADD COMMENT
1
Entering edit mode

Please do not use convert when dealing with data formats with non-equivalent information content. You cannot convert VCF to FASTA, you can combine alternate allele information from a VCF into a reference FASTA to get FASTA that incorporates a specific percentage of the ALT alleles into itself.

ADD REPLY
0
Entering edit mode

Thanks, @MattweP. I will have a look

ADD REPLY
0
Entering edit mode

I tried this command and I got: Applied 0 variants.

ADD REPLY

Login before adding your answer.

Traffic: 1790 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6