plotPCA in DESeq2
1
0
Entering edit mode
yueli7 ▴ 20
@yueli7-8401
Last seen 3.4 years ago
China

Hello, I tried to use use plotPCA function to make the PCA plot.

Thank you in advance for great help!

Best,

Yue

> dds
class: DESeqDataSet 
dim: 17964 40 
metadata(1): version
assays(1): counts
rownames(17964): WASH7P LOC729737 ... KDM5D EIF1AY
rowData names(1): gene
colnames(40): Series1_NHBE_Mock_1 Series1_NHBE_Mock_2 ... Series16_A549.ACE2_SARS.CoV.2_2
Series16_A549.ACE2_SARS.CoV.2_3
colData names(2): condition sizeFactor
> rld<-rlog(dds)
rlog() may take a few minutes with 30 or more samples,
vst() is a much faster transformation
> plotPCA(rld, intgroup=c("name","condition"))
Error in (function (classes, fdef, mtable)  : 
unable to find an inherited method for function 'exprs' for signature '"DESeqTransform"'
> DESeq2::plotPCA(rld,intgroup=c("name", "condition"))
Error in .local(object, ...) : 
the argument 'intgroup' should specify columns of colData(dds)
> colData(dds)
DataFrame with 40 rows and 2 columns
                            condition          sizeFactor
                             <factor>           <numeric>
Series1_NHBE_Mock_1                  mock    1.28920481368314
Series1_NHBE_Mock_2                  mock    1.20694826376487
Series1_NHBE_Mock_3                  mock    2.00265996272934
Series2_A549_Mock_1                  mock    2.47465031893654
Series2_A549_Mock_2                  mock    1.36377412954114
...                                   ...                 ...
Series15_COVID19Lung_2                CoV  0.0725192102712004
Series15_COVID19Lung_1                CoV 0.00616544119097793
Series16_A549.ACE2_SARS.CoV.2_1       CoV   0.377593986284931
Series16_A549.ACE2_SARS.CoV.2_2       CoV   0.401579135274168
Series16_A549.ACE2_SARS.CoV.2_3       CoV   0.390889568999062
> head(rld)[,1:5]
class: DESeqTransform 
dim: 6 5 
metadata(1): version
assays(1): ''
rownames(6): WASH7P LOC729737 ... LINC00115 SAMD11
rowData names(8): gene baseMean ... dispFit rlogIntercept
colnames(5): Series1_NHBE_Mock_1 Series1_NHBE_Mock_2 Series1_NHBE_Mock_3 Series2_A549_Mock_1           Series2_A549_Mock_2
colData names(2): condition sizeFactor
> DESeq2::plotPCA(rld,intgroup=c("name", "condition"))
Error in .local(object, ...) : 
the argument 'intgroup' should specify columns of colData(dds)
software error deseq2 • 7.2k views
ADD COMMENT
3
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 9 weeks ago
Republic of Ireland

name is not part of colData(dds). Should it be? - please review your code and pipeline.

This should work:

plotPCA(rld, intgroup=c("condition"))

Kevin

ADD COMMENT
1
Entering edit mode

Just to add on to Kevin's answer, sometimes you can start the debugging on your side before posting.

The error message says that intgroup should specify columns of colData(dds). So you can look at those columns, e.g.:

head(colData(dds))

or

names(colData(dds))

And then compare with what you provided as intgroup, to see why the software is telling you that those variables are not in colData.

ADD REPLY
0
Entering edit mode

Hello Michael Love, Thank you so much for your great help and really appreciated! Best, Yue.

> DESeq2::plotPCA(rld,intgroup=c("condition"))
> head(colData(dds))
DataFrame with 6 rows and 1 column
                    condition
                     <factor>
Series1_NHBE_Mock_1      mock
Series1_NHBE_Mock_2      mock
Series1_NHBE_Mock_3      mock
Series2_A549_Mock_1      mock
Series2_A549_Mock_2      mock
Series2_A549_Mock_3      mock
> names(colData(dds))
[1] "condition"

ADD REPLY
0
Entering edit mode

Hello Kevin Blighe, Thank you so much for your quick response and great help. Really appreciated! Best, Yue

ADD REPLY

Login before adding your answer.

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