Question: correlations between principal components and known variables
0
gravatar for Fawzi Yassine
7 months ago by
Fawzi Yassine10 wrote:

Hi, How can we find if there are correlations between principal components and known variables, especially variables that are not the phenotype of interest ageGroup. By the way, do you know what intgroup argument in `DEseq2::plotPCA()' used for? regards,

rna-seq deseq2 next-gen • 248 views
ADD COMMENTlink modified 7 months ago by kristoffer.vittingseerup3.2k • written 7 months ago by Fawzi Yassine10
4
gravatar for kristoffer.vittingseerup
7 months ago by
European Union
kristoffer.vittingseerup3.2k wrote:

The PCAtools R package have implemented several ways of doing and visualizing such analysis.

ADD COMMENTlink modified 7 months ago • written 7 months ago by kristoffer.vittingseerup3.2k
2
gravatar for egeulgen
7 months ago by
egeulgen980
Istanbul
egeulgen980 wrote:

Assuming you are using princomp(), the PC scores are stored in pca_res$scores so you can use these (e.g. pca_res$scores[, 1] for PC1) and investigate any correlation (simple correlation may not do the trick though, see the answer here: https://stats.stackexchange.com/questions/115032).

If you're using plotPCA() for the PCA data (that would be pca_res <- plotPCA(obj, returnData = TRUE), a similar approach should work since this returns the PC1 and PC2 scores as well.

?DEseq2::plotPCA says "intgroup: interesting groups: a character vector of names in colData(x) to use for grouping". This serves to label the samples in the PCA plot by group (default value is "condition"). If there exists a column in colData(obj) named "my_group" consisting of the values "G1", "G2" and "G3", setting intgroup = "my_group" will result in labeling the samples into these 3 groups:

Example plotPCA with user-provided intgroup

ADD COMMENTlink written 7 months ago by egeulgen980
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 900 users visited in the last hour