Nested design- phyloseq_to_deseq
1
0
Entering edit mode
mpuli011 • 0
@mpuli011-23216
Last seen 2.4 years ago

Hello,

I have a quick question. I have used Deseq before but I did not need to run a time-series on my data before and so I am a little stumped. For my data, I have sampled over time, from the same subplots which are nested within a plot for an entire year. So my data looks as follows: with 9 sites (3 unburned controls and 6 burned), each plot has 4 subplots embedded within them.

![Sample Data[1] [1]: https://ibb.co/m9dT7X9

I have run the following code and it works, but when I enter the site, which is where the samples are imbedded I get an error stating Error in checkFullRank(modelMatrix). Please see code below.

I have looked online and though this site and I am honestly not sure how to proceed.

  1. I was originally following this tutorial from Deseq under time series, but again I am stumped at the nested part.
  2. I want to contrast for treatment between the different time points,so any help or guidance is really appreciated.

This is the code I have as of right now dds<-phyloseqtodeseq2(physeq, design = ~ Treatment + TimePoint) gmmean = function(x, na.rm=TRUE){ exp(sum(log(x[x > 0]), na.rm=na.rm) / length(x)) } geoMeans<-apply(counts(dds), 1, gmmean) dds<-estimateSizeFactors(dds, geoMeans = geoMeans) dds<-DESeq(dds, test= "LRT", fitType="local", reduced = ~ Treatment)

#Look at results res<- results(dds, contrast = list(c("T1",c("T2" ,"T3","T4","T5","T6","T7","T8","T9")) res<- res[order(res$padj, na.last=NA), ] alpha<-0.01 signif<-res[(res$padj < alpha), ] sigif<-cbind(as(sigtab, "data.frame"), as(tax_table(dds)[rownames(sigtab), ], "matrix")) signif

This code works but when I add Site as a variable I can no longer run the code: and instead, I get the following error: dds<-phyloseqtodeseq2(physeq, design = ~ Treatment + TimePoint+ Site )

I've tried this but not sure if this is right and or how to to get Deseq to understand it. 1. Create a nested column nested column and (link here) 2. Is this the proper way of doing it how do I add it and have the Deseq function read it.

Please help, I have spent all day on this and have no idea how to proceed.

deseq2 Phyloseq Nested • 408 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 21 hours ago
United States

If site is confounded with your treatments, then you can’t control for it with simple regression terms. Aside from reading over the section of vignette that discusses this issue, you may want to discuss statistical analysis plans with a statistician at your institute.

ADD COMMENT
0
Entering edit mode

I know how to add it in a normal regression, is it added in the same manner in Deseq?

ADD REPLY
0
Entering edit mode

DESeq2 is simply based on linear models. You are getting the same model you would get with lm. They both use model.matrix to generate X.

ADD REPLY

Login before adding your answer.

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