identifying the samples on plotPCA
1
2
Entering edit mode
@lirongrossmann-13938
Last seen 4.1 years ago

Hi everyone,

I am using deseq2 to find DEG between two groups. I transformed the data using the variance stabilizing transformation and plotted PCA. 

I want to label the samples on the PCA plot, is there a way to do it?

Here is my code:

dds <-DESeqDataSetFromMatrix(countData = ep,colData = cp,design =~Response)

dds <- estimateSizeFactors(dds)

vsd <- varianceStabilizingTransformation(dds)

plotPCA(vsd, intgroup="Response")

Thank you!!

deseq2 plotpca PCa • 7.8k views
ADD COMMENT
10
Entering edit mode
@mikelove
Last seen 5 days ago
United States

You can just add a geom_text():

library(DESeq2)
dds <- makeExampleDESeqDataSet(n=10000)
vsd <- vst(dds)
library(ggplot2)
plotPCA(vsd) + geom_text(aes(label=name),vjust=2)
ADD COMMENT

Login before adding your answer.

Traffic: 480 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