-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from GMOD/2.0.1-lgv-update
2.0.1 lgv update
- Loading branch information
Showing
15 changed files
with
1,087 additions
and
2,023 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#' Create configuration for a JBrowse 2 text index | ||
#' | ||
#' Creates the necessary configuration string for an adapter to a text index for | ||
#' gene name search in the browser. | ||
#' | ||
#' Note: this function currently only supports aggregate indeces. | ||
#' | ||
#' For more information on JBrowse 2 text indeces, visit: | ||
#' \url{https://jbrowse.org/jb2/docs/config_guide/#text-searching} | ||
#' | ||
#' @param ix_uri the URI for the ix file | ||
#' @param ixx_uri the URI for the ixx file | ||
#' @param meta_uri the URI for the JSON metadata file | ||
#' @param assembly the assembly associated with the text index | ||
#' | ||
#' @return a character vector with the JSON text index adapter. | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' text_index( | ||
#' "https://jbrowse.org/genomes/hg19/trix/hg19.ix", | ||
#' "https://jbrowse.org/genomes/hg19/trix/hg19.ixx", | ||
#' "https://jbrowse.org/genomes/hg19/trix/meta.json", | ||
#' "hg19" | ||
#' ) | ||
text_index <- function(ix_uri, ixx_uri, meta_uri, assembly) { | ||
id <- paste0(assembly, "-index") | ||
|
||
as.character( | ||
stringr::str_glue( | ||
"{{", | ||
'"type": "TrixTextSearchAdapter", ', | ||
'"textSearchAdapterId": "{id}", ', | ||
'"ixFilePath": {{', | ||
'"uri": "{ix_uri}", ', | ||
'"locationType": "UriLocation"', | ||
"}}, ", | ||
'"ixxFilePath": {{', | ||
'"uri": "{ixx_uri}", ', | ||
'"locationType": "UriLocation"', | ||
"}}, ", | ||
'"metaFilePath": {{', | ||
'"uri": "{meta_uri}", ', | ||
'"locationType": "UriLocation"', | ||
"}}, ", | ||
'"assemblyNames": ["{assembly}"]', | ||
"}}" | ||
) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ reference: | |
- contents: | ||
- theme | ||
- json_config | ||
- text_index | ||
- title: "Utilities" | ||
- contents: | ||
- serve_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
library(shiny) | ||
library(JBrowseR) | ||
|
||
ui <- fluidPage(titlePanel("JBrowseR Example"), | ||
JBrowseROutput("widgetOutput")) | ||
|
||
server <- function(input, output, session) { | ||
hg38 <- assembly( | ||
"https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz", | ||
bgzip = TRUE, | ||
aliases = c("GRCh38"), | ||
refname_aliases = "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt" | ||
) | ||
|
||
|
||
output$widgetOutput <- renderJBrowseR(JBrowseR( | ||
"View", | ||
location = "10:29,838,737..29,838,819", | ||
assembly = hg38, | ||
text_index = text_index( | ||
"https://jbrowse.org/genomes/GRCh38/trix/hg38.ix", | ||
"https://jbrowse.org/genomes/GRCh38/trix/hg38.ixx", | ||
"https://jbrowse.org/genomes/GRCh38/trix/meta.json", | ||
"hg38" | ||
) | ||
)) | ||
|
||
} | ||
|
||
shinyApp(ui, server) |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
test_that("creating a text index returns valid configuration", { | ||
expect_equal( | ||
text_index( | ||
"https://jbrowse.org/genomes/GRCh38/trix/hg38.ix", | ||
"https://jbrowse.org/genomes/GRCh38/trix/hg38.ixx", | ||
"https://jbrowse.org/genomes/GRCh38/trix/meta.json", | ||
"hg38" | ||
), | ||
"{\"type\": \"TrixTextSearchAdapter\", \"textSearchAdapterId\": \"hg38-index\", \"ixFilePath\": {\"uri\": \"https://jbrowse.org/genomes/GRCh38/trix/hg38.ix\", \"locationType\": \"UriLocation\"}, \"ixxFilePath\": {\"uri\": \"https://jbrowse.org/genomes/GRCh38/trix/hg38.ixx\", \"locationType\": \"UriLocation\"}, \"metaFilePath\": {\"uri\": \"https://jbrowse.org/genomes/GRCh38/trix/meta.json\", \"locationType\": \"UriLocation\"}, \"assemblyNames\": [\"hg38\"]}" | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.