This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to create a phylogenetic tree from 30 VCF files

Hello,

I have 30 vcf files from 30 individuals that were created from RNA-Seq alignments on the mitochondria genome of the hard clam (Mercenaria mercenaria). I am trying to Identify SNPs and create haplogroups to look at the maternal relationship between all my individuals (30).

My questions are:

Do I merge all my vcf files together first? (bcftools merge). If so, how do I know which sample had which SNPS at which location?

Do I create haplotypes for each vcf/individual first? Then do I combine samples into one big dataset.

I have been using pegas on R, but there are so many commands I don't really know where to start.

In the end I want a phylogenetic tree that shows the relationship among my sample/indivudals from the mitochondrial SNPs. What program or package to use here? What does the structure of my data need to look like to create a tree?

I have access to R, an HPC system (but installing knew software can be a pain), and MEGA. I am also working on a Mac.

snps vcf phlyogentic haplogroups trees

1 answer

To answer some of your questions:

Do I merge all my vcf files together first? (bcftools merge). If so, how do I know which sample had which SNPS at which location?

Yes, use bcftools merge. You don't need to know anything - bcftools will take care of everything for you. Sample names from each VCF will be kept in the merged VCF. You may want to filter your merged VCF to get rid of low quality variants or ones with low MAF.

Do I create haplotypes for each vcf/individual first? Then do I combine samples into one big dataset.

I'm not sure I understand why you need the haplotypes. This is not usually part of a phylogenetic analysis, AFAIK. If you need it for something else, then this is a separate analysis.

I am not familiar with the R pegas package, however there are several ways to infer the phylogeny from a VCF. For example, the software IQ-TREE can do it - see the relevant section here and this useful tool. Another option is the SNPhylo pipeline, and there are more sophisticated ways as well.

You don't need to know anything - bcftools will take care of everything for you.

Until you run into downstream operations that are ALT allele specific and your samples' ALT alleles are not a perfect overlap.

Use vt to decompose and normalize variants before using bcftools merge.

Log in to answer this question.