DESeq2: multiple conditions design -- How to select subset comparisons from the DESeq object for PCA, ...
2
0
Entering edit mode
@martinhoelzer-8847
Last seen 8.0 years ago
Germany

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 • 16k views
ADD COMMENT
10
Entering edit mode
@mikelove
Last seen 21 hours ago
United States

Sure:

rld.sub <- rld[ , rld$condition %in% c("treated_A", "untreated_A") ]
​plotPCA(rld.sub, "condition")
ADD COMMENT
0
Entering edit mode

in rld.sub object, how do we remove the genes with no values in it from DESeqTransform object?

ADD REPLY
0
Entering edit mode

I don't know what you mean by "with no values in it"

ADD REPLY
0
Entering edit mode

I am currently interested in working on a subset of DESeq2 object, so the above commands used to plot PCA, but I am interested in making Volcano plot on this subset. Can we subset e.g., dds (DESeqDataSet)?

ADD REPLY
0
Entering edit mode

Yes you can subset a dataset with row indexing dds[idx,] for a logical, character, or numeric vector idx.

ADD REPLY
0
Entering edit mode
@ruy204github-12257
Last seen 7.1 years ago
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 COMMENT
1
Entering edit mode

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

dds$condition
ADD REPLY

Login before adding your answer.

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