Question: DESeq2 coldata and count data subset
gravatar for lalchungnungabt17
5 weeks ago by
lalchungnungabt170 wrote:

Hi, I have DESeqDataSet object 'ddsHTSeq' which contain multiple sample types. But i want to perform differential gene expression analysis only at a subset of this data. I have subset the data and ran DESeq, but the result is not what i was expected, since i knew some genes which were among the most differentially expressed genes from microarray data. if i could get any comments or suggest where i could go wrong, it would be much appreciated. Thank you in advance.

##Extract coldata

>coldata_1 = colData(ddsHTSeq) 

## subset the coldata

>coldata = coldata_1[coldata_1$Subgroup %in% c("MB.WNT","MB.SHH","MB.Grp3","MB.Grp4"),]

## Extract and subset count data

>countdata = assay(ddsHTSeq)

>countdata = countdata[, coldata_1$Subgroup %in% c("MB.WNT","MB.SHH","MB.Grp3","MB.Grp4")]

## Make variables for design, to perform differential expression of MB.Grp4 compared to all others combined

>Subgroup = as.character(coldata$Subgroup)

>Subgroup[Subgroup !="MB.Grp4"] = "other"

>Subgroup = factor(Subgroup, levels = c("other","MB.Grp4"))

## Re-assign the coldata Subgroup

>coldata$Subgroup = Subgroup

## Create a new DESeq object

>dds = DESeqDataSetFromMatrix(countdata = countdata, coldata = coldata, design =~Subgroup)

>dds  = DESeq(dds)

>res = results(dds, alpha = 0.01)

## Check the top differentially expressed genes

>rownames(res) [1:50]
ADD COMMENTlink modified 5 weeks ago by Martin Morgan ♦♦ 23k • written 5 weeks ago by lalchungnungabt170
Answer: DESeq2 coldata and count data subset
gravatar for Michael Love
5 weeks ago by
Michael Love23k
United States
Michael Love23k wrote:

I don’t see any particular problem with your code, for an analysis where you expect one group behaves differently from other groups which can be put together for the purposes of finding consistent differences. If I were you I would make plots for the genes you expect to be DE.

ADD COMMENTlink written 5 weeks ago by Michael Love23k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 273 users visited in the last hour