Hello,
I am trying to run paired DESeq2 as shown below:
qw <- function(...) {
sapply(match.call()[-1], deparse)
}
# enter sample names
A <- qw(CT097,CT098,CT100,CT101)
B <- qw(CT005,CT006,CT007,CT008)
n <- length(sampleList[[1]])
m <- length(sampleList[[2]])
# run DESeq2
sampleTable <- data.frame(treatment= factor(rep(c("ctrl", "exp"), c(n,m))))
sampleTable$patient<- c("1","2","3","4","1","2","3","4")
rownames(sampleTable) <- colnames(txi.kallisto$counts)
dds <- DESeqDataSetFromTximport(txi.kallisto, sampleTable, ~patient + treatment)
I am getting a table like this:
I am getting the warning below:
Warning message:
In DESeqDataSet(se, design = design, ignoreRank) :
some variables in design formula are characters, converting to factors
Should I be worried about this? I think it is from the patient group because if I remove the patient column I do not get this warning. I am concerned because I read this in another ticket: "Very important: You need to put a "factor(...)" around the Patient.ID when creating the data frame. Otherwise, R will consider the patient IDs as numeric value, thinking that Patient 4 is expected to have 4 times the expression of something as Patient 1. (https://support.bioconductor.org/p/84241/)
Also does this paired analysis seem correct?
3 answers
It's fine. Obviously patient is a character, and DESeq2 makes it a factor. The paired analysis looks ok.
Agree with ATpoint. A way to avoid the warning would be something like:
sampleTable$patient <- factor(c(1:4,1:4))
It's generally clearer to explicitly make all your columns that should be factors factors: that is, every column that isn't a real number. If you'd done that upfront, there'd be no warning. In this case, it did that for you. You have numbers, but your data would be the same if they were a-h, so making them factors is fine.
Log in to answer this question.