fmicompbio / einprot

Proteomics analysis workflows
https://fmicompbio.github.io/einprot/
Other
7 stars 0 forks source link

PCA p value #18

Closed liorlobel closed 4 months ago

liorlobel commented 5 months ago

Hi, thanks for this amazing package and pipeline,

I have a rather basic question. How to add/calculate a p value based on adonis or anosim for the PCA analysis?

Thanks,

Lior

csoneson commented 5 months ago

Hi @liorlobel, thanks for your interest in einprot. You can extract the principal components from the returned SingleCellExperiment object, e.g. for PC1:

sce <- readRDS(<path to output SCE object from einprot>)
pc1 <- reducedDims(sce)[[1]][, "PC1"]

(or even better, replace [[1]] by [[XXX]], where XXX is the name of the reduced dimension representation you want to use).

Then you can run e.g. adonis2() or anosim() on the returned scores and a sample grouping.

If you would like to include the results in the einprot report, you would have to