Question: DESeq2: collapseReplicates error
0
gravatar for ta_awwad
3.2 years ago by
ta_awwad10
Frankfurt am Main
ta_awwad10 wrote:

Hi,

I am using DESeq2 to find Differentially expressed genes. I am using the following code:

conds<-c("kd1","kd1","kd2","kd2","GFP","GFP")
Design<-data.frame(condition=conds,row.names=paste(conds,rep(c(1,2),3),sep="_"))​

dds <- DESeqDataSetFromMatrix(countData = assay(se),
                             colData = Design,
                             design = ~ condition)​
ddsCollapsed <- collapseReplicates( dds, groupby = dds$condition)
ddsCollapsed <- DESeq(ddsCollapsed, betaPrior=FALSE)

after running the last line, I get the following:

using pre-existing size factors
estimating dispersions
found already estimated dispersions, replacing these
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
Warning message:
In checkForExperimentalReplicates(object, modelMatrix) :
 
same number of samples and coefficients to fit,
  estimating dispersion by treating samples as replicates.
  read the ?DESeq section on 'Experiments without replicates'

I don't know what is the problem actually..

could anybody help

Best,

Tamer

ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by ta_awwad10

Hi Michael,

Hi, I ran the following script on R version 3.2 and everything was fine:

conds<- c("kd1","kd1","kd2","kd2","GFP","GFP")
Design<-data.frame(condition=conds,
                   row.names=paste(conds,rep(c(1,2),3),
                   sep="_"))
dds <- DESeqDataSetFromMatrix(countData = assay(se),
                             colData = Design,
                             design = ~ condition)

however, when I updated R into 3.3 I start getting the following error message:

Error in FUN(X[[i]], ...) :
  assay colnames() must be NULL or equal colData rownames()

I tried to follow many solutions but non of them worked .

can you help?!

thanks much

ADD REPLYlink modified 3.2 years ago • written 3.2 years ago by ta_awwad10

This says that the column names of the countData are not the same as the rownames of colData.

You should check these yourself to make sure they are in the correct order first. You will see that they are not the same descriptors (or else you wouldn't have gotten this error).

Then to remove the error you can either set one or the other, or remove column names from the countData altogether:

colnames(countData) <- ...

or

rownames(colData) <- ...

or 

colnames(countData) <- NULL
ADD REPLYlink written 3.2 years ago by Michael Love26k

I tried all these but till have the error .. as you see I am new in Bioconductor which makes me frustrated .. the script was fine and now after updating R I am getting this error ,,, anyway, thank you for your help

ADD REPLYlink written 3.2 years ago by ta_awwad10

i solved the problem .. thanks much for your help

ADD REPLYlink written 3.2 years ago by ta_awwad10

just one more question, now I have two tables each contain sigGenes for each kd over GFP .. I would like to cluster (using pheatmap) the count matrices of  reskd1SigGenes and reskd2SigGenes together in one plot.

can you guide me through

thanks a million

ADD REPLYlink written 3.2 years ago by ta_awwad10

"can you guide me through"

No. This is in the DESeq2 vignette and our workflow. You need to take time to read the documentation. You will see that asking others what to do at every step is actually a waste of your own time, and that you can accomplish much more if you read documentation and find answers on your own.

ADD REPLYlink written 3.2 years ago by Michael Love26k

in your recent vignette (published on Sept 3rd), it is not clear at all if one can plot heat map using two different count matrices. I do see that it is easy to do it for single counting matrix.. that why I am asking .. I read all the documentations related to DESeq2..

 

thanks much for your time

 

ADD REPLYlink written 3.2 years ago by ta_awwad10
Answer: DESeq2: collapseReplicates error
0
gravatar for Michael Love
3.2 years ago by
Michael Love26k
United States
Michael Love26k wrote:

That's not an error, it's a message. Have you read the section in the help page for DESeq()?

You can access it by typing on the command line:

> ?DESeq
ADD COMMENTlink written 3.2 years ago by Michael Love26k

I think it is a problem because when I checked the result saummary i got the following:

res <- results(ddsCollapsed)
summary(res)

out of 12388 with nonzero total read count
adjusted p-value < 0.1
LFC > 0 (up)     : 0, 0% 
LFC < 0 (down)   : 0, 0% 
outliers [1]     : 0, 0% 
low counts [2]   : 0, 0% 
(mean count < 0)
[1] see 'cooksCutoff' argument of ?results
[2] see 'independentFiltering' argument of ?results

what do you reccommend?

Thanks

ADD REPLYlink written 3.2 years ago by ta_awwad10

You need to first read the help page. This is specifically addressed in the help page that is mentioned in the message in your original post.

ADD REPLYlink written 3.2 years ago by Michael Love26k

Also, are you collapsing technical replicates? Or are they biological replicates? You never want to collapse biological replicates (when samples originate from different biological units). The collapsing is only recommended when you have multiple sequencing runs of the same library, i.e. technical replicates.

ADD REPLYlink written 3.2 years ago by Michael Love26k

ooh. I would like to collapse biological replicates? is it possible? if yes, how?

ADD REPLYlink written 3.2 years ago by ta_awwad10

You should not collapse biological replicates. You need to include these so that the software can estimate variability within condition. 

Just remove the collapseReplicates() line from your code and then run DESeq() after building the dds. 

But please, please take the time to read the help pages, in particular the main functions ?DESeq and ?results, and I'd also recommend you read the DESeq2 paper so you know what is going on in the software you are using.

ADD REPLYlink written 3.2 years ago by Michael Love26k
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: 213 users visited in the last hour