Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy demos to shinyapps.io #24

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Using JBrowseR, you can:
- Deploy a genome browser directly from the R console to view your data
- Customize your genome browser to display your own data

With this functionality, you can deploy a first-class genome browser with your data in just a few lines of R code!

## Installation

Expand All @@ -49,8 +48,7 @@ This line of code can be used to launch a genome browser from your R console:

```{r example, eval=FALSE}
library(JBrowseR)
JBrowseR("ViewHg19",
location = "10:29,838,737..29,838,819")
JBrowseR("ViewHg19", location = "10:29,838,737..29,838,819")
```

<img src="man/figures/README-example-1.png" width="100%" />
Expand All @@ -64,6 +62,40 @@ In order to get started with JBrowseR, please refer to the vignette that best su
- [JSON configuration tutorial](https://gmod.github.io/JBrowseR/articles/json-tutorial.html)
- [Creating URLS](https://gmod.github.io/JBrowseR/articles/creating-urls.html)

## Live demos


### Basic usage including text search index

Allows you to search by gene name

https://gmod.shinyapps.io/basic_usage_with_text_index

### Multi purpose demo app

Shows a "bookmark" type feature, loading data from data frame, and buttons to navigate to genes of interest

https://gmod.shinyapps.io/bookmarks_demo

### Load config.json file

Shows loading a config.json file

https://gmod.shinyapps.io/load_config_json

### Load data frame

Simple example showing a data frame as a track

https://gmod.shinyapps.io/load_data_frame

### Gene fusion example

Shows putative gene fusions in the SKBR3 breast cancer cell line

https://gmod.shinyapps.io/skbr3_gene_fusions


## Citation

If you use JBrowseR in your research, please cite the following publication:
Expand Down
83 changes: 58 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,105 @@
---
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->



# JBrowseR <img src='man/figures/logo.png' align="right" height="136" />

<!-- badges: start -->

[![R-CMD-check](https://github.com/GMOD/JBrowseR/workflows/R-CMD-check/badge.svg)](https://github.com/gmod/JBrowseR/actions)
[![CRAN
status](https://www.r-pkg.org/badges/version/JBrowseR)](https://CRAN.R-project.org/package=JBrowseR)

[![CRAN status](https://www.r-pkg.org/badges/version/JBrowseR)](https://CRAN.R-project.org/package=JBrowseR)
<!-- badges: end -->

JBrowseR is an R package that provides a simple and clean interface to
[JBrowse 2](https://jbrowse.org/jb2/) for R users. Using JBrowseR, you can:
JBrowseR is an R package that provides a simple and clean interface to [JBrowse 2](https://jbrowse.org/jb2/) for R users.
Using JBrowseR, you can:

- Embed the JBrowse 2 genome browser in **R Markdown** documents and **Shiny
applications**
- Embed the JBrowse 2 genome browser in **R Markdown** documents and **Shiny applications**
- Deploy a genome browser directly from the R console to view your data
- Customize your genome browser to display your own data

With this functionality, you can deploy a first-class genome browser with your
data in just a few lines of R code!

## Installation

You can install the released version of JBrowseR from
[CRAN](https://CRAN.R-project.org) with:
You can install the released version of JBrowseR from [CRAN](https://CRAN.R-project.org) with:

```r
``` r
install.packages("JBrowseR")
```

And the development version from [GitHub](https://github.com/) with:

```r
``` r
# install.packages("devtools")
devtools::install_github("gmod/JBrowseR")
```

## Example

This line of code can be used to launch a genome browser from your R console:


```r
library(JBrowseR)
JBrowseR("ViewHg19",
location = "10:29,838,737..29,838,819")
JBrowseR("ViewHg19", location = "10:29,838,737..29,838,819")
```

<img src="man/figures/README-example-1.png" width="100%" />

## Getting started

In order to get started with JBrowseR, please refer to the vignette that best
suits your needs:
In order to get started with JBrowseR, please refer to the vignette that best suits your needs:

- [Introduction](https://gmod.github.io/JBrowseR/articles/JBrowseR.html)
- [Custom browser tutorial](https://gmod.github.io/JBrowseR/articles/custom-browser-tutorial.html)
- [JSON configuration tutorial](https://gmod.github.io/JBrowseR/articles/json-tutorial.html)
- [Creating URLs](https://gmod.github.io/JBrowseR/articles/creating-urls.html)
- [Creating URLS](https://gmod.github.io/JBrowseR/articles/creating-urls.html)

## Live demos


### Basic usage including text search index

Allows you to search by gene name

https://gmod.shinyapps.io/basic_usage_with_text_index

### Multi purpose demo app

Shows a "bookmark" type feature, loading data from data frame, and buttons to navigate to genes of interest

https://gmod.shinyapps.io/bookmarks_demo

### Load config.json file

Shows loading a config.json file

https://gmod.shinyapps.io/load_config_json

### Load data frame

Simple example showing a data frame as a track

https://gmod.shinyapps.io/load_data_frame

### Gene fusion example

Shows putative gene fusions in the SKBR3 breast cancer cell line

https://gmod.shinyapps.io/skbr3_gene_fusions


## Citation

If you use JBrowseR in your research, please cite the following publication:

[Hershberg et al., 2021. JBrowseR: An R Interface to the JBrowse 2 Genome Browser](https://doi.org/10.1093/bioinformatics/btab459)

@article{hershberg2021jbrowser,
title={JBrowseR: An R Interface to the JBrowse 2 Genome Browser},
author={Hershberg, Elliot A and Stevens, Garrett and Diesh, Colin and Xie, Peter and De Jesus Martinez, Teresa and Buels, Robert and Stein, Lincoln and Holmes, Ian},
journal={Bioinformatics}
}
```
@article{hershberg2021jbrowser,
title={JBrowseR: An R Interface to the JBrowse 2 Genome Browser},
author={Hershberg, Elliot A and Stevens, Garrett and Diesh, Colin and Xie, Peter and De Jesus Martinez, Teresa and Buels, Robert and Stein, Lincoln and Holmes, Ian},
journal={Bioinformatics}
}
```
1 change: 1 addition & 0 deletions example_apps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.dcf
21 changes: 21 additions & 0 deletions example_apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Install deps

```R

install.packages(c('JBrowseR','crosstalk','DT'))
```

### Deploy

```R
deployApp('example_apps/basic_usage_with_text_index',account='gmod')
deployApp('example_apps/bookmarks_demo',account='gmod')
deployApp('example_apps/load_config_json',account='gmod')
deployApp('example_apps/load_data_frame',account='gmod')
deployApp('example_apps/skbr3_gene_fusions',account='gmod')

```

Regex to generate above list of commands

'<,'>s/^\(.\*\)/deployApp('example_apps\/\1',account='gmod')
15 changes: 0 additions & 15 deletions example_apps/app.R

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
library(shiny)
library(JBrowseR)
library(bslib)

ui <- fluidPage(titlePanel("JBrowseR Example"),
JBrowseROutput("widgetOutput"))
ui <- fluidPage(
# Overriding the default bootstrap theme is needed to get proper font size
theme = bs_theme(version = 5),
titlePanel("JBrowseR Example"),
JBrowseROutput("widgetOutput")
)

server <- function(input, output, session) {
hg38 <- assembly(
Expand Down
54 changes: 0 additions & 54 deletions example_apps/bookmark_app.R

This file was deleted.

16 changes: 16 additions & 0 deletions example_apps/bookmarks_demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# JBrowse R Demo (with Shiny)

See this app running at https://cbridge.shinyapps.io/jbrowse-r-shiny/

This demo is originally by
[Caroline Bridge](https://github.com/carolinebridge-oicr) with components by
[Elliot Hershberg](https://github.com/elliothershberg).

Download this directory from the monorepo using
https://download-directory.github.io/?url=https://github.com/GMOD/jbrowse-components/tree/main/embedded_demos/jbrowse-r-shiny

## Usage

On the command line:

`Rscript app.R`
Loading