hbctraining / scRNA-seq_online

https://hbctraining.github.io/scRNA-seq_online/.
493 stars 175 forks source link

PCA and elbow plot #117

Open ptranvan opened 3 months ago

ptranvan commented 3 months ago

Hi,

I am having some difficulty understanding your elbow plot and how to choose the right principal component (PC) for downstream analysis as described in the following page:

https://hbctraining.github.io/scRNA-seq/lessons/elbow_plot_metric.html

On this page, you mention using the percentage of variation, but all the calculations are made using the standard deviation (stdev).

To use the percentage of variation, the calculations would be:

var_explained <- stdv^2
sum_var_explained <- sum(var_explained)
percent_var_explained <- (var_explained / sum_var_explained) * 100

This would change the results of co1 and co2.

Can you explain ?

Thank you.