I'm actually using this for GSEA. Do you think ranking genes based on FC and Pvalue like below is right?
x <- read.table("DE_genes.txt",sep = "\t",header = T)
head(x)
x$fcsign <- sign(x$logFC)
x$logP=-log10(x$p_value)
x$metric= x$logP/x$fcsign
y<-x[,c("Gene", "metric")]
head(y)
write.table(y,file="DE_genes.rnk",quote=F,sep="\t",row.names=F)
I will use that DE_genes.rnk as input for GSEA. Could you please tell me something about this. thanq
.
Hi, I have one more problem when I use this formula: signed fold change * -log10pvalue, as some of the pvalue = 0. So -log10pvalue returns infinite, which can not be processed further in GSEA. So what should I do with those pvalue = 0? Is it suitable if I simply replace the inf to some extremely large number in the rnk file? Thank you in advance!
Yes, for example
.Machine$double.xminin R.