Question: identifying the samples on plotPCA
1
gravatar for lirongrossmann
23 months 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.3k views
ADD COMMENTlink modified 23 months ago by Michael Love25k • written 23 months ago by lirongrossmann40
Answer: identifying the samples on plotPCA
5
gravatar for Michael Love
23 months ago by
Michael Love25k
United States
Michael Love25k 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 23 months ago by Michael Love25k
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: 175 users visited in the last hour