My project is based in a clinical trial in which we measured in gene expression in three groups (OO, NUTS, LFD). The individuals (n = 151) are almost equally distributed and the variables to measure are at baseline and 12 months after the intervention
I am not an expert but I have read about PCA. The idea of using PCA is to observe clusters according to the upregulation or downregulation of these genes. Until now I have done PCA in just the genes, expressed in a numeric and continuous variable, and scaled.
The way I modelled the PCA is in a matrix in which I have columns (= variables = genes), categorical variable in the 1st column and in the rownames I have the individuals.
- I am not sure if I am overthinking and if I had to exchange the order of columns and rows? Putting the genes in the rows and make the individuals go to the columns? If I understand correctly, the eigenvalues are calculated across columns, and the are depcited there, so the initial approach is the one I considered correct
- Besides that, I plan to explore the contribution splitting across the categorical variable (groups) to observe if the contribution of variables change among the 3 groups. Does this make sense? I have used this approach to the contribution, has anybody used this or something different in this context?
fviz_pca_var(res.PCA, col.var = "cos2",
gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
repel = TRUE # Avoid text overlapping
)
This is my database
head(PCAcomp[, 1:8], n = 6)
group ppara ppard pparg nr1h3 nr1h2 rxra rxrb
50109018 LFD 1.9100000 0.654 1.137 0.631 -0.217 0.486 -0.020
50109019 LFD 0.0960000 -0.123 -0.027 0.282 0.547 0.101 -0.347
50109025 LFD -0.3190000 0.157 0.215 -0.131 -0.476 -0.091 0.716
50109026 NUTS 0.2755359 0.177 0.177 0.167 -0.794 -0.061 0.386
50109027 LFD -0.6283524 -0.390 -0.761 -1.076 -0.880 -0.263 0.299
50118001 OO 0.5441151 0.864 0.454 0.577 0.336 0.306 0.507