# Start the BioInstaller Shiny Application

#### Jianfeng Li

#### 2018-11-20

## Introduction

Shiny application of BioInstaller has been supported since v0.3.5. A pre-built Docker image can help you to start all configured BioInstaller services in one-click, which includes the R (v3.4.4), Opencpu server, Shiny server, and latest BioInstaller.

## How to deploy the BioInstaller using Docker

You need install the Docker program for futher opreations. It is required for running any Docker image including BioInstaller.

    docker pull bioinstaller/bioinstaller
    docker run -it -p 80:80 -p 8004:8004 -v /tmp/download:/tmp/download bioinstaller/bioinstaller

When the docker container of BioInstaller was created, you can access the three types of web service in the browser.

- localhost/ocpu/ Opencpu server
- localhost/shiny/BioInstaller Shiny server
- localhost/rstudio/ Rstudio server (opencpu/opencpu)

### Opencpu server

    #Show all items supported by BioInstaller
    curl http://localhost/ocpu/library/BioInstaller/R/install.bioinfo -d \
    "show.all.names=TRUE" X POST
    #Show all versions of Bwa
    curl http://localhost/ocpu/library/BioInstaller/R/install.bioinfo \
    -d "name='bwa', show.all.versions=TRUE" -X POST

    #Download and install latest Bwa
    curl http://localhost/ocpu/library/BioInstaller/R/install.bioinfo \
    -d "name='bwa', destdir='/opt/aliner/bwa'" -X POST
    # Download 1000 Genome Project annotation database
    curl http://localhost:5656/ocpu/library/BioInstaller/R/install.bioinfo \
    -d "name='db_annovar_1000g', destdir = '/opt/annovardb', \
    extra.list=list(buildver='hg19')" -X POST

    # Get the character key and retrieve the output
    # Get the JSON format value of returned output
    curl http://localhost/ocpu/tmp/{key}/R/.val/json
    # Get the text format value of returned output
    curl http://localhost/ocpu/tmp/{key}/R/.val/text
    # Get the function ‘print’ output of returned value
    curl http://localhost/ocpu/tmp/{key}/R/.val/print

### Shiny server

Open browser and input the URL “localhost/shiny/BioInstaller”. It will activate a Shiny session and start the BioInstaller Shiny application.

### Rstudio server

The Rstudio server was provided for users to connect the docker container just like in the desktop version of Rstudio.

## How to start the standalone Shiny service of BioInstaller

If the users can not to run a docker image, the standalone shiny service of BioInstaller is an another way to start the service.

    # If the BioInstaller R package has not been installed,
    # you need execute the followed commands:
    # install.packages('BioInstaller')
    # It is better to start the worker in another background processor
    BioInstaller::set_shiny_workers(3)
    BioInstaller::web(auto_create = TRUE)

To reduce the dependence of BioInstaller, we do not add the Shiny application modules dependent packages in the DESCRIPTION file. The function ‘BioInstaller::web’ will check the required dependences of Shiny application and install them if the dependence not be installed.