plot_disco | R Documentation |
Make a concordance / discordance plots for two contrasts
plot_disco(
contrast1,
contrast2,
lower = -100,
upper = 100,
show_top_labels = 0,
top_labels_both = TRUE,
annot1 = NULL,
annot2 = NULL,
alpha = 0.5,
disco = NULL,
by = 0,
primary_id = "PrimaryID",
label_col = "SYMBOL",
label_sel = NULL
)
contrast1, contrast2 |
data frames with rownames corresponding to
IDs (they don't need to be in the same order) and columns |
lower, upper |
lower and upper boundaries for coloring of the score |
show_top_labels |
sort the genes by descending absolute disco score and show top N labels |
top_labels_both |
should top labels from both negative and positive disco scores be shown, or only for the absolute top, whether only negative or only positive or both? |
annot1, annot2 |
annotation data frames for the two contrasts |
alpha |
transparency |
disco |
result of |
by |
column by which the contrast data frames should be merged
(passed to |
primary_id |
the name which should be assigned to the identifier column which results from the merge |
label_col |
name of the column in |
label_sel |
identifiers of labels to be shown on the plot |
A concordance / discordance plot is simply a log~2~ FC vs log~2~ FC comparison between two contrasts. Disco score is a heuristic score reflecting the strength of similarity or dissimilarity between two log~2~ FC values weighted by the corresponding p-values and given by the formula log2FC.x * log2FC.y * (-log10(pval.x) - log10(pval.y)).
To manually select which labels to show, use a truncated annot
object
– remove all rows you don't want to show, and set the show_top_labels
parameter to Inf
.
a ggplot object (plot)
## Generate example data
c1 <- data.frame(log2FoldChange=rnorm(5000, sd=2))
c1$pvalue <- pnorm(abs(c1$log2FoldChange), sd=2, lower.tail=FALSE)
c1$PrimaryID <- paste0("ID", 1:nrow(c1))
c2 <- data.frame(log2FoldChange=c1$log2FoldChange + rnorm(5000, sd=3))
c2$pvalue <- pnorm(abs(c2$log2FoldChange), sd=2, lower.tail=FALSE)
c2$PrimaryID <- paste0("ID", 1:nrow(c2))
## Example disco plot
plot_disco(c1, c2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.