Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 202012

How to index design formula elements in DESeq2?

$
0
0

Here is an example:

cts<-matrix(sample(1:1000, 600, replace = T), ncol=6)
rownames(cts)<-paste0("Gene", 1:100)
colnames(cts)<-paste0("sample", 1:6)

coldat<-data.frame(B=c(1,2,1,2,1,2),
                   C=c(1,1,1,2,2,2))
rownames(coldat)<-colnames(cts)

library(DESeq2)
batch="B"
condition="C"
dds <- DESeqDataSetFromMatrix(countData = cts,
                              colData = coldat,
                              design= ~ batch + condition)
dds <- DESeq(dds)
Error in DESeqDataSet(se, design = design, ignoreRank) : 
all variables in design formula must be columns in colData

My question is how to index batch="B" and condition="C" in the design formula.


Viewing all articles
Browse latest Browse all 202012

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>