This is a test version of Biostars. For the public version, visit https://www.biostars.org.
generate FASTA/MSA from VCF file

I have been trying to generate FASTA sequences for a region using a multi-sample VCF file and a reference genome. I have 70 diploid individuals in the VCF in total, and what I finally want is to obtain 140 sequences, two for each sample. Output format like multiple sequence alignment is also great for me. Is there any script/tools can do this?

I have tried FastaAlternateReferenceMaker (from GATK) but it only gives me a consensus sequence for all the samples.

Any help will be greatly appreciated!

vcf msa fasta

extract the VCF for each sample with a loop and bcftools view -s ${SAMPLENAME} ....

Thanks for the reply. I understand that I could iteration the process with a single-sample VCF, but any suggestions for generating two FASTA sequences using VCF?

For example, the VCF:

chr1: 2 A  T 1/0 SNP1
chr1: 5 T  G 0/1 SNP2

The sequence for 1:1-10 in reference genome:
AAAATCCCC

What I want:
>seq1
ATAATCCCC
>seq2
AAAAGCCCC

1 answer

I've been using ENSEMBL's variant effect predictor (VEP) to generate protein fastas using RNA and exome data. It will give a sequence for every variant in the VCF and categorizes them nicely. Really wonderful tool overall.

I haven't looked into it, but I imagine it could give you the nucleotide fasta (?) if it's able to generate the protein fasta so easily. Could be worth a look.

Thank you so much! I would definitely give it a try!

@Ared445 I am new to using these tools and do not have much expertise. Can you please help me understand how did you use VEP to generate the protein fastas? I could find that they only output vcf and txt files. Is there any specific option that you used?

Log in to answer this question.