Question: Changing the direction of logfold change?
0
gravatar for Sharon
2.1 years ago by
Sharon460
Sharon460 wrote:

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

edger rna-seq log fold change • 1.0k views
ADD COMMENTlink modified 2.1 years ago by Devon Ryan93k • written 2.1 years ago by Sharon460

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 of pair = c('tr', 'ctrl'). Look into the help page for exactTest to determine what order you should present your groups

ADD REPLYlink written 2.1 years ago by russhh4.9k
1
gravatar for Devon Ryan
2.1 years ago by
Devon Ryan93k
Freiburg, Germany
Devon Ryan93k wrote:

Yes that will change to sign of the fold-change. The only reason to do this would be if you misspecified things in exactTest(). As a rule, I would strongly encourage people to not go around swapping the sign on their fold-changes without a very good reason.

ADD COMMENTlink written 2.1 years ago by Devon Ryan93k
1

Thank you all. Much appreciated. So if I have pair set to pair (control, tumor) and I removed this line (etp$table$logFC = -etp$table$logFC), then if I found in the results a negative logfold change, then that would mean the control is more expressed than the tumor? and if I found a postive sign foldchange, then this means the tumor is more expressed than the control. Am I correct? Thanks

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by Sharon460

Yes, that's correct.

ADD REPLYlink written 2.1 years ago by Devon Ryan93k

Thanks, much appreciated

ADD REPLYlink written 2.1 years ago by Sharon460
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 842 users visited in the last hour