Question: DESeq2: multiple conditions design -- How to select subset comparisons from the DESeq object for PCA, ...
0
gravatar for martin.hoelzer
3.0 years ago by
Germany
martin.hoelzer20 wrote:

Hello, 

I already found out how to select specific comparisons from the object resulting from the DESeq() function

dds <- DESeq(ddsHTSeq)

using the 'contrast' variable in the 'results' function like this:

deseq2.res <- results(dds, contrast=c("condition","treated_A","untreated_A"))

With this 'deseq2.res' object, I can now do my further analyses, also including MA plot, ...

But now, lets say I also want to plot a PCA only for this specific comparison between 'treated_A' and 'untreated_A' using the rld transformed values:

rld <- rlog(dds)
plotPCA(rld, intgroup=c("condition", "type"), returnData=TRUE)

Is there a way, to build from the full 'dds' object with all conditions and values a subset only including those for the comparisons 'treated_A' and 'untreated_A'? 

It would be nice, to have such an object to continue with downstream analyses like PCA, heatmaps, etc... but still have the normalization and estimations over all samples and conditions from the full 'dds' object.

Is there such a way?

Thanks!

Martin

 

 

deseq2 • 5.9k views
ADD COMMENTlink modified 2.1 years ago by ruy204github0 • written 3.0 years ago by martin.hoelzer20
Answer: DESeq2: multiple conditions design -- How to select subset comparisons from the
6
gravatar for Michael Love
3.0 years ago by
Michael Love22k
United States
Michael Love22k wrote:

Sure:

rld.sub <- rld[ , rld$condition %in% c("treated_A", "untreated_A") ]
​plotPCA(rld.sub, "condition")
ADD COMMENTlink written 3.0 years ago by Michael Love22k
Answer: DESeq2: multiple conditions design -- How to select subset comparisons from the
0
gravatar for ruy204github
2.1 years ago by
ruy204github0 wrote:
rld.sub<-rld[,rld@colData@listData$condition %in% c("treated_A","untreated_A")]

You could find the detailed rld information by str(rld) and then find the corresponding condition location for subsetting.

Hope this helps!

ADD COMMENTlink written 2.1 years ago by ruy204github0

You can access a column of the colData of a SummarizedExperiment with the $:

dds$condition
ADD REPLYlink written 2.1 years ago by Michael Love22k
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: 238 users visited in the last hour