I have a phylogenetic tree.

Each branch ends have samples (s1, s2, ~ s16).

enter image description here

What I want to do is, I want to make PCA analysis plot for each sample.

First I thought each sample has each lineage (expressed in image as (1,1,1,1)~(2,2,2,2)).

So with that coordinates, I can do PCA analysis.

But on the second thought, the difference between (1,1,1,1) and (1,1,1,2) is much less than that of (1,1,1,1) and (2,1,1,1), but in the analysis, the difference between them will be same.

I am not sure if this kind of approach is suitable for making a PCA plot with a phylogenetic tree.

How can I make this work?

  • $\begingroup$ I don't understand. Do you want to somehow represent the phylogenetic information as an ordination plot instead? If that's the case you would be better off going back to your starting data from which the tree was generated, computing distances, and using those for ordination (PCoA probably, or if it's variant data you could just do PCA on that). You don't say anything about having character data for the tips. Maybe this would be clarified by understanding what you mean when you say "sample". Are you trying to replace the phylogeny, or represent something on top of the phylogeny? $\endgroup$ Commented Jul 21, 2022 at 16:46
  • $\begingroup$ What is the tree type, Phylogram or a dendrogram? Your picture suggests a dendrogram. Expressed in image as (1,1,1,1)~(2,2,2,2) ... this is a bit weird, oh I see its a valuation of the nodes. It is not clear what the value '1' represents mutation? $\endgroup$
    – M__
    Commented Jul 21, 2022 at 18:45
  • $\begingroup$ @MaximilianPress The sorting data from which the tree was generated is described here stackoverflow.com/questions/71953348/… Hope this helps... $\endgroup$
    – SG Kwon
    Commented Jul 23, 2022 at 7:35
  • $\begingroup$ @M__ (1,1,1,1) means lineage 1-1-1-1 if you understand this. I have assigned the samples with the lineage hierarchy represented as 1 or 2. $\endgroup$
    – SG Kwon
    Commented Jul 23, 2022 at 7:37

1 Answer 1


There appear two basic issues here:

  1. The PCA would represent arbitrary lineage designation not a genetic quantification.
  2. The PCA will weight the first, second ... fourth position equally, i.e. it is not hierarchical. This is very important for the analysis.

Summary The hierarchical -> unweighted PCA will cause analytical problems and should not be used, given it is ultimately arbitrary. If there was a tree specialist reviewing your work it would not be accepted.

The reason is that position one in the hierarchical cluster defines the entire data set - it cuts it in half, whilst position 4 defines a small a very small subtree. PCA will not see the hierarchy it will see position 1 as of equal worth to position 4. Therefore PCA will start associating arbitrary designated position 4 e.g. branch 2, with each other. Thus 1,1,1,2 is a long way from 2,1,1,2 but PCA will miss that it will think the shared '2' means their closer than they really are and find it of equal distance to e.g. 1,2,1,2 - which or course it isn't.

Fixing it You ask how to fix it

  1. You can go back to the original data and use that to create a PCA based on SNPs ... this has been done for other genetic data types, but cannot done reinterpreting a tree. Using this approach there will be a problem with back mutation, but its a parsimony analysis and you would simply state your assumption - ultimately the influence of back mutation concerns the genetic distance between all taxa in the analysis and if thats not big, the error will be small.
  2. Alternatively if you had a phylogram you could construct a genetic matrix and use genetic distance instead. Thats a separate question because its quite complicated.

tSNE is often used to refine a multivariate analysis and I think thats what you getting at, PCA followed by tSNE is valid. A tree isn't any regular multivariate analysis, its a tightly defined approximation within clear mathematical boundaries measuring/reconstructing evolutionary divergence. A tree specialist will see this, whilst a general multivariate stats specialist will miss it.

  • $\begingroup$ I didn't expect this accurate and kind answer. I will keep that in mind. Thank you. $\endgroup$
    – SG Kwon
    Commented Jul 26, 2022 at 1:06
  • $\begingroup$ Hi @SGKwon you are very welcome, always here to help. $\endgroup$
    – M__
    Commented Jul 26, 2022 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.