How to make PCA plot using DESeq2 for a group design
1
0
Entering edit mode
Jitendra ▴ 10
@nabiyogesh-11718
Last seen 5 days ago
United Kingdom

I am using below design for DESeq2 analysis, how I can change below PCA CODE to make PCA based on Treatment and compartment?

dds$group <- as.factor(paste(dds$Batch,dds$Compartment,dds5$Treatment,sep="."))
design(dds) <- ~ group

PCA plot code need to change? what should I put in intgroup?

rlddda<-rlogTransformation(dds,blind=TRUE, fitType='local')
PCA<-plotPCA(rlddds, intgroup = "Treatment", returnData = TRUE)
write.table(PCA, "DESeq2-pca-table-rld", row.names=TRUE, sep="\t");
pdf("DESeq2-pca-5Family-table-rld.pdf");
plotPCA(rld5Family, intgroup = "Treatment", returnData = FALSE)
dev.off();

Many thanks nabiyogesh

deseq2 • 6.6k views
ADD COMMENT
0
Entering edit mode
Kevin Blighe ★ 3.9k
@kevin
Last seen 6 days ago
Republic of Ireland

Hi, you literally just need to do:

plotPCA(rld5Family,
  intgroup = c('Treatment', 'Compartment'),
  returnData = FALSE)

That will colour the points in the bi-plot based on every possible combination of Treatment and Compartment.

You may have to change your design formula, though, as you're currently using a merged 'group' design of Batch, Compartment, and Treatment. If you do also have a batch effect in your data, you may want to remove that for downstream applications via limma::removeBatchEffect() applied to the rlog or variance-stabilised expression levels.

For more advanced analyses via PCA, try out my own Bioconductor package (with very helpful edits by Aaron), PCAtools: PCAtools: everything Principal Component Analysis.

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 800 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6