I am working on RNASeq data with batches and later on I have to more covariates to design. I had tried automating R script but it's not working. How can I automate design part of DESeq2 workflow?
My coldata file looks like below
dds <- DESeqDataSetFromMatrix(countData = cts1,colData = coldata,design = ~ covariate)
I am getting below error. It is not taking column names from covariate object. Am I doing wrongly.
Error in DESeqDataSet(se, design = design, ignoreRank) :
all variables in design formula must be columns in colData
Is there any way I can automate if have more than two columns (eg . age) , instead of specifying each covariate separately to design matrix like below
dds <- DESeqDataSetFromMatrix(countData = cts1,colData = coldata,design = ~ condition + batch + age
Could you please help me to resolve this issue.
Thanks In Advance