identifying the samples on plotPCA
1
2
Entering edit mode
@lirongrossmann-13938
Last seen 11 months 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 • 3.7k views
ADD COMMENT
9
Entering edit mode
@mikelove
Last seen 12 hours 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: 316 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