Hi, My RNAseq dataset consist of two cultivars (R and S), three time points (1day, 3day and 7day) and two treatments (Control, Treated) with two replicates each. I have a total of 24 samples.
I am trying to find DEGs using LRT test for the following condition
> R Vs S due Treated Vs Control within 1 day R Vs S due Treated Vs Control within 3 day R Vs S due Treated Vs Control within 7 day
My code is
> library(DESeq2) countdata <- read.table("Suscep_Resis_ctrl_trt_all_matrix.txt", header=TRUE, row.names=1) countdata countdata <- as.matrix(countdata) countdata colData<- read.table ("Metadata.txt", header=TRUE, row.names=1) colData dds <- DESeqDataSetFromMatrix(countData = countdata, colData = colData, design= ~ Genotype.S.R. + Treatmenttime.C.T. + Genotype..S.R.:Treatmenttime.C.T.) dds dds <- DESeqDataSetFromMatrix(countData = countdata, colData = colData, design= ~ Genotype.S.R. + Treatmenttime.C.T. + Genotype.S.R.:Treatmenttime.C.T.) dds dds <- dds[ rowSums(counts(dds)) > 10, ] dds dds <- DESeq(dds, test = "LRT", reduced = ~ Genotype.S.R. + Treatmenttime.C.T.) resultsNames(dds)
The result names I am getting are
> resultsNames(dds)  "Intercept" "Genotype.S.R._Susceptible_vs_Resistant"  "Treatmenttime.C.T._ctrl3day_vs_ctrl1day" "Treatmenttime.C.T._ctrl7day_vs_ctrl1day"  "Treatmenttime.C.T._trt1day_vs_ctrl1day" "Treatmenttime.C.T._trt3day_vs_ctrl1day"  "Treatmenttime.C.T._trt7day_vs_ctrl1day" "Genotype.S.R.Susceptible.Treatmenttime.C.T.ctrl3day"  "Genotype.S.R.Susceptible.Treatmenttime.C.T.ctrl7day" "Genotype.S.R.Susceptible.Treatmenttime.C.T.trt1day"  "Genotype.S.R.Susceptible.Treatmenttime.C.T.trt3day" "Genotype.S.R.Susceptible.Treatmenttime.C.T.trt7day"
I tried to extract "Genotype.S.R.SusceptiblevsResistant" and "Treatmenttime.C.T.trt1dayvsctrl1day" using the following command
> day1 <- results(dds, contrast=list("Genotype.S.R._Susceptible_vs_Resistant", "Treatmenttime.C.T._trt1day_vs_ctrl1day"))
which is giving me a log P values of "Genotype.S.R.SusceptiblevsResistantvsTreatmenttime.C.T.trt1dayvsctrl1day"
But I am trying to get ResistantvsSusceptiblevsTreatmenttime.C.T.trt1dayvs_ctrl1day. For this I tried the relevel option but I am not getting the desired results.
Can anybody please guide me for How to rewrite the code to get my desired output as Genotype.S.R.ResistantvsSusceptiblevsTreatmenttime.C.T.trt1dayvsctrl1day