###Download modified RRHO scripts Obtain the modified R scripts from https://gist.github.com/ipurusho/8e4beef4fb51c2485c9f and source it in your R environment.
###Prepare the data Create two separate matrices, one for P value and one for log fold change from your differential analysis. The rows should be genes and the columns should be the comparisons (column order should be consistent between the two matrices). For example:
P.vals = as.data.frame(cbind(Comparison1 = Comparison1[intersect.genes,"P.Value"],
Comparison2 = Comparison2[intersect.genes,"P.Value"],
Comparison3 = Comparison3[intersect.genes,"P.Value"]))
logfc = as.data.frame(cbind(Comparison1 = Comparison1[intersect.genes,"logFC"],
Comparison2 = Comparison2[intersect.genes,"logFC"],
Comparison3 = Comparison3[intersect.genes,"logFC"]))
Now we outline the RRHO comparisons we want to make, via a String array, and pass it to the generate.rrho
function. For example:
comparisons <- rbind(c("Comparison1","Comparison2"),
c("Comparison2","Comparison2"),
c("Comparison1","Comparison3"))
Here we are making 3 RRHOs, using differential comparisons "Comparison1" (x-axis) vs "Comparison2" (y-axis), "Comparison2" (x-axis) vs "Comparison3" (y-axis), and so on.
Now we will invoke the generate.rrho
wrapper as follows:
generate.rrho(P.vals,logfc,comparisons,"/path/to/output/directory")
This will perform all the RRHO comparisons with the same -log10 scale, such that they are comparable to one another.