Description Usage Arguments Value Author(s) Examples
Plots an interactive volcanoplot after the differential analysis.
Typically, the log of Fold Change is represented on the X-axis and the
log10 of the p-value is drawn on the Y-axis. When the threshold_pVal
and the threshold_logFC
are set, two lines are drawn respectively on
the y-axis and the X-axis to visually distinguish between differential and
non differential data. With the use of the package Highcharter, a
customizable tooltip appears when the user put the mouse's pointer over
a point of the scatter plot.
1 2 3 4 5 6 7 8 9 | diffAnaVolcanoplot_rCharts(
df,
threshold_pVal = 1e-60,
threshold_logFC = 0,
conditions = NULL,
clickFunction = NULL,
palette = NULL,
swap = FALSE
)
|
df |
A dataframe which contains the following slots : x : a vector of the log(fold change) values of the differential analysis, y : a vector of the p-value values returned by the differential analysis. index : a vector of the rowanmes of the data. This dataframe must has been built with the option stringsAsFactors set to FALSE. There may be additional slots which will be used to show informations in the tooltip. The name of these slots must begin with the prefix "tooltip_". It will be automatically removed in the plot. |
threshold_pVal |
A floating number which represents the p-value that separates differential and non-differential data. |
threshold_logFC |
A floating number which represents the log of the Fold Change that separates differential and non-differential data. |
conditions |
A list of the names of condition 1 and 2 used for the differential analysis. |
clickFunction |
A string that contains a JavaScript function used to show info from slots in df. The variable this.index refers to the slot named index and allows to retrieve the right row to show in the tooltip. |
palette |
xxx |
swap |
A boolean that indicates if the conditions have been swaped |
An interactive volcanoplot
Samuel Wieczorek
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(highcharter)
utils::data(Exp1_R25_pept, package='DAPARdata')
obj <- Exp1_R25_pept[1:1000]
keepThat <- mvFilterGetIndices(obj, condition='WholeMatrix', threshold=ncol(obj))
obj <- mvFilterFromIndices(obj, keepThat)
qData <- Biobase::exprs(obj)
sTab <- Biobase::pData(obj)
data <- limmaCompleteTest(qData,sTab)
df <- data.frame(x=data$logFC, y = -log10(data$P_Value),index = as.character(rownames(obj)))
colnames(df) <- c("x", "y", "index")
tooltipSlot <- c("Sequence", "Score")
df <- cbind(df,Biobase::fData(obj)[tooltipSlot])
colnames(df) <- gsub(".", "_", colnames(df), fixed=TRUE)
if (ncol(df) > 3){
colnames(df)[4:ncol(df)] <-
paste("tooltip_", colnames(df)[4:ncol(df)], sep="")}
hc_clickFunction <- JS("function(event) {Shiny.onInputChange('eventPointClicked', [this.index]+'_'+ [this.series.name]);}")
cond <- c("25fmol", "10fmol")
diffAnaVolcanoplot_rCharts(df, 2.5, 1, cond,hc_clickFunction)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.