Hi,
I've seen many posts in relation to my question but they all included replicates. My sample file looks like this (had to add bullet points so was readable and not inline):
- run time sample
- 1 0 1
- 2 2 2
- 3 6 3
- 4 8 4
I want to compare all of them against baseline so time 0 and then pull the results table after running DESeq2 with all the contrast 0vs2, 0vs6, and 0vs8. I get the error/warning when trying to do the design, listed below.
>samples$time <- relevel(samples$time, ref='0')
I also tried with factor to compare:
>samples$condition <- factor(rep(c('0_days','4_days','29_days', '76_days')))
I feel like the problem is here ^ because when I try to get the results for the comparison after running DESeq like below, I want when I do resultsNames(dds1)
then I just have 'Intercept' and 'time' but no option for the comparison like 'time0daysvs4_days'
>rownames(samples) <- samples$run
>colnames(txi$counts) =samples$run
>ddsTxi <- DESeqDataSetFromTximport(txi, colData = samples, design = ~ time)
This is the warning I get it:
Error in relevel.default(samples$time, ref = "0") :
'relevel' only for (unordered) factors
When I try and use factors and levels to do compare between timepoint, it doesn't let me input more than one comparison.
>dds1 <- DESeq(ddsTxi)
If I ignore the error and still run DESeq2 then when I pull the results table and try to do contrast then I get this error (also I seem to only be able to do one contrast like 0vs4 at a time)...
Error in if (!expanded & (hasIntercept | noInterceptPullCoef)) { : argument is of length zero
Any help would be appreciated!
Please post the initial error message(s) instead of just saying that you get errors.
Please post all of your code, otherwise it's very difficult to provide help.