diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index fcc99c7c..16db0530 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -21,13 +21,16 @@ + + + - + @@ -39,6 +42,7 @@ + @@ -145,7 +149,7 @@

NA

Delete these instructions once you have read them.


Brief description of the problem

-
# insert reprex here
+
# insert reprex here
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 8e8c6adb..549fe9b1 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -21,13 +21,16 @@ + + + - + @@ -39,6 +42,7 @@ + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 85cc14f3..3ea5ba11 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -21,13 +21,16 @@ + + + - + @@ -39,6 +42,7 @@ + diff --git a/docs/articles/valr.html b/docs/articles/valr.html index bea99ccd..535ab4fc 100644 --- a/docs/articles/valr.html +++ b/docs/articles/valr.html @@ -8,8 +8,8 @@ valr overview • valr - - + + @@ -102,7 +102,7 @@
@@ -333,81 +331,81 @@

Meta-analysis

This demonstration illustrates how to use valr tools to perform a “meta-analysis” of signals relative to genomic features. Here we to analyze the distribution of histone marks surrounding transcription start sites.

First we load libraries and relevant data.

-
# `valr_example()` identifies the path of example files
-bedfile <- valr_example('genes.hg19.chr22.bed.gz')
-genomefile <- valr_example('hg19.chrom.sizes.gz')
-bgfile  <- valr_example('hela.h3k4.chip.bg.gz')
-
-genes <- read_bed(bedfile, n_fields = 6)
-genome <- read_genome(genomefile)
-y <- read_bedgraph(bgfile)
+
# `valr_example()` identifies the path of example files
+bedfile <- valr_example('genes.hg19.chr22.bed.gz')
+genomefile <- valr_example('hg19.chrom.sizes.gz')
+bgfile  <- valr_example('hela.h3k4.chip.bg.gz')
+
+genes <- read_bed(bedfile, n_fields = 6)
+genome <- read_genome(genomefile)
+y <- read_bedgraph(bgfile)

Then we generate 1 bp intervals to represent transcription start sites (TSSs). We focus on + strand genes, but - genes are easily accomodated by filtering them and using bed_makewindows() with reversed window numbers.

-
# generate 1 bp TSS intervals, `+` strand only
-tss <- genes %>%
-  filter(strand == '+') %>%
-  mutate(end = start + 1)
-
-# 1000 bp up and downstream
-region_size <- 1000
-# 50 bp windows
-win_size <- 50
-
-# add slop to the TSS, break into windows and add a group
-x <- tss %>%
-  bed_slop(genome, both = region_size) %>%
-  bed_makewindows(win_size)
-
-x
-#> # A tibble: 13,530 x 7
-#>    chrom    start      end name      score strand .win_id
-#>    <chr>    <int>    <int> <chr>     <chr> <chr>    <int>
-#>  1 chr22 16161065 16161115 LINC00516 3     +            1
-#>  2 chr22 16161115 16161165 LINC00516 3     +            2
-#>  3 chr22 16161165 16161215 LINC00516 3     +            3
-#>  4 chr22 16161215 16161265 LINC00516 3     +            4
-#>  5 chr22 16161265 16161315 LINC00516 3     +            5
-#>  6 chr22 16161315 16161365 LINC00516 3     +            6
-#>  7 chr22 16161365 16161415 LINC00516 3     +            7
-#>  8 chr22 16161415 16161465 LINC00516 3     +            8
-#>  9 chr22 16161465 16161515 LINC00516 3     +            9
-#> 10 chr22 16161515 16161565 LINC00516 3     +           10
-#> # ... with 13,520 more rows
+
# generate 1 bp TSS intervals, `+` strand only
+tss <- genes %>%
+  filter(strand == '+') %>%
+  mutate(end = start + 1)
+
+# 1000 bp up and downstream
+region_size <- 1000
+# 50 bp windows
+win_size <- 50
+
+# add slop to the TSS, break into windows and add a group
+x <- tss %>%
+  bed_slop(genome, both = region_size) %>%
+  bed_makewindows(win_size)
+
+x
+#> # A tibble: 13,530 x 7
+#>    chrom    start      end name      score strand .win_id
+#>    <chr>    <int>    <int> <chr>     <chr> <chr>    <int>
+#>  1 chr22 16161065 16161115 LINC00516 3     +            1
+#>  2 chr22 16161115 16161165 LINC00516 3     +            2
+#>  3 chr22 16161165 16161215 LINC00516 3     +            3
+#>  4 chr22 16161215 16161265 LINC00516 3     +            4
+#>  5 chr22 16161265 16161315 LINC00516 3     +            5
+#>  6 chr22 16161315 16161365 LINC00516 3     +            6
+#>  7 chr22 16161365 16161415 LINC00516 3     +            7
+#>  8 chr22 16161415 16161465 LINC00516 3     +            8
+#>  9 chr22 16161465 16161515 LINC00516 3     +            9
+#> 10 chr22 16161515 16161565 LINC00516 3     +           10
+#> # ... with 13,520 more rows

Now we use the .win_id group with bed_map() to caluclate a sum by mapping y signals onto the intervals in x. These data are regrouped by .win_id and a summary with mean and sd values is calculated.

-
# map signals to TSS regions and calculate summary statistics.
-res <- bed_map(x, y, win_sum = sum(value, na.rm = TRUE)) %>%
-  group_by(.win_id) %>%
-  summarize(win_mean = mean(win_sum, na.rm = TRUE),
-            win_sd = sd(win_sum, na.rm = TRUE))
-
-res
-#> # A tibble: 41 x 3
-#>    .win_id win_mean win_sd
-#>      <int>    <dbl>  <dbl>
-#>  1       1      101   85.8
-#>  2       2      111   81.1
-#>  3       3      123   99.1
-#>  4       4      116   96.3
-#>  5       5      116  102  
-#>  6       6      125   95.1
-#>  7       7      123   94.4
-#>  8       8      128   91.5
-#>  9       9      130   95.7
-#> 10      10      130   88.8
-#> # ... with 31 more rows
+
# map signals to TSS regions and calculate summary statistics.
+res <- bed_map(x, y, win_sum = sum(value, na.rm = TRUE)) %>%
+  group_by(.win_id) %>%
+  summarize(win_mean = mean(win_sum, na.rm = TRUE),
+            win_sd = sd(win_sum, na.rm = TRUE))
+
+res
+#> # A tibble: 41 x 3
+#>    .win_id win_mean win_sd
+#>      <int>    <dbl>  <dbl>
+#>  1       1     101.   85.8
+#>  2       2     111.   81.1
+#>  3       3     123.   99.1
+#>  4       4     116.   96.3
+#>  5       5     116.  102. 
+#>  6       6     125.   95.1
+#>  7       7     123.   94.4
+#>  8       8     128.   91.5
+#>  9       9     130.   95.7
+#> 10      10     130.   88.8
+#> # ... with 31 more rows

Finally, these summary statistics are used to construct a plot that illustrates histone density surrounding TSSs.

-
library(ggplot2)
-
-x_labels <- seq(-region_size, region_size, by = win_size * 5)
-x_breaks <- seq(1, 41, by = 5)
-
-sd_limits <- aes(ymax = win_mean + win_sd, ymin = win_mean - win_sd)
-
-ggplot(res, aes(x = .win_id, y = win_mean)) +
-  geom_point() + geom_pointrange(sd_limits) + 
-  scale_x_continuous(labels = x_labels, breaks = x_breaks) + 
-  xlab('Position (bp from TSS)') + ylab('Signal') + 
-  ggtitle('Human H3K4me3 signal near transcription start sites') +
-  theme_classic()
+
library(ggplot2)
+
+x_labels <- seq(-region_size, region_size, by = win_size * 5)
+x_breaks <- seq(1, 41, by = 5)
+
+sd_limits <- aes(ymax = win_mean + win_sd, ymin = win_mean - win_sd)
+
+ggplot(res, aes(x = .win_id, y = win_mean)) +
+  geom_point() + geom_pointrange(sd_limits) + 
+  scale_x_continuous(labels = x_labels, breaks = x_breaks) + 
+  xlab('Position (bp from TSS)') + ylab('Signal') + 
+  ggtitle('Human H3K4me3 signal near transcription start sites') +
+  theme_classic()

diff --git a/docs/articles/valr_files/figure-html/intersect_glyph-1.png b/docs/articles/valr_files/figure-html/intersect_glyph-1.png index 8b7370ca..13f70a7e 100644 Binary files a/docs/articles/valr_files/figure-html/intersect_glyph-1.png and b/docs/articles/valr_files/figure-html/intersect_glyph-1.png differ diff --git a/docs/articles/valr_files/figure-html/merge_glyph-1.png b/docs/articles/valr_files/figure-html/merge_glyph-1.png index e5791789..3ea06b05 100644 Binary files a/docs/articles/valr_files/figure-html/merge_glyph-1.png and b/docs/articles/valr_files/figure-html/merge_glyph-1.png differ diff --git a/docs/articles/valr_files/figure-html/plot-1.png b/docs/articles/valr_files/figure-html/plot-1.png index 9d7bf270..b6202366 100644 Binary files a/docs/articles/valr_files/figure-html/plot-1.png and b/docs/articles/valr_files/figure-html/plot-1.png differ diff --git a/docs/authors.html b/docs/authors.html index 86809251..92785482 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -21,13 +21,16 @@ + + + - + @@ -39,6 +42,7 @@ + @@ -137,9 +141,10 @@
-

Riemondy KA, Sheridan RM, Gillen A, Yu Y, Bennett CG and Hesselberth JR (2017). +

Riemondy KA, Sheridan RM, Gillen A, Yu Y, Bennett CG, Hesselberth JR (2017). “valr: Reproducible Genome Interval Arithmetic in R.” F1000Research. doi: 10.12688/f1000research.11997.1. diff --git a/docs/docsearch.css b/docs/docsearch.css index c524034b..e5f1fe1d 100644 --- a/docs/docsearch.css +++ b/docs/docsearch.css @@ -111,23 +111,26 @@ } .algolia-autocomplete .algolia-docsearch-footer { - float: none; - width: auto; - height: auto; - padding: .75rem 1rem 0; - font-size: .95rem; - line-height: 1; - color: #767676; - background-color: rgb(255, 255, 255); - border-top: 1px solid rgba(0, 0, 0, .1) + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; } .algolia-autocomplete .algolia-docsearch-footer--logo { - display: inline; - overflow: visible; - color: inherit; - text-indent: 0; - background: 0 0 + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); } .algolia-autocomplete .algolia-docsearch-suggestion--highlight { diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 00000000..b35504cd --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html index 7b52cd87..6e14b19e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,8 +8,8 @@ Genome Interval Arithmetic in R • valr - - + + valr

-

The valr package provides tools to read and manipulate genome intervals and signals, similar to the BEDtools suite. valr enables analysis in the R/RStudio environment, leveraging modern R tools in the tidyverse for a terse, expressive syntax. Compute-intensive algorithms are implemented in Rcpp/C++, and many methods take advantage of the speed and grouping capability provided by dplyr. See vignette(valr) for more details.

+

The valr package provides tools to read and manipulate genome intervals and signals, similar to the BEDtools suite. valr enables analysis in the R/RStudio environment, leveraging modern R tools in the tidyverse for a terse, expressive syntax. Compute-intensive algorithms are implemented in Rcpp/C++, and many methods take advantage of the speed and grouping capability provided by dplyr. See vignette(valr) for more details.

Installation

The latest stable version can be installed from CRAN:

-
install.packages('valr')
+
install.packages('valr')

The latest development version can be installed from github:

-
# install.packages("devtools")
-devtools::install_github('rnabioco/valr')
+
# install.packages("devtools")
+devtools::install_github('rnabioco/valr')

valr Example

Functions in valr have similar names to their BEDtools counterparts, and so will be familiar to users coming from the BEDtools suite. Unlike other tools that wrap BEDtools and write temporary files to disk, valr tools run natively in memory. Similar to pybedtools, valr has a terse syntax:

-
library(valr)
-library(dplyr)
-
-snps <- read_bed(valr_example('hg19.snps147.chr22.bed.gz'), n_fields = 6)
-#> Warning: package 'bindrcpp' was built under R version 3.4.4
-genes <- read_bed(valr_example('genes.hg19.chr22.bed.gz'), n_fields = 6)
-
-# find snps in intergenic regions
-intergenic <- bed_subtract(snps, genes)
-# find distance from intergenic snps to nearest gene
-nearby <- bed_closest(intergenic, genes)
-
-nearby %>%
-  select(starts_with('name'), .overlap, .dist) %>%
-  filter(abs(.dist) < 5000)
-#> # A tibble: 1,047 x 4
-#>    name.x      name.y   .overlap .dist
-#>    <chr>       <chr>       <int> <int>
-#>  1 rs530458610 P704P           0  2579
-#>  2 rs2261631   P704P           0 - 268
-#>  3 rs570770556 POTEH           0 - 913
-#>  4 rs538163832 POTEH           0 - 953
-#>  5 rs190224195 POTEH           0 -1399
-#>  6 rs2379966   DQ571479        0  4750
-#>  7 rs142687051 DQ571479        0  3558
-#>  8 rs528403095 DQ571479        0  3309
-#>  9 rs555126291 DQ571479        0  2745
-#> 10 rs5747567   DQ571479        0 -1778
-#> # ... with 1,037 more rows
+
library(valr)
+library(dplyr)
+
+snps <- read_bed(valr_example('hg19.snps147.chr22.bed.gz'), n_fields = 6)
+genes <- read_bed(valr_example('genes.hg19.chr22.bed.gz'), n_fields = 6)
+
+# find snps in intergenic regions
+intergenic <- bed_subtract(snps, genes)
+# find distance from intergenic snps to nearest gene
+nearby <- bed_closest(intergenic, genes)
+
+nearby %>%
+  select(starts_with('name'), .overlap, .dist) %>%
+  filter(abs(.dist) < 5000)
+#> # A tibble: 1,047 x 4
+#>    name.x      name.y   .overlap .dist
+#>    <chr>       <chr>       <int> <int>
+#>  1 rs530458610 P704P           0  2579
+#>  2 rs2261631   P704P           0  -268
+#>  3 rs570770556 POTEH           0  -913
+#>  4 rs538163832 POTEH           0  -953
+#>  5 rs190224195 POTEH           0 -1399
+#>  6 rs2379966   DQ571479        0  4750
+#>  7 rs142687051 DQ571479        0  3558
+#>  8 rs528403095 DQ571479        0  3309
+#>  9 rs555126291 DQ571479        0  2745
+#> 10 rs5747567   DQ571479        0 -1778
+#> # ... with 1,037 more rows
diff --git a/docs/pkgdown.css b/docs/pkgdown.css index c5ab586e..6ca2f37a 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -225,3 +225,8 @@ mark { border-bottom: 2px solid rgba(255, 153, 51, 0.3); padding: 1px; } + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 16d57509..de9bd724 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -1,174 +1,110 @@ -$(function() { - - $("#sidebar") - .stick_in_parent({offset_top: 40}) - .on('sticky_kit:bottom', function(e) { - $(this).parent().css('position', 'static'); - }) - .on('sticky_kit:unbottom', function(e) { - $(this).parent().css('position', 'relative'); +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $("#sidebar") + .stick_in_parent({offset_top: 40}) + .on('sticky_kit:bottom', function(e) { + $(this).parent().css('position', 'static'); + }) + .on('sticky_kit:unbottom', function(e) { + $(this).parent().css('position', 'relative'); + }); + + $('body').scrollspy({ + target: '#sidebar', + offset: 60 }); - $('body').scrollspy({ - target: '#sidebar', - offset: 60 - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - $("#navbar ul li a").each(function(index, value) { - if (value.text == "Home") - return; - if (value.getAttribute("href") === "#") - return; + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + var path = paths(links[i].pathname); + + var length = prefix_length(cur_path, path); + if (length > max_length) { + max_length = length; + pos = i; + } + } - var path = paths(value.pathname); - if (is_prefix(cur_path, path)) { - // Add class to parent
  • , and enclosing
  • if in dropdown - var menu_anchor = $(value); + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); menu_anchor.parent().addClass("active"); menu_anchor.closest("li.dropdown").addClass("active"); } }); -}); -$(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(0); - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 1 : 0); } - }; - - mark(); -}); - -function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); -} - -function is_prefix(needle, haystack) { - if (needle.length > haystack.lengh) - return(false); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0); - } + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(false); + return(haystack.length); } - return(true); -} + /* Clipboard --------------------------*/ -/* Clipboard --------------------------*/ + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } -function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); -} + if(Clipboard.isSupported()) { + $(document).ready(function() { + var copyButton = ""; -if(Clipboard.isSupported()) { - $(document).ready(function() { - var copyButton = ""; + $(".examples, div.sourceCode").addClass("hasCopyButton"); - $(".examples").addClass("hasCopyButton"); + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); + // Initialize clipboard: + var clipboardBtnCopies = new Clipboard('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); - // Initialize clipboard: - var clipboardBtnCopies = new Clipboard('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent; - } - }); + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); -} - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index ca90ac17..0478ccc8 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,5 +1,5 @@ -pandoc: 1.19.2.1 -pkgdown: 1.0.0 +pandoc: 2.2.1 +pkgdown: 1.1.0.9000 pkgdown_sha: ~ articles: benchmarks: benchmarks.html diff --git a/docs/reference/bed_cluster-1.png b/docs/reference/bed_cluster-1.png index 02abcb6e..5807b38a 100644 Binary files a/docs/reference/bed_cluster-1.png and b/docs/reference/bed_cluster-1.png differ diff --git a/docs/reference/bed_cluster.html b/docs/reference/bed_cluster.html index 3d3ad5cf..97e2b460 100644 --- a/docs/reference/bed_cluster.html +++ b/docs/reference/bed_cluster.html @@ -21,13 +21,16 @@ + + + - + @@ -43,6 +46,7 @@ + @@ -201,14 +205,14 @@

    Examp ) bed_cluster(x)
    #> # A tibble: 6 x 4 -#> chrom start end .id -#> <chr> <dbl> <dbl> <int> -#> 1 chr1 100 200 1 -#> 2 chr1 180 250 1 -#> 3 chr1 250 500 1 -#> 4 chr1 501 1000 2 -#> 5 chr2 1.00 100 3 -#> 6 chr2 150 200 4
    +#> chrom start end .id +#> <chr> <dbl> <dbl> <int> +#> 1 chr1 100 200 1 +#> 2 chr1 180 250 1 +#> 3 chr1 250 500 1 +#> 4 chr1 501 1000 2 +#> 5 chr2 1 100 3 +#> 6 chr2 150 200 4
    # glyph illustrating clustering of overlapping and book-ended intervals x <- trbl_interval( ~chrom, ~start, ~end, diff --git a/docs/reference/bed_complement-1.png b/docs/reference/bed_complement-1.png index ec15967f..0af407ff 100644 Binary files a/docs/reference/bed_complement-1.png and b/docs/reference/bed_complement-1.png differ diff --git a/docs/reference/bed_complement.html b/docs/reference/bed_complement.html index 9e12e80e..b9f57d31 100644 --- a/docs/reference/bed_complement.html +++ b/docs/reference/bed_complement.html @@ -21,13 +21,16 @@ + + + - + @@ -41,6 +44,7 @@ + diff --git a/docs/reference/bed_flank-1.png b/docs/reference/bed_flank-1.png index 6893b5b6..4f4afdcd 100644 Binary files a/docs/reference/bed_flank-1.png and b/docs/reference/bed_flank-1.png differ diff --git a/docs/reference/bed_flank.html b/docs/reference/bed_flank.html index 2e61adb9..ec50f9c1 100644 --- a/docs/reference/bed_flank.html +++ b/docs/reference/bed_flank.html @@ -21,13 +21,16 @@ + + + - + @@ -41,6 +44,7 @@ + diff --git a/docs/reference/bed_merge-1.png b/docs/reference/bed_merge-1.png index fcbbd861..00cabb99 100644 Binary files a/docs/reference/bed_merge-1.png and b/docs/reference/bed_merge-1.png differ diff --git a/docs/reference/bed_merge.html b/docs/reference/bed_merge.html index 674ee517..1c7c4bb4 100644 --- a/docs/reference/bed_merge.html +++ b/docs/reference/bed_merge.html @@ -21,13 +21,16 @@ + + + - + @@ -43,6 +46,7 @@ + @@ -238,12 +242,12 @@

    Examp #> 5 chr2 1 25 + #> 6 chr2 400 550 +

    bed_merge(x, .value = sum(value))
    #> # A tibble: 4 x 4 -#> chrom start end .value -#> <chr> <dbl> <dbl> <dbl> -#> 1 chr1 1.00 50.0 1.00 -#> 2 chr1 100 250 5.00 -#> 3 chr2 1.00 25.0 4.00 -#> 4 chr2 200 550 18.0
    +#> chrom start end .value +#> <chr> <dbl> <dbl> <dbl> +#> 1 chr1 1 50 1 +#> 2 chr1 100 250 5 +#> 3 chr2 1 25 4 +#> 4 chr2 200 550 18
    #> # A tibble: 7 x 4 #> chrom start end value #> <chr> <int> <int> <dbl> -#> 1 chr1 100 200 10.0 -#> 2 chr1 200 300 30.0 -#> 3 chr1 300 400 60.0 -#> 4 chr1 400 500 40.0 -#> 5 chr1 500 550 30.0 -#> 6 chr1 550 575 2.00 -#> 7 chr1 800 900 5.00
    +#> 1 chr1 100 200 10 +#> 2 chr1 200 300 30 +#> 3 chr1 300 400 60 +#> 4 chr1 400 500 40 +#> 5 chr1 500 550 30 +#> 6 chr1 550 575 2 +#> 7 chr1 800 900 5
    # partition and compute summaries based on group x <- dplyr::group_by(x, strand) bed_partition(x, value = sum(value))
    #> # A tibble: 6 x 5 #> chrom start end strand value #> <chr> <int> <int> <chr> <dbl> -#> 1 chr1 100 300 + 10.0 -#> 2 chr1 200 400 - 20.0 -#> 3 chr1 300 500 + 40.0 -#> 4 chr1 500 550 + 30.0 -#> 5 chr1 550 575 + 2.00 -#> 6 chr1 800 900 + 5.00
    +#> 1 chr1 100 300 + 10 +#> 2 chr1 200 400 - 20 +#> 3 chr1 300 500 + 40 +#> 4 chr1 500 550 + 30 +#> 5 chr1 550 575 + 2 +#> 6 chr1 800 900 + 5
    # combine values across multiple tibbles y <- trbl_interval( ~chrom, ~start, ~end, ~value, ~strand, @@ -245,19 +249,19 @@

    Examp x <- dplyr::bind_rows(x, y) bed_partition(x, value = sum(value))

    #> # A tibble: 11 x 5 -#> chrom start end strand value -#> <chr> <int> <int> <chr> <dbl> -#> 1 chr1 10 100 + 100 -#> 2 chr1 100 300 + 110 -#> 3 chr1 200 250 - 20.0 -#> 4 chr1 250 400 - 220 -#> 5 chr1 300 350 + 140 -#> 6 chr1 350 500 + 440 -#> 7 chr1 400 420 - 200 -#> 8 chr1 500 550 + 330 -#> 9 chr1 550 555 + 22.0 -#> 10 chr1 555 575 + 2.00 -#> 11 chr1 800 900 + 55.0
    +#> chrom start end strand value +#> <chr> <int> <int> <chr> <dbl> +#> 1 chr1 10 100 + 100 +#> 2 chr1 100 300 + 110 +#> 3 chr1 200 250 - 20 +#> 4 chr1 250 400 - 220 +#> 5 chr1 300 350 + 140 +#> 6 chr1 350 500 + 440 +#> 7 chr1 400 420 - 200 +#> 8 chr1 500 550 + 330 +#> 9 chr1 550 555 + 22 +#> 10 chr1 555 575 + 2 +#> 11 chr1 800 900 + 55