I would like to understand if the last line in my code does need the negative sign.
Like when to use etp$table$logFC = -etp$table$logFC
and when to ignore this line.
I saw some tutorials adding this which changes the direction of the results and this confuses me.
I am testing normal samples vs. tumor samples
group <- c(rep("ctrl", 10), rep("tr", 10))
dge = DGEList(counts=data, genes= rownames(data), group=group)
countsPerMillion <- cpm(dge)
summary(countsPerMillion)
countCheck <- countsPerMillion > 1
summary(countCheck)
keep <- which(rowSums(countCheck) >= 2)
dge <- dge[keep,]
summary(cpm(dge))
dge <- calcNormFactors(dge, method="TMM")
dge <- estimateCommonDisp(dge)
dge <- estimateTagwiseDisp(dge)
et <- exactTest(dge, pair=c("ctrl", "tr"))
etp <- topTags(et, n=2000000)
etp$table$logFC = -etp$table$logFC
Thanks a lot
What do you want the logFC values to look like: do you want positive signs if there is higher expression in the treatment than the control? I wouldn't include that final line, I'd modify your line where
et
is defined:pair = c('ctrl', 'tr')
should give the reflection ofpair = c('tr', 'ctrl')
. Look into the help page forexactTest
to determine what order you should present your groups