dash_bioVolcanoPlot Examples and Reference

See VolcanoPlot in action.

VolcanoPlot

An example of a default VolcanoPlot component without any extra properties.

Effect sizes

library(dash)
library(dashBio)
library(dashHtmlComponents)
library(dashCoreComponents)

app <- Dash$new()

df <- read.csv(
  file ='https://git.io/volcano_data1.csv',
  stringsAsFactors = FALSE
)

app$layout(
    htmlDiv(
        list(
            'Effect sizes',
            dccRangeSlider(
                id = 'default-volcanoplot-input',
                min = -3,
                max = 3,
                step = 0.05,
                marks = setNames(
                    lapply(-3:3,
                        function(i){
                            list(label = as.character(i))
                        }),
                        -3:3
                ),
                value = c(-0.5, 1)
            ),
            htmlBr(),
            htmlDiv(
                dccGraph(
                    id = 'dashbio-default-volcanoplot',
                    figure = dashbioVolcano(
                        dataframe = df
                    )
                )
            )
        )
    )
)
app$callback(
    output = list(id = 'dashbio-default-volcanoplot', property = 'figure'),
    params = list(input(id = 'default-volcanoplot-input', property = 'value')),
    function(effects) {
        dashbioVolcano(
            dataframe = df,
            genomewideline_value = 2.5,
            effect_size_line = unlist(effects)
        )
    }
)

app$run_server()

Customization

Colors

Choose the colors of the scatter plot points, the highlighted points, the genome-wide line, and the effect size lines.

This example has not been ported to R yet - showing the Python version instead.

Visit the old docs site for R at: https://community.plotly.com/c/dash/r/21

import pandas as pd
from dash import dcc
import dash_bio as dashbio

df = pd.read_csv('https://git.io/volcano_data1.csv')

volcanoplot = dashbio.VolcanoPlot(
    dataframe=df,
    effect_size_line_color='#AB63FA',
    genomewideline_color='#EF553B',
    highlight_color='#119DFF',
    col='#2A3F5F'
)

dcc.Graph(figure=volcanoplot)

Point Sizes And Line Widths

Change the size of the points on the scatter plot, and the widths of the effect lines and genome-wide line.

This example has not been ported to R yet - showing the Python version instead.

Visit the old docs site for R at: https://community.plotly.com/c/dash/r/21

import pandas as pd
from dash import dcc
import dash_bio as dashbio

df = pd.read_csv('https://git.io/volcano_data1.csv')

volcanoplot = dashbio.VolcanoPlot(
    dataframe=df,
    point_size=10,
    effect_size_line_width=4,
    genomewideline_width=2
)

dcc.Graph(figure=volcanoplot)

dash_bio.VolcanoPlot is a Python-based component,
and may not be available in other languages.

Example Data