Question: identifying the samples on plotPCA
1
gravatar for lirongrossmann
2.1 years ago by
lirongrossmann40 wrote:

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 pca plotpca • 1.6k views
ADD COMMENTlink modified 2.1 years ago by Michael Love26k • written 2.1 years ago by lirongrossmann40
Answer: identifying the samples on plotPCA
7
gravatar for Michael Love
2.1 years ago by
Michael Love26k
United States
Michael Love26k wrote:

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 COMMENTlink written 2.1 years ago by Michael Love26k
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 16.09
Traffic: 418 users visited in the last hour