Hi,
My data set is similar to the described "two conditions, two genotypes with an interaction term" situation. I think I do follow the example (2) correctly. However, when extracting results for the condition (e.g. treatment) effect for genotype II (e.g. X-KD), resultsNames function does not show the expected output. I know there are similar posts around but I could not figure it out myself.
Here is my code:
> library(DESeq2) > coldata transfection treatment ID Ctr_untreated_1-1 siCtr untreated A Ctr_untreated_1-2 siCtr untreated A Ctr_untreated_2-1 siCtr untreated B Ctr_untreated_2-2 siCtr untreated B Ctr_untreated_3-1 siCtr untreated C Ctr_untreated_3-2 siCtr untreated C Ctr_untreated_4-1 siCtr untreated D Ctr_untreated_4-2 siCtr untreated D X-KD_untreated_1-1 siX untreated E X-KD_untreated_1-2 siX untreated E X-KD_untreated_2-1 siX untreated F X-KD_untreated_2-2 siX untreated F X-KD_untreated_3-1 siX untreated G X-KD_untreated_3-2 siX untreated G X-KD_untreated_4-1 siX untreated H X-KD_untreated_4-2 siX untreated H Ctr_treated_1-1 siCtr hormone I Ctr_treated_1-2 siCtr hormone I Ctr_treated_2-1 siCtr hormone J Ctr_treated_2-2 siCtr hormone J Ctr_treated_3-1 siCtr hormone K Ctr_treated_3-2 siCtr hormone K Ctr_treated_4-1 siCtr hormone L Ctr_treated_4-2 siCtr hormone L X-KD_treated_1-1 siX hormone N X-KD_treated_1-2 siX hormone N X-KD_treated_2-1 siX hormone O X-KD_treated_2-2 siX hormone O X-KD_treated_3-1 siX hormone P X-KD_treated_3-2 siX hormone P X-KD_treated_4-1 siX hormone Q X-KD_treated_4-2 siX hormone Q > raw_matrix <- read.table("Sequencing/HTSeq-count_allgenes_mod_order.txt", row.names=1, header=T) > colnames(raw_matrix)<-NULL > dds = DESeqDataSetFromMatrix(countData = raw_matrix, colData = coldata, design = ~ transfection + treatment + transfection:treatment) > ddsColl <- collapseReplicates(dds, dds$ID) > dds.test = DESeq(ddsColl) > resultsNames(dds.test) [1] "Intercept" "transfection_siX_vs_siCtr" [3] "treatment_untreated_vs_hormone" "transfectionsiX.treatmentuntreated"
I was expecting to get the output "transfectionsiX.treatmenthormone" instead of "transfectionsiX.treatmentuntreated".
. Where do I miss something?
Thanks,
Zeynep
hi Zeynep,
it's just a small coding bug. You didn't close the list() with a final
")"
. The code should be: