Coder Social home page Coder Social logo

shinybn's Introduction

Introduction


shinyBN is an R/Shiny application for interactive construction, inference and visualization of Bayesian Network, which provide friendly GUI for users lacking of programming skills. It's mainly based on five R packages: bnlearn for structure learning, parameter training, gRain for network inference, and visNetwork for network visualization, pROC and rmda for receiver operating characteristic (ROC) curve and decision curves analysis (DCA) , respectively, which was further wrapped by Shiny, a framework to build interactive web application straight by R.

Get Start


Run APP in R:

Install dependencies:

install.packages("devtools")
library(devtools)

# Packages on CRAN
install.packages(c("shiny","shinydashboard","shinydashboardPlus","sqldf","writexl","readxl","reshape2","DT","bnlearn","ggsci","shinyjqui","ggplot2","visNetwork","pROC","rmda","knitr"))

# Packages on Bioconductor
#  For R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::install(c("gRain","igraph","AnnotationDbi","EBImage"))
# Others
source("http://bioconductor.org/biocLite.R")
biocLite(c("gRain","igraph","AnnotationDbi","EBImage"))


# Packages on Github
install_github(c("ramnathv/rblocks","woobe/rPlotter"))


# Notes: Some R packages are too old, you can install the `Old sources` from CRAN, of which released before 2019 are proper.

Install shinyBN from Github:

devtools::install_github('JiajinChen/shinyBN')

Launch the APP in R:

shinyBN::run_shinyBN()

Lauch the APP through browser:

Please visit: https://jiajin.shinyapps.io/shinyBN/ or http://bigdata.njmu.edu.cn/shinyBN/

Main Page


How to use


Step 1: Input your Network!

Here, we provide Four type of data input:

  • R Object in R : If you trigger shinyBN in R, you can directly upload your Network exist in R environment(class bn or bn.fit).

  • R Object(.Rdata) : Upload your Network that save as rdata format(class bn or bn.fit).

  • Individual Data(.csv) : Upload individual data and perform structure learning, parameter training in shinyBN.

  • Structure in Excel : Upload a Excel with Network information (see Example).

Step 2: Render your Network!

Once your BN is inputed, the plot would present automatically with default parameters. If you are not satisfied with your graphic appearance, you can render your plot with corresponding settings. Additionally, network layout and legend can be set flexibly. Finally, shinyBN provides high-quality images download in HTML output and Network information in Excel.Because the network plot is based on canvas, it's difficult to get SVG. However, we provide a convenient way to get high-resolution images:

  • Step1 : Download the high pixel network in HTML format from shinyBN.

  • Step2 : Open the HTML file with your browser and adjust the network to the proper size followed by right click to save the image.

    • An Example:

    grab-landing-page

Step 3: Inference!

One of the major functions of Bayesian network is inference. You can query the probability of interested nodes given the values of a set of instantiated nodes. shinyBN allowed users to set multiple instantiated nodes and both marginal probability and joint probability are supported, the inference results will be displayed in bar plot or probabilistic table. Users can set different color representing different threshold to distinguish different levels of outcome probability. In addition, you can download the result through a PDF output interface for High-quality images.

  • An Example of single prediction:

grab-landing-page

shinyBN also allowed user to upload a validation set for batch inference. If your validation set contains outcome label, you can get the receiver operating characteristic (ROC) curve plot and decision curves analysis (DCA) plot. The same, both the plot in high-resolution images and batch prediction result in tables are supported.

  • An Example of batch prediction:

grab-landing-page

If you use shinyBN in your work, please cite:

Chen, J., Zhang, R., Dong, X. et al. shinyBN: an online application for interactive Bayesian network inference and visualization. BMC Bioinformatics 20, 711 (2019) doi:10.1186/s12859-019-3309-0

Contact us

If you have any problem or other inquiries you can also email us at [email protected] .

shinybn's People

Contributors

jiajinchen avatar

Stargazers

Hamed Mehranfar avatar Vicky L avatar  avatar Michael Tso avatar  avatar Antonios Alexiadis  avatar Ravin Poudel avatar Srikanth K S avatar Josh avatar Jielong Huang avatar  avatar  avatar Adam Binksmith avatar  avatar Adam Rivers avatar  avatar water@nankai avatar Chris Tomlinson avatar Aditya Ponnada avatar Vinayak Sengupta avatar  avatar Young Sherlock avatar Sabbir Ahmed avatar Zhangz avatar Julián avatar TumasRackaitis avatar  avatar Daniel de Oliveira Arantes avatar  avatar Tosin Dairo  avatar  avatar PN avatar Zhu Ying avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar JieyuHe avatar

Watchers

James Cloos avatar JieyuHe avatar  avatar  avatar  avatar

shinybn's Issues

Error in dashboardPagePlus: could not find function "dashboardPagePlus"

Hi, thank you so much for providing this research tools.

I've been trying to run the app from R console with following sequence:

  1. Install dependencies
install.packages("devtools")
library(devtools)

install.packages(c("shiny","shinydashboard","shinydashboardPlus","sqldf","writexl","readxl","reshape2","DT","bnlearn","ggsci","shinyjqui","ggplot2","visNetwork","pROC","rmda","knitr"))

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::install(c("gRain","igraph","AnnotationDbi","EBImage"))

source("http://bioconductor.org/biocLite.R")
biocLite(c("gRain","igraph","AnnotationDbi","EBImage"))

install_github(c("ramnathv/rblocks","woobe/rPlotter"))

devtools::install_github('JiajinChen/shinyBN')
  1. Run the app
shinyBN::run_shinyBN()
  1. Get error message
Listening on http://127.0.0.1:7270
Warning: Error in dashboardPagePlus: could not find function "dashboardPagePlus"
  63: shinyUI
   2: shiny::runApp
   1: shinyBN::run_shinyBN
Warning: Error in dashboardPagePlus: could not find function "dashboardPagePlus"
  63: shinyUI
   2: shiny::runApp
   1: shinyBN::run_shinyBN

any work around?

Error in renderDataTable unused arguments

Hi,

First of all thanks for the hard work, your package looks really useful. However, I tried to install the package and run shinyBN and came up with this error:

Listening on http://127.0.0.1:3410 Warning: Error in renderDataTable: unused arguments (class = "compact", rownames = FALSE) 48: server [/usr/local/lib/R/site-library/shinyBN/shinyApp/server.R#55] Error in renderDataTable(RecP(), class = "compact", rownames = FALSE, : unused arguments (class = "compact", rownames = FALSE)

Is it possible I have missed a step?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.