Skip to content

Commit

Permalink
Rename to JBrowseR
Browse files Browse the repository at this point in the history
  • Loading branch information
elliothershberg committed Feb 11, 2021
1 parent 1f2416d commit b87c263
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^RBrowse\.Rproj$
^JBrowseR\.Rproj$
^\.Rproj\.user$
^node_modules$
^srcjs$
Expand All @@ -7,7 +7,7 @@
^webpack\.config\.js$
^yarn\.lock$
^LICENSE\.md$
^inst/htmlwidgets/RBrowse\.js\.map$
^inst/htmlwidgets/JBrowseR\.js\.map$
^config\.json$
^custom_app\.R$
^json_app\.R$
Expand Down
20 changes: 12 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Package: RBrowse
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Package: JBrowseR
Title: An R interface to the JBrowse 2 Genome Browser
Version: 0.7.0.9000
Authors@R:
person(given = "First",
family = "Last",
person(given = "Elliot",
family = "Hershberg",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "YOUR-ORCID-ID"))
Description: What the package does (one paragraph).
email = "[email protected]",
comment = c(ORCID = "https://orcid.org/0000-0003-2068-3366"))
Description: Provides an R interface to the JBrowse 2 genome browser.
Enables embedding a JB2 genome browser in a Shiny app or RMarkdown
document. The browser can also be launced from an interactive R console.
The browser can be loaded with a variety of common genomics data types,
and can be used with a custom theme.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2021
COPYRIGHT HOLDER: RBrowse authors
COPYRIGHT HOLDER: jBrowseR authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2021 RBrowse authors
Copyright (c) 2021 JBrowseR authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(RBrowse)
export(RBrowseOutput)
export(JBrowseR)
export(JBrowseROutput)
export(assembly)
export(default_session)
export(json_config)
export(renderRBrowse)
export(renderJBrowseR)
export(theme)
export(track_alignments)
export(track_feature)
Expand Down
28 changes: 14 additions & 14 deletions R/RBrowse.R → R/JBrowseR.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,49 @@
#'
#' @import htmlwidgets
#' @export
RBrowse <- function(view, ..., width = NULL, height = NULL, elementId = NULL) {
JBrowseR <- function(view, ..., width = NULL, height = NULL, elementId = NULL) {

# describe a React component to send to the browser for rendering.
component <- reactR::component(view, list(...))

# create widget
htmlwidgets::createWidget(
name = "RBrowse",
name = "JBrowseR",
reactR::reactMarkup(component),
width = width,
height = height,
package = "RBrowse",
package = "JBrowseR",
elementId = elementId
)
}

#' Shiny bindings for RBrowse
#' Shiny bindings for JBrowseR
#'
#' Output and render functions for using RBrowse within Shiny
#' Output and render functions for using JBrowseR within Shiny
#' applications and interactive Rmd documents.
#'
#' @param outputId output variable to read from
#' @param width Must be a valid CSS unit or a number, which will be coerced to a string and have \code{'px'} appended.
#' @param height Must be a valid CSS unit or a number, which will be coerced to a string and have \code{'px'} appended.
#' @param expr An expression that generates a RBrowse
#' @param expr An expression that generates a JBrowseR
#' @param env The environment in which to evaluate \code{expr}.
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
#' is useful if you want to save an expression in a variable.
#'
#' @name RBrowse-shiny
#' @name JBrowseR-shiny
#'
#' @export
RBrowseOutput <- function(outputId, width = "100%", height = "400px") {
htmlwidgets::shinyWidgetOutput(outputId, "RBrowse", width, height, package = "RBrowse")
JBrowseROutput <- function(outputId, width = "100%", height = "400px") {
htmlwidgets::shinyWidgetOutput(outputId, "JBrowseR", width, height, package = "JBrowseR")
}

#' @rdname RBrowse-shiny
#' @rdname JBrowseR-shiny
#' @export
renderRBrowse <- function(expr, env = parent.frame(), quoted = FALSE) {
renderJBrowseR <- function(expr, env = parent.frame(), quoted = FALSE) {
if (!quoted) {
expr <- substitute(expr)
} # force quoted
htmlwidgets::shinyRenderWidget(expr, RBrowseOutput, env, quoted = TRUE)
htmlwidgets::shinyRenderWidget(expr, JBrowseROutput, env, quoted = TRUE)
}

#' Called by HTMLWidgets to produce the widget's root element.
Expand All @@ -63,8 +63,8 @@ renderRBrowse <- function(expr, env = parent.frame(), quoted = FALSE) {
#' @param class htmltools class
#' @param ... Additional arguments passed on
#'
#' @rdname RBrowse-shiny
RBrowse_html <- function(id, style, class, ...) {
#' @rdname JBrowseR-shiny
JBrowseR_html <- function(id, style, class, ...) {
htmltools::tagList(
# Necessary for RStudio viewer version < 1.2
reactR::html_dependency_corejs(),
Expand Down
2 changes: 1 addition & 1 deletion R/assembly.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#' name aliases. For more info see
#' \url{https://jbrowse.org/jb2/docs/config_guide#configuring-reference-name-aliasing}
#'
#' @return a string of RBrowse assembly configuration
#' @return a string of JBrowseR assembly configuration
#' @export
#'
#' @examples
Expand Down
12 changes: 6 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ knitr::opts_chunk$set(
# JBrowseR <img src='man/figures/logo.png' align="right" height="136" />

<!-- badges: start -->
[![R-CMD-check](https://github.com/elliothershberg/RBrowse/workflows/R-CMD-check/badge.svg)](https://github.com/elliothershberg/RBrowse/actions)
[![R-CMD-check](https://github.com/elliothershberg/JBrowseR/workflows/R-CMD-check/badge.svg)](https://github.com/elliothershberg/JBrowseR/actions)
<!-- badges: end -->

JBrowseR is an R package that provides a simple and clean interface to [JBrowse 2](https://jbrowse.org/jb2/) for R users.
Expand All @@ -30,25 +30,25 @@ With this functionality, you can deploy a first-class genome browser with your d

## Installation

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

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

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

``` r
# install.packages("devtools")
devtools::install_github("elliothershberg/RBrowse")
devtools::install_github("elliothershberg/JBrowseR")
```
## Example

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

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

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<!-- badges: start -->

[![R-CMD-check](https://github.com/elliothershberg/RBrowse/workflows/R-CMD-check/badge.svg)](https://github.com/elliothershberg/RBrowse/actions)
[![R-CMD-check](https://github.com/elliothershberg/JBrowseR/workflows/R-CMD-check/badge.svg)](https://github.com/elliothershberg/JBrowseR/actions)
<!-- badges: end -->

JBrowseR is an R package that provides a simple and clean interface to
Expand All @@ -23,18 +23,18 @@ with your data in just a few lines of R code!

## Installation

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

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
url: https://elliothershberg.github.io/RBrowse
url: https://elliothershberg.github.io/JBrowseR
8 changes: 4 additions & 4 deletions app.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
library(shiny)
library(RBrowse)
library(JBrowseR)

ui <- fluidPage(titlePanel("RBrowse Example"),
RBrowseOutput('widgetOutput'))
ui <- fluidPage(titlePanel("JBrowseR Example"),
JBrowseROutput('widgetOutput'))

server <- function(input, output, session) {
output$widgetOutput <- renderRBrowse(RBrowse("ViewHg19",
output$widgetOutput <- renderJBrowseR(JBrowseR("ViewHg19",
location = "10:29,838,737..29,838,819"))
}

Expand Down
8 changes: 4 additions & 4 deletions custom_app.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
library(shiny)
library(RBrowse)
library(JBrowseR)

ui <- fluidPage(
titlePanel("JBrowseR Example"),
RBrowseOutput("widgetOutput")
JBrowseROutput("widgetOutput")
)

server <- function(input, output, session) {
Expand Down Expand Up @@ -51,8 +51,8 @@ server <- function(input, output, session) {
# create a custom color palette theme for the browser
theme <- theme("#311b92", "#0097a7", "#f57c00", "#d50000")

output$widgetOutput <- renderRBrowse(
RBrowse("View",
output$widgetOutput <- renderJBrowseR(
JBrowseR("View",
assembly = assembly,
tracks = tracks,
location = "10:31,419,497..33,370,375",
Expand Down

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions json_app.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
library(shiny)
library(RBrowse)
library(JBrowseR)

ui <- fluidPage(
titlePanel("JSON JBrowseR Example"),
RBrowseOutput("widgetOutput")
JBrowseROutput("widgetOutput")
)

server <- function(input, output, session) {
config <- json_config("./config.json")

output$widgetOutput <- renderRBrowse(
RBrowse("JsonView",
output$widgetOutput <- renderJBrowseR(
JBrowseR("JsonView",
config = config,
location = "10:29,838,737..29,838,819"
)
Expand Down
24 changes: 12 additions & 12 deletions man/RBrowse-shiny.Rd → man/JBrowseR-shiny.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/RBrowse.Rd → man/JBrowseR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/assembly.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion srcjs/RBrowse.jsx → srcjs/JBrowseR.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import ViewHg19 from "./components/ViewHg19";
import View from "./components/View"
import JsonView from "./components/JsonView"

reactWidget("RBrowse", "output", { ViewHg38, ViewHg19, View, JsonView });
reactWidget("JBrowseR", "output", { ViewHg38, ViewHg19, View, JsonView });
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(testthat)
library(RBrowse)
library(JBrowseR)

test_check("RBrowse")
test_check("JBrowseR")
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ var CompressionPlugin = require("compression-webpack-plugin");

module.exports = {
mode: 'production',
entry: ['@babel/polyfill', path.join(__dirname, 'srcjs', 'RBrowse.jsx')],
entry: ['@babel/polyfill', path.join(__dirname, 'srcjs', 'JBrowseR.jsx')],
output: {
path: path.join(__dirname, 'inst/htmlwidgets'),
filename: 'RBrowse.js'
filename: 'JBrowseR.js'
},
module: {
rules: [
Expand Down

0 comments on commit b87c263

Please sign in to comment.