diff --git a/dev/articles/interval-stats.html b/dev/articles/interval-stats.html index c730ad19..760f31fc 100644 --- a/dev/articles/interval-stats.html +++ b/dev/articles/interval-stats.html @@ -79,7 +79,7 @@
diff --git a/dev/search.json b/dev/search.json index 2c73648a..999cfc36 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to valr","title":"Contributing to valr","text":"outlines propose change valr. detailed info contributing , tidyverse packages, please see development contributing guide.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to valr","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to valr","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to valr","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"rnabioco/valr\", fork = TRUE). Install development dependences devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to valr","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to valr","text":"Please note valr project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://rnabioco.github.io/valr/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2016-2018 Jay R Hesselberth Kent Riemondy Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://rnabioco.github.io/valr/dev/articles/interval-stats.html","id":"overview","dir":"Articles","previous_headings":"","what":"Overview","title":"Interval statistics","text":"valr includes several functions exploring statistical relationships sets intervals. Calculate significance overlaps sets intervals bed_fisher() bed_projection(). Quantify relative absolute distances sets intervals bed_reldist() bed_absdist(). Quantify extent overlap sets intervals bed_jaccard(). vignette explore relationship transcription start sites repetitive elements human genome.","code":"library(valr) #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found library(dplyr) library(ggplot2) library(cowplot) library(tidyr) # load repeats and genes. Data in the valr package is restricted to chr22; the entire # files can be downloaded from UCSC. rpts <- read_bed(valr_example(\"hg19.rmsk.chr22.bed.gz\")) genes <- read_bed12(valr_example(\"hg19.refGene.chr22.bed.gz\")) # load chrom sizes genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) # create 1 bp intervals representing transcription start sites tss <- create_tss(genes) tss #> # A tibble: 1,267 × 6 #> chrom start end name score strand #> #> 1 chr22 16193008 16193009 NR_122113 0 - #> 2 chr22 16157078 16157079 NR_133911 0 + #> 3 chr22 16162065 16162066 NR_073459 0 + #> 4 chr22 16162065 16162066 NR_073460 0 + #> 5 chr22 16231288 16231289 NR_132385 0 - #> 6 chr22 16287936 16287937 NM_001136213 0 - #> 7 chr22 16274608 16274609 NR_046571 0 + #> 8 chr22 16449803 16449804 NM_001005239 0 - #> 9 chr22 17073699 17073700 NM_014406 0 - #> 10 chr22 17082800 17082801 NR_001591 0 + #> # ℹ 1,257 more rows"},{"path":"https://rnabioco.github.io/valr/dev/articles/interval-stats.html","id":"distance-metrics","dir":"Articles","previous_headings":"","what":"Distance metrics","title":"Interval statistics","text":"First define function takes x y intervals computes distance statistics (using bed_reldist() bed_absdist()) specified groups. value statistic assigned .value column. use distance_stats() function apply bed_absdist() function group data. done set shuffled group data. bed_shuffle() used shuffle coordinates repeats within chromosome (.e., coordinates change, chromosome stays .) Now can bind observed shuffled data together, tidying put data format appropriate statistical test. involves: unnest()ing data frames creating groups repeat (name), stat (reldist absdist) type (obs shf) adding unique surrogate row numbers group using tidyr::pivot_wider() create two new obs shuf columns removing rows NA values. Now data formatted, can use non-parametric ks.test() determine whether significant differences observed shuffled data group. broom::tidy() used reformat results test tibble, results test pivoted type column test type. Histgrams different stats help visualize distribution p.values. can also assess false discovery rates (q.values) using p.adjust(). Finally can visualize results using stat_ecdf().","code":"distance_stats <- function(x, y, genome, group_var, type = NA) { group_by(x, !!rlang::sym(group_var)) |> do( reldist = bed_reldist(., y, detail = TRUE) |> select(.value = .reldist), absdist = bed_absdist(., y, genome) |> select(.value = .absdist) ) |> tidyr::pivot_longer( cols = -name, names_to = \"stat\", values_to = \"value\" ) |> mutate(type = type) } obs_stats <- distance_stats(rpts, tss, genome, \"name\", \"obs\") obs_stats #> # A tibble: 2,106 × 4 #> name stat value type #> #> 1 (A)n reldist obs #> 2 (A)n absdist obs #> 3 (AAAAACA)n reldist obs #> 4 (AAAAACA)n absdist obs #> 5 (AAAAC)n reldist obs #> 6 (AAAAC)n absdist obs #> 7 (AAAAG)n reldist obs #> 8 (AAAAG)n absdist obs #> 9 (AAAAT)n reldist obs #> 10 (AAAAT)n absdist obs #> # ℹ 2,096 more rows shfs <- bed_shuffle(rpts, genome, within = TRUE) shf_stats <- distance_stats(shfs, tss, genome, \"name\", \"shuf\") res <- bind_rows(obs_stats, shf_stats) |> tidyr::unnest(value) |> group_by(name, stat, type) |> mutate(.id = row_number()) |> tidyr::pivot_wider( names_from = \"type\", values_from = \".value\" ) |> na.omit() res #> # A tibble: 16,785 × 5 #> # Groups: name, stat [1,904] #> name stat .id obs shuf #> #> 1 (A)n reldist 1 0.363 0.177 #> 2 (A)n reldist 2 0.429 0.404 #> 3 (A)n reldist 3 0.246 0.119 #> 4 (A)n reldist 4 0.478 0.157 #> 5 (A)n reldist 5 0.260 0.176 #> 6 (A)n reldist 6 0.286 0.225 #> 7 (A)n reldist 7 0.498 0.128 #> 8 (A)n reldist 8 0.237 0.385 #> 9 (A)n reldist 9 0.314 0.413 #> 10 (A)n reldist 10 0.149 0.234 #> # ℹ 16,775 more rows library(broom) pvals <- res |> do( twosided = tidy(ks.test(.$obs, .$shuf)), less = tidy(ks.test(.$obs, .$shuf, alternative = \"less\")), greater = tidy(ks.test(.$obs, .$shuf, alternative = \"greater\")) ) |> tidyr::pivot_longer(cols = -c(name, stat), names_to = \"alt\", values_to = \"type\") |> unnest(type) |> select(name:p.value) |> arrange(p.value) ggplot(pvals, aes(p.value)) + geom_histogram(binwidth = 0.05) + facet_grid(stat ~ alt) + theme_cowplot() pvals <- group_by(pvals, stat, alt) |> mutate(q.value = p.adjust(p.value)) |> ungroup() |> arrange(q.value) res_gather <- tidyr::pivot_longer(res, cols = -c(name, stat, .id), names_to = \"type\", values_to = \"value\" ) signif <- head(pvals, 5) res_signif <- signif |> left_join(res_gather, by = c(\"name\", \"stat\")) #> Warning in left_join(signif, res_gather, by = c(\"name\", \"stat\")): Detected an unexpected many-to-many relationship between `x` and `y`. #> ℹ Row 1 of `x` matches multiple rows in `y`. #> ℹ Row 29037 of `y` matches multiple rows in `x`. #> ℹ If a many-to-many relationship is expected, set `relationship = #> \"many-to-many\"` to silence this warning. ggplot(res_signif, aes(x = value, color = type)) + stat_ecdf() + facet_grid(stat ~ name) + theme_cowplot() + scale_x_log10() + scale_color_brewer(palette = \"Set1\")"},{"path":"https://rnabioco.github.io/valr/dev/articles/interval-stats.html","id":"projection-test","dir":"Articles","previous_headings":"","what":"Projection test","title":"Interval statistics","text":"bed_projection() statistical approach assess relationship two intervals based binomial distribution. , examine distribution repetitive elements within promoters coding non-coding genes. First ’ll extract 5 kb regions upstream transcription start sites represent promoter regions coding non-coding genes. Next ’ll apply bed_projection() test repeat class coding non-coding regions. projection test two-tailed statistical test. significant p-value indicates either enrichment depletion query intervals compared reference interval sets. value lower_tail = TRUE column indicates query intervals depleted, whereas lower_tail = FALSE indicates query intervals enriched.","code":"# create intervals 5kb upstream of tss representing promoters promoters <- bed_flank(genes, genome, left = 5000, strand = TRUE) |> mutate(name = ifelse(grepl(\"NR_\", name), \"non-coding\", \"coding\")) |> select(chrom:strand) # select coding and non-coding promoters promoters_coding <- filter(promoters, name == \"coding\") promoters_ncoding <- filter(promoters, name == \"non-coding\") promoters_coding #> # A tibble: 973 × 6 #> chrom start end name score strand #> #> 1 chr22 16287937 16292937 coding 0 - #> 2 chr22 16449804 16454804 coding 0 - #> 3 chr22 17073700 17078700 coding 0 - #> 4 chr22 17302589 17307589 coding 0 - #> 5 chr22 17302589 17307589 coding 0 - #> 6 chr22 17489112 17494112 coding 0 - #> 7 chr22 17560848 17565848 coding 0 + #> 8 chr22 17560848 17565848 coding 0 + #> 9 chr22 17602213 17607213 coding 0 - #> 10 chr22 17602257 17607257 coding 0 - #> # ℹ 963 more rows promoters_ncoding #> # A tibble: 294 × 6 #> chrom start end name score strand #> #> 1 chr22 16152078 16157078 non-coding 0 + #> 2 chr22 16157065 16162065 non-coding 0 + #> 3 chr22 16157065 16162065 non-coding 0 + #> 4 chr22 16193009 16198009 non-coding 0 - #> 5 chr22 16231289 16236289 non-coding 0 - #> 6 chr22 16269608 16274608 non-coding 0 + #> 7 chr22 17077800 17082800 non-coding 0 + #> 8 chr22 17156430 17161430 non-coding 0 - #> 9 chr22 17229328 17234328 non-coding 0 - #> 10 chr22 17303363 17308363 non-coding 0 + #> # ℹ 284 more rows # function to apply bed_projection to groups projection_stats <- function(x, y, genome, group_var, type = NA) { group_by(x, !!rlang::sym(group_var)) |> do( n_repeats = nrow(.), projection = bed_projection(., y, genome) ) |> mutate(type = type) } pvals_coding <- projection_stats(rpts, promoters_coding, genome, \"name\", \"coding\") pvals_ncoding <- projection_stats(rpts, promoters_ncoding, genome, \"name\", \"non_coding\") pvals <- bind_rows(pvals_ncoding, pvals_coding) |> ungroup() |> tidyr::unnest(cols = c(n_repeats, projection)) |> select(-chrom) # filter for repeat classes with at least 10 intervals pvals <- filter( pvals, n_repeats > 10, obs_exp_ratio != 0 ) # adjust pvalues pvals <- mutate(pvals, q.value = p.adjust(p.value)) pvals #> # A tibble: 179 × 7 #> name n_repeats p.value obs_exp_ratio lower_tail type q.value #> #> 1 (A)n 28 0.00353 4.72 FALSE non_coding 0.558 #> 2 (AT)n 48 0.298 0.917 FALSE non_coding 1 #> 3 (CA)n 31 0.156 1.42 FALSE non_coding 1 #> 4 (GT)n 42 0.247 1.05 FALSE non_coding 1 #> 5 (T)n 61 0.405 0.721 FALSE non_coding 1 #> 6 (TG)n 40 0.0622 2.20 FALSE non_coding 1 #> 7 A-rich 54 0.348 0.815 FALSE non_coding 1 #> 8 Alu 15 0.0446 2.93 FALSE non_coding 1 #> 9 AluJb 271 0.0225 1.79 FALSE non_coding 1 #> 10 AluJo 208 0.0216 1.90 FALSE non_coding 1 #> # ℹ 169 more rows library(DT) # find and show top 5 most significant repeats signif_tests <- pvals |> arrange(q.value) |> group_by(type) |> top_n(-5, q.value) |> arrange(type) DT::datatable(signif_tests)"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"familiar-tools-natively-in-r","dir":"Articles","previous_headings":"","what":"Familiar tools, natively in R","title":"valr overview","text":"functions valr similar names BEDtools counterparts, familiar users coming BEDtools suite. Similar pybedtools, valr terse syntax:","code":"library(valr) library(dplyr) snps <- read_bed(valr_example(\"hg19.snps147.chr22.bed.gz\")) genes <- read_bed(valr_example(\"genes.hg19.chr22.bed.gz\")) # find snps in intergenic regions intergenic <- bed_subtract(snps, genes) # distance from intergenic snps to nearest gene nearby <- bed_closest(intergenic, genes) nearby |> select(starts_with(\"name\"), .overlap, .dist) |> filter(abs(.dist) < 1000) #> # A tibble: 285 × 4 #> name.x name.y .overlap .dist #> #> 1 rs2261631 P704P 0 -268 #> 2 rs570770556 POTEH 0 -913 #> 3 rs538163832 POTEH 0 -953 #> 4 rs9606135 TPTEP1 0 -422 #> 5 rs11912392 ANKRD62P1-PARP4P3 0 105 #> 6 rs8136454 BC038197 0 356 #> 7 rs5992556 XKR3 0 -456 #> 8 rs114101676 GAB4 0 474 #> 9 rs62236167 CECR7 0 262 #> 10 rs5747023 CECR1 0 -387 #> # ℹ 275 more rows"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"input-data","dir":"Articles","previous_headings":"","what":"Input data","title":"valr overview","text":"valr assigns common column names facilitate comparisons tbls. tbls chrom, start, end columns, tbls multi-column formats additional pre-determined column names. See read_bed() documentation details. valr can also operate BED-like data.frames already constructed R, provided columns named chrom, start end present. New tbls can also constructed either tibbles base R data.frames.","code":"bed_file <- valr_example(\"3fields.bed.gz\") read_bed(bed_file) # accepts filepaths or URLs #> # A tibble: 10 × 3 #> chrom start end #> #> 1 chr1 11873 14409 #> 2 chr1 14361 19759 #> 3 chr1 14406 29370 #> 4 chr1 34610 36081 #> 5 chr1 69090 70008 #> 6 chr1 134772 140566 #> 7 chr1 321083 321115 #> 8 chr1 321145 321207 #> 9 chr1 322036 326938 #> 10 chr1 327545 328439 bed <- tribble( ~chrom, ~start, ~end, \"chr1\", 1657492, 2657492, \"chr2\", 2501324, 3094650 ) bed #> # A tibble: 2 × 3 #> chrom start end #> #> 1 chr1 1657492 2657492 #> 2 chr2 2501324 3094650"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"interval-coordinates","dir":"Articles","previous_headings":"","what":"Interval coordinates","title":"valr overview","text":"valr adheres BED format specifies start position interval zero based end position one-based. first position chromosome 0. end position chromosome one position passed last base, included interval. example:","code":"# a chromosome 100 basepairs in length chrom <- tribble( ~chrom, ~start, ~end, \"chr1\", 0, 100 ) chrom #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 0 100 # single base-pair intervals bases <- tribble( ~chrom, ~start, ~end, \"chr1\", 0, 1, # first base of chromosome \"chr1\", 1, 2, # second base of chromosome \"chr1\", 99, 100 # last base of chromosome ) bases #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 0 1 #> 2 chr1 1 2 #> 3 chr1 99 100"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"remote-databases","dir":"Articles","previous_headings":"","what":"Remote databases","title":"valr overview","text":"Remote databases can accessed db_ucsc() (access UCSC Browser) db_ensembl() (access Ensembl databases).","code":"# access the `refGene` tbl on the `hg38` assembly. if (require(RMariaDB)) { ucsc <- db_ucsc(\"hg38\") tbl(ucsc, \"refGene\") }"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"visual-documentation","dir":"Articles","previous_headings":"","what":"Visual documentation","title":"valr overview","text":"bed_glyph() tool illustrates results operations valr, similar found BEDtools documentation. glyph shows result intersecting x y intervals bed_intersect(): glyph illustrates bed_merge():","code":"x <- tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tribble( ~chrom, ~start, ~end, \"chr1\", 30, 75 ) bed_glyph(bed_intersect(x, y)) x <- tribble( ~chrom, ~start, ~end, \"chr1\", 1, 50, \"chr1\", 10, 75, \"chr1\", 100, 120 ) bed_glyph(bed_merge(x))"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"grouping-data","dir":"Articles","previous_headings":"","what":"Grouping data","title":"valr overview","text":"group_by function dplyr can used perform functions subsets single multiple data_frames. Functions valr leverage grouping enable variety comparisons. example, intervals can grouped strand perform comparisons among intervals strand. Comparisons intervals opposite strands done using flip_strands() function: single set (e.g. bed_merge()) multi set operations respect groupings input intervals.","code":"x <- tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 1, 100, \"+\", \"chr1\", 50, 150, \"+\", \"chr2\", 100, 200, \"-\" ) y <- tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 50, 125, \"+\", \"chr1\", 50, 150, \"-\", \"chr2\", 50, 150, \"+\" ) # intersect tbls by strand x <- group_by(x, strand) y <- group_by(y, strand) bed_intersect(x, y) #> # A tibble: 2 × 8 #> chrom start.x end.x strand.x start.y end.y strand.y .overlap #> #> 1 chr1 1 100 + 50 125 + 50 #> 2 chr1 50 150 + 50 125 + 75 x <- group_by(x, strand) y <- flip_strands(y) y <- group_by(y, strand) bed_intersect(x, y) #> # A tibble: 3 × 8 #> chrom start.x end.x strand.x start.y end.y strand.y .overlap #> #> 1 chr1 1 100 + 50 150 + 50 #> 2 chr1 50 150 + 50 150 + 100 #> 3 chr2 100 200 - 50 150 - 50"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"column-specification","dir":"Articles","previous_headings":"","what":"Column specification","title":"valr overview","text":"Columns BEDtools referred position: valr, columns referred name can used multiple name/value expressions summaries.","code":"# calculate the mean of column 6 for intervals in `b` that overlap with `a` bedtools map -a a.bed -b b.bed -c 6 -o mean # calculate the mean and variance for a `value` column bed_map(a, b, .mean = mean(value), .var = var(value)) # report concatenated and max values for merged intervals bed_merge(a, .concat = concat(value), .max = max(value))"},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"meta-analysis","dir":"Articles","previous_headings":"Getting started","what":"Meta-analysis","title":"valr overview","text":"demonstration illustrates use valr tools perform “meta-analysis” signals relative genomic features. analyze distribution histone marks surrounding transcription start sites. First load libraries relevant data. generate 1 bp intervals represent transcription start sites (TSSs). focus + strand genes, - genes easily accommodated filtering using bed_makewindows() reversed window numbers. Now use .win_id group bed_map() calculate sum mapping y signals onto intervals x. data regrouped .win_id summary mean sd values calculated. Finally, summary statistics used construct plot illustrates histone density surrounding TSSs.","code":"# `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) genome <- read_genome(genomefile) y <- read_bedgraph(bgfile) # 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 × 7 #> chrom start end name score strand .win_id #> #> 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 #> # ℹ 13,520 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 × 3 #> .win_id win_mean win_sd #> #> 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 #> # ℹ 31 more rows 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 ) + labs( x = \"Position (bp from TSS)\", y = \"Signal\", title = \"Human H3K4me3 signal near transcription start sites\" ) + theme_classic()"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"related-work","dir":"Articles","previous_headings":"","what":"Related work","title":"valr overview","text":"Command-line tools BEDtools bedops. Python library pybedtools wraps BEDtools. R packages GenomicRanges, bedr, IRanges GenometriCorr provide similar capability different philosophy.","code":""},{"path":"https://rnabioco.github.io/valr/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jay Hesselberth. Author. Kent Riemondy. Author, maintainer. RNA Bioscience Initiative. Funder, copyright holder.","code":""},{"path":"https://rnabioco.github.io/valr/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Riemondy KA, Sheridan RM, Gillen , Yu Y, Bennett CG, Hesselberth JR (2017). “valr: Reproducible Genome Interval Arithmetic R.” F1000Research. doi:10.12688/f1000research.11997.1.","code":"@Article{, title = {valr: Reproducible Genome Interval Arithmetic in R}, year = {2017}, author = {Kent A. Riemondy and Ryan M. Sheridan and Austin Gillen and Yinni Yu and Christopher G. Bennett and Jay R. Hesselberth}, journal = {F1000Research}, doi = {10.12688/f1000research.11997.1}, }"},{"path":"https://rnabioco.github.io/valr/dev/index.html","id":"valr-","dir":"","previous_headings":"","what":"Genome Interval Arithmetic","title":"Genome Interval Arithmetic","text":"valr provides tools read manipulate genome intervals signals, similar BEDtools suite.","code":""},{"path":"https://rnabioco.github.io/valr/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Genome Interval Arithmetic","text":"","code":"# Install development version from GitHub # install.packages(\"pak\") pak::pak(\"rnabioco/valr\")"},{"path":"https://rnabioco.github.io/valr/dev/index.html","id":"valr-example","dir":"","previous_headings":"","what":"valr Example","title":"Genome Interval Arithmetic","text":"Functions valr similar names BEDtools counterparts, familiar users coming BEDtools suite. Unlike tools wrap BEDtools write temporary files disk, valr tools run natively memory. Similar pybedtools, valr terse syntax:","code":"library(valr) library(dplyr) snps <- read_bed(valr_example(\"hg19.snps147.chr22.bed.gz\")) genes <- read_bed(valr_example(\"genes.hg19.chr22.bed.gz\")) # 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 × 4 #> name.x name.y .overlap .dist #> #> 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 #> # ℹ 1,037 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert BED12 to individual exons in BED6. — bed12_to_exons","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"conversion BED6 format, score column contains exon number, respect strand (.e., first exon - strand genes larger start end coordinates).","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"","code":"bed12_to_exons(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"x ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) bed12_to_exons(x) #> # A tibble: 1,683 × 6 #> chrom start end name score strand #> #> 1 chr1 3204562 3207049 NM_001011874 3 - #> 2 chr1 3411782 3411982 NM_001011874 2 - #> 3 chr1 3660632 3661579 NM_001011874 1 - #> 4 chr1 4280926 4283093 NM_001195662 4 - #> 5 chr1 4341990 4342162 NM_001195662 3 - #> 6 chr1 4342282 4342918 NM_001195662 2 - #> 7 chr1 4399250 4399322 NM_001195662 1 - #> 8 chr1 4847774 4848057 NM_001159750 1 + #> 9 chr1 4847774 4848057 NM_011541 1 + #> 10 chr1 4848408 4848584 NM_001159751 1 + #> # ℹ 1,673 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute absolute distances between intervals. — bed_absdist","title":"Compute absolute distances between intervals. — bed_absdist","text":"Computes absolute distance midpoint x interval midpoints closest y interval.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute absolute distances between intervals. — bed_absdist","text":"","code":"bed_absdist(x, y, genome)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute absolute distances between intervals. — bed_absdist","text":"x ivl_df y ivl_df genome genome_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute absolute distances between intervals. — bed_absdist","text":"ivl_df .absdist .absdist_scaled columns.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute absolute distances between intervals. — bed_absdist","text":"Absolute distances scaled inter-reference gap chromosome follows. Q query points R reference points chromosome, scale distance query point closest reference point inter-reference gap chromosome. x interval matching y chromosome, .absdist NA. $$d_i(x,y) = min_k(|q_i - r_k|)\\frac{R}{Length\\ \\ chromosome}$$ absolute scaled distances reported .absdist .absdist_scaled. Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute absolute distances between intervals. — bed_absdist","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_absdist(x, y, genome) #> # A tibble: 1,000,000 × 5 #> chrom start end .absdist .absdist_scaled #> #> 1 chr1 5184 6184 1392 0.448 #> 2 chr1 7663 8663 1087 0.350 #> 3 chr1 9858 10858 1526 0.491 #> 4 chr1 13805 14805 2421 0.779 #> 5 chr1 14081 15081 2697 0.868 #> 6 chr1 16398 17398 1700 0.547 #> 7 chr1 17486 18486 612 0.197 #> 8 chr1 22063 23063 466 0.150 #> 9 chr1 22494 23494 897 0.289 #> 10 chr1 29351 30351 1143 0.368 #> # ℹ 999,990 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify closest intervals. — bed_closest","title":"Identify closest intervals. — bed_closest","text":"Identify closest intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify closest intervals. — bed_closest","text":"","code":"bed_closest(x, y, overlap = TRUE, suffix = c(\".x\", \".y\"))"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify closest intervals. — bed_closest","text":"x ivl_df y ivl_df overlap report overlapping intervals suffix colname suffixes output","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify closest intervals. — bed_closest","text":"ivl_df additional columns: .overlap amount overlap overlapping interval. Non-overlapping adjacent intervals overlap 0. .overlap included output overlap = FALSE. .dist distance closest interval. Negative distances denote upstream intervals. Book-ended intervals distance 1.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify closest intervals. — bed_closest","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Identify closest intervals. — bed_closest","text":"interval x bed_closest() returns overlapping intervals y closest non-intersecting y interval. Setting overlap = FALSE report closest non-intersecting y intervals, ignoring overlapping y intervals.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify closest intervals. — bed_closest","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 140, 175 ) bed_glyph(bed_closest(x, y)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 500, 600, \"chr2\", 5000, 6000 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 200, \"chr1\", 150, 200, \"chr1\", 550, 580, \"chr2\", 7000, 8500 ) bed_closest(x, y) #> # A tibble: 4 × 7 #> chrom start.x end.x start.y end.y .overlap .dist #> #> 1 chr1 500 600 550 580 30 0 #> 2 chr1 500 600 100 200 0 -301 #> 3 chr1 500 600 150 200 0 -301 #> 4 chr2 5000 6000 7000 8500 0 1001 bed_closest(x, y, overlap = FALSE) #> # A tibble: 3 × 6 #> chrom start.x end.x start.y end.y .dist #> #> 1 chr1 500 600 100 200 -301 #> 2 chr1 500 600 150 200 -301 #> 3 chr2 5000 6000 7000 8500 1001 # Report distance based on strand x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 10, 20, \"a\", 1, \"-\" ) y <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 8, 9, \"b\", 1, \"+\", \"chr1\", 21, 22, \"b\", 1, \"-\" ) res <- bed_closest(x, y) # convert distance based on strand res$.dist_strand <- ifelse(res$strand.x == \"+\", res$.dist, -(res$.dist)) res #> # A tibble: 2 × 14 #> chrom start.x end.x name.x score.x strand.x start.y end.y name.y score.y #> #> 1 chr1 10 20 a 1 - 21 22 b 1 #> 2 chr1 10 20 a 1 - 8 9 b 1 #> # ℹ 4 more variables: strand.y , .overlap , .dist , #> # .dist_strand # report absolute distances res$.abs_dist <- abs(res$.dist) res #> # A tibble: 2 × 15 #> chrom start.x end.x name.x score.x strand.x start.y end.y name.y score.y #> #> 1 chr1 10 20 a 1 - 21 22 b 1 #> 2 chr1 10 20 a 1 - 8 9 b 1 #> # ℹ 5 more variables: strand.y , .overlap , .dist , #> # .dist_strand , .abs_dist "},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":null,"dir":"Reference","previous_headings":"","what":"Cluster neighboring intervals. — bed_cluster","title":"Cluster neighboring intervals. — bed_cluster","text":"output .id column can used downstream grouping operations. Default max_dist = 0 means overlapping book-ended intervals clustered.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cluster neighboring intervals. — bed_cluster","text":"","code":"bed_cluster(x, max_dist = 0)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cluster neighboring intervals. — bed_cluster","text":"x ivl_df max_dist maximum distance clustered intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cluster neighboring intervals. — bed_cluster","text":"ivl_df .id column specifying sets clustered intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cluster neighboring intervals. — bed_cluster","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cluster neighboring intervals. — bed_cluster","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 200, \"chr1\", 180, 250, \"chr1\", 250, 500, \"chr1\", 501, 1000, \"chr2\", 1, 100, \"chr2\", 150, 200 ) bed_cluster(x) #> # A tibble: 6 × 4 #> chrom start end .id #> #> 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 <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 10, \"chr1\", 5, 20, \"chr1\", 30, 40, \"chr1\", 40, 50, \"chr1\", 80, 90 ) bed_glyph(bed_cluster(x), label = \".id\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify intervals in a genome not covered by a query. — bed_complement","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"Identify intervals genome covered query.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"","code":"bed_complement(x, genome)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"x ivl_df genome ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 0, 10, \"chr1\", 75, 100 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 200 ) bed_glyph(bed_complement(x, genome)) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 500, \"chr2\", 600, \"chr3\", 800 ) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 300, \"chr1\", 200, 400, \"chr2\", 0, 100, \"chr2\", 200, 400, \"chr3\", 500, 600 ) # intervals not covered by x bed_complement(x, genome) #> # A tibble: 6 × 3 #> chrom start end #> #> 1 chr1 0 100 #> 2 chr1 400 500 #> 3 chr2 100 200 #> 4 chr2 400 600 #> 5 chr3 0 500 #> 6 chr3 600 800"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute coverage of intervals. — bed_coverage","title":"Compute coverage of intervals. — bed_coverage","text":"Compute coverage intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute coverage of intervals. — bed_coverage","text":"","code":"bed_coverage(x, y, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute coverage of intervals. — bed_coverage","text":"x ivl_df y ivl_df ... extra arguments (used)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute coverage of intervals. — bed_coverage","text":"ivl_df following additional columns: .ints number x intersections .cov per-base coverage x intervals .len total length y intervals covered x intervals .frac .len scaled number y intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute coverage of intervals. — bed_coverage","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Compute coverage of intervals. — bed_coverage","text":"Book-ended intervals included coverage calculations.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute coverage of intervals. — bed_coverage","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 100, 500, \"+\", \"chr2\", 200, 400, \"+\", \"chr2\", 300, 500, \"-\", \"chr2\", 800, 900, \"-\" ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 150, 400, 100, \"+\", \"chr1\", 500, 550, 100, \"+\", \"chr2\", 230, 430, 200, \"-\", \"chr2\", 350, 430, 300, \"-\" ) bed_coverage(x, y) #> # A tibble: 4 × 8 #> chrom start end strand .ints .cov .len .frac #> #> 1 chr1 100 500 + 2 250 400 0.625 #> 2 chr2 200 400 + 2 170 200 0.85 #> 3 chr2 300 500 - 2 130 200 0.65 #> 4 chr2 800 900 - 0 0 100 0"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":null,"dir":"Reference","previous_headings":"","what":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"Calculate Fisher's test number intervals shared unique two sets x y intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"","code":"bed_fisher(x, y, genome)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"x ivl_df y ivl_df genome genome_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, n = 1e4, seed = 1010486) y <- bed_random(genome, n = 1e4, seed = 9203911) bed_fisher(x, y, genome) #> # A tibble: 1 × 6 #> estimate p.value conf.low conf.high method alternative #> #> 1 0.945 0.707 0.722 1.22 Fisher's Exact Test for Count… two.sided"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":null,"dir":"Reference","previous_headings":"","what":"Create flanking intervals from input intervals. — bed_flank","title":"Create flanking intervals from input intervals. — bed_flank","text":"Create flanking intervals input intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create flanking intervals from input intervals. — bed_flank","text":"","code":"bed_flank( x, genome, both = 0, left = 0, right = 0, fraction = FALSE, strand = FALSE, trim = FALSE, ... )"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create flanking intervals from input intervals. — bed_flank","text":"x ivl_df genome genome_df number bases sizes left number bases left side right number bases right side fraction define flanks based fraction interval length strand define left right based strand trim adjust coordinates --bounds intervals ... extra arguments (used)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create flanking intervals from input intervals. — bed_flank","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create flanking intervals from input intervals. — bed_flank","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 130 ) bed_glyph(bed_flank(x, genome, both = 20)) x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 500, 1000, \".\", \".\", \"+\", \"chr1\", 1000, 1500, \".\", \".\", \"-\" ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 5000 ) bed_flank(x, genome, left = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 400 500 . . + #> 2 chr1 900 1000 . . - bed_flank(x, genome, right = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 1000 1100 . . + #> 2 chr1 1500 1600 . . - bed_flank(x, genome, both = 100) #> # A tibble: 4 × 6 #> chrom start end name score strand #> #> 1 chr1 400 500 . . + #> 2 chr1 900 1000 . . - #> 3 chr1 1000 1100 . . + #> 4 chr1 1500 1600 . . - bed_flank(x, genome, both = 0.5, fraction = TRUE) #> # A tibble: 4 × 6 #> chrom start end name score strand #> #> 1 chr1 250 500 . . + #> 2 chr1 750 1000 . . - #> 3 chr1 1000 1250 . . + #> 4 chr1 1500 1750 . . -"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate coverage across a genome — bed_genomecov","title":"Calculate coverage across a genome — bed_genomecov","text":"function useful calculating interval coverage across entire genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate coverage across a genome — bed_genomecov","text":"","code":"bed_genomecov(x, genome, zero_depth = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate coverage across a genome — bed_genomecov","text":"x ivl_df genome genome_df zero_depth TRUE, report intervals zero depth. Zero depth intervals reported respect groups.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate coverage across a genome — bed_genomecov","text":"ivl_df additional column: .depth depth interval coverage","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate coverage across a genome — bed_genomecov","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate coverage across a genome — bed_genomecov","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 20, 70, \"+\", \"chr1\", 50, 100, \"-\", \"chr1\", 200, 250, \"+\", \"chr1\", 220, 250, \"+\" ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 500, \"chr2\", 1000 ) bed_genomecov(x, genome) #> # A tibble: 5 × 4 #> chrom start end .depth #> #> 1 chr1 20 50 1 #> 2 chr1 50 70 2 #> 3 chr1 70 100 1 #> 4 chr1 200 220 1 #> 5 chr1 220 250 2 bed_genomecov(dplyr::group_by(x, strand), genome) #> # A tibble: 4 × 5 #> chrom start end strand .depth #> #> 1 chr1 20 70 + 1 #> 2 chr1 200 220 + 1 #> 3 chr1 220 250 + 2 #> 4 chr1 50 100 - 1 bed_genomecov(dplyr::group_by(x, strand), genome, zero_depth = TRUE) #> # A tibble: 11 × 5 #> chrom start end strand .depth #> #> 1 chr1 0 20 + 0 #> 2 chr1 0 50 - 0 #> 3 chr1 20 70 + 1 #> 4 chr1 50 100 - 1 #> 5 chr1 70 200 + 0 #> 6 chr1 100 500 - 0 #> 7 chr1 200 220 + 1 #> 8 chr1 220 250 + 2 #> 9 chr1 250 500 + 0 #> 10 chr2 0 1000 + 0 #> 11 chr2 0 1000 - 0"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"Create example glyphs for valr functions. — bed_glyph","title":"Create example glyphs for valr functions. — bed_glyph","text":"Used illustrate output valr functions small examples.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create example glyphs for valr functions. — bed_glyph","text":"","code":"bed_glyph(expr, label = NULL)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create example glyphs for valr functions. — bed_glyph","text":"expr expression evaluate label column name use label values. present result call.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create example glyphs for valr functions. — bed_glyph","text":"ggplot2::ggplot()","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create example glyphs for valr functions. — bed_glyph","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, \"chr1\", 30, 75, 50 ) bed_glyph(bed_intersect(x, y)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 30, 75, \"chr1\", 50, 90, \"chr1\", 91, 120 ) bed_glyph(bed_merge(x)) bed_glyph(bed_cluster(x), label = \".id\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify intersecting intervals. — bed_intersect","title":"Identify intersecting intervals. — bed_intersect","text":"Report intersecting intervals x y tbls. Book-ended intervals .overlap values 0 output.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify intersecting intervals. — bed_intersect","text":"","code":"bed_intersect(x, ..., invert = FALSE, suffix = c(\".x\", \".y\"))"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify intersecting intervals. — bed_intersect","text":"x ivl_df ... one (e.g. list ) y ivl_df()s invert report x intervals y suffix colname suffixes output","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify intersecting intervals. — bed_intersect","text":"ivl_df original columns x y suffixed .x .y, new .overlap column extent overlap intersecting intervals. multiple y tbls supplied, .source contains variable names associated interval. original columns y suffixed .y output. ... contains named inputs (.e = y, b = z list(= y, b = z)), .source contain supplied names (see examples).","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify intersecting intervals. — bed_intersect","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify intersecting intervals. — bed_intersect","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 30, 75 ) bed_glyph(bed_intersect(x, y)) bed_glyph(bed_intersect(x, y, invert = TRUE)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 500, \"chr2\", 200, 400, \"chr2\", 300, 500, \"chr2\", 800, 900 ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, \"chr1\", 150, 400, 100, \"chr1\", 500, 550, 100, \"chr2\", 230, 430, 200, \"chr2\", 350, 430, 300 ) bed_intersect(x, y) #> # A tibble: 6 × 7 #> chrom start.x end.x start.y end.y value.y .overlap #> #> 1 chr1 100 500 150 400 100 250 #> 2 chr1 100 500 500 550 100 0 #> 3 chr2 200 400 230 430 200 170 #> 4 chr2 200 400 350 430 300 50 #> 5 chr2 300 500 230 430 200 130 #> 6 chr2 300 500 350 430 300 80 bed_intersect(x, y, invert = TRUE) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr2 800 900 # start and end of each overlapping interval res <- bed_intersect(x, y) dplyr::mutate(res, start = pmax(start.x, start.y), end = pmin(end.x, end.y) ) #> # A tibble: 6 × 9 #> chrom start.x end.x start.y end.y value.y .overlap start end #> #> 1 chr1 100 500 150 400 100 250 150 400 #> 2 chr1 100 500 500 550 100 0 500 500 #> 3 chr2 200 400 230 430 200 170 230 400 #> 4 chr2 200 400 350 430 300 50 350 400 #> 5 chr2 300 500 230 430 200 130 300 430 #> 6 chr2 300 500 350 430 300 80 350 430 z <- tibble::tribble( ~chrom, ~start, ~end, ~value, \"chr1\", 150, 400, 100, \"chr1\", 500, 550, 100, \"chr2\", 230, 430, 200, \"chr2\", 750, 900, 400 ) bed_intersect(x, y, z) #> # A tibble: 11 × 8 #> chrom start.x end.x start.y end.y value.y .source .overlap #> #> 1 chr1 100 500 150 400 100 y 250 #> 2 chr1 100 500 150 400 100 z 250 #> 3 chr1 100 500 500 550 100 y 0 #> 4 chr1 100 500 500 550 100 z 0 #> 5 chr2 200 400 230 430 200 y 170 #> 6 chr2 200 400 230 430 200 z 170 #> 7 chr2 200 400 350 430 300 y 50 #> 8 chr2 300 500 230 430 200 y 130 #> 9 chr2 300 500 230 430 200 z 130 #> 10 chr2 300 500 350 430 300 y 80 #> 11 chr2 800 900 750 900 400 z 100 bed_intersect(x, exons = y, introns = z) #> # A tibble: 11 × 8 #> chrom start.x end.x start.y end.y value.y .source .overlap #> #> 1 chr1 100 500 150 400 100 exons 250 #> 2 chr1 100 500 150 400 100 introns 250 #> 3 chr1 100 500 500 550 100 exons 0 #> 4 chr1 100 500 500 550 100 introns 0 #> 5 chr2 200 400 230 430 200 exons 170 #> 6 chr2 200 400 230 430 200 introns 170 #> 7 chr2 200 400 350 430 300 exons 50 #> 8 chr2 300 500 230 430 200 exons 130 #> 9 chr2 300 500 230 430 200 introns 130 #> 10 chr2 300 500 350 430 300 exons 80 #> 11 chr2 800 900 750 900 400 introns 100 # a list of tbl_intervals can also be passed bed_intersect(x, list(exons = y, introns = z)) #> # A tibble: 11 × 8 #> chrom start.x end.x start.y end.y value.y .source .overlap #> #> 1 chr1 100 500 150 400 100 exons 250 #> 2 chr1 100 500 150 400 100 introns 250 #> 3 chr1 100 500 500 550 100 exons 0 #> 4 chr1 100 500 500 550 100 introns 0 #> 5 chr2 200 400 230 430 200 exons 170 #> 6 chr2 200 400 230 430 200 introns 170 #> 7 chr2 200 400 350 430 300 exons 50 #> 8 chr2 300 500 230 430 200 exons 130 #> 9 chr2 300 500 230 430 200 introns 130 #> 10 chr2 300 500 350 430 300 exons 80 #> 11 chr2 800 900 750 900 400 introns 100"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"Quantifies extent overlap sets intervals terms base-pairs. Groups shared input used calculate statistic subsets data.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"","code":"bed_jaccard(x, y)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"x ivl_df y ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"tibble following columns: len_i length intersection base-pairs len_u length union base-pairs jaccard value jaccard statistic n_int number intersecting intervals x y inputs grouped, return value contain one set values per group.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"Jaccard statistic takes values [0,1] measured : $$ J(x,y) = \\frac{\\mid x \\bigcap y \\mid} {\\mid x \\bigcup y \\mid} = \\frac{\\mid x \\bigcap y \\mid} {\\mid x \\mid + \\mid y \\mid - \\mid x \\bigcap y \\mid} $$ Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_jaccard(x, y) #> # A tibble: 1 × 4 #> len_i len_u jaccard n #> #> 1 236184699 1708774142 0.160 399981 # calculate jaccard per chromosome bed_jaccard( dplyr::group_by(x, chrom), dplyr::group_by(y, chrom) ) #> # A tibble: 25 × 5 #> chrom len_i len_u jaccard n #> #> 1 chr1 18939046 137345996 0.160 32156 #> 2 chr10 10524360 75209830 0.163 17830 #> 3 chr11 10378246 74655177 0.161 17497 #> 4 chr12 10146255 73725046 0.160 17163 #> 5 chr13 8867024 63737541 0.162 14992 #> 6 chr14 8047103 59033144 0.158 13647 #> 7 chr15 7794057 56514322 0.160 13236 #> 8 chr16 6907575 49874077 0.161 11650 #> 9 chr17 6186446 44917522 0.160 10487 #> 10 chr18 6044900 43248877 0.162 10129 #> # ℹ 15 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":null,"dir":"Reference","previous_headings":"","what":"Divide intervals into new sub-intervals (","title":"Divide intervals into new sub-intervals (","text":"Divide intervals new sub-intervals (\"windows\").","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Divide intervals into new sub-intervals (","text":"","code":"bed_makewindows(x, win_size = 0, step_size = 0, num_win = 0, reverse = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Divide intervals into new sub-intervals (","text":"x ivl_df win_size divide intervals fixed-size windows step_size size step next window num_win divide intervals fixed number windows reverse reverse window numbers","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Divide intervals into new sub-intervals (","text":"ivl_df .win_id column contains numeric identifier window.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Divide intervals into new sub-intervals (","text":"name .win_id columns can used create new interval names (see 'namenum' example ) subsequent group_by operations (see vignette).","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Divide intervals into new sub-intervals (","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 100, 200, \"A\", \".\", \"+\" ) bed_glyph(bed_makewindows(x, num_win = 10), label = \".win_id\") # Fixed number of windows bed_makewindows(x, num_win = 10) #> # A tibble: 10 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 1 #> 2 chr1 110 120 A . + 2 #> 3 chr1 120 130 A . + 3 #> 4 chr1 130 140 A . + 4 #> 5 chr1 140 150 A . + 5 #> 6 chr1 150 160 A . + 6 #> 7 chr1 160 170 A . + 7 #> 8 chr1 170 180 A . + 8 #> 9 chr1 180 190 A . + 9 #> 10 chr1 190 200 A . + 10 # Fixed window size bed_makewindows(x, win_size = 10) #> # A tibble: 10 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 1 #> 2 chr1 110 120 A . + 2 #> 3 chr1 120 130 A . + 3 #> 4 chr1 130 140 A . + 4 #> 5 chr1 140 150 A . + 5 #> 6 chr1 150 160 A . + 6 #> 7 chr1 160 170 A . + 7 #> 8 chr1 170 180 A . + 8 #> 9 chr1 180 190 A . + 9 #> 10 chr1 190 200 A . + 10 # Fixed window size with overlaps bed_makewindows(x, win_size = 10, step_size = 5) #> # A tibble: 20 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 1 #> 2 chr1 105 115 A . + 2 #> 3 chr1 110 120 A . + 3 #> 4 chr1 115 125 A . + 4 #> 5 chr1 120 130 A . + 5 #> 6 chr1 125 135 A . + 6 #> 7 chr1 130 140 A . + 7 #> 8 chr1 135 145 A . + 8 #> 9 chr1 140 150 A . + 9 #> 10 chr1 145 155 A . + 10 #> 11 chr1 150 160 A . + 11 #> 12 chr1 155 165 A . + 12 #> 13 chr1 160 170 A . + 13 #> 14 chr1 165 175 A . + 14 #> 15 chr1 170 180 A . + 15 #> 16 chr1 175 185 A . + 16 #> 17 chr1 180 190 A . + 17 #> 18 chr1 185 195 A . + 18 #> 19 chr1 190 200 A . + 19 #> 20 chr1 195 200 A . + 20 # reverse win_id bed_makewindows(x, win_size = 10, reverse = TRUE) #> # A tibble: 10 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 10 #> 2 chr1 110 120 A . + 9 #> 3 chr1 120 130 A . + 8 #> 4 chr1 130 140 A . + 7 #> 5 chr1 140 150 A . + 6 #> 6 chr1 150 160 A . + 5 #> 7 chr1 160 170 A . + 4 #> 8 chr1 170 180 A . + 3 #> 9 chr1 180 190 A . + 2 #> 10 chr1 190 200 A . + 1 # bedtools 'namenum' wins <- bed_makewindows(x, win_size = 10) dplyr::mutate(wins, namenum = stringr::str_c(name, \"_\", .win_id)) #> # A tibble: 10 × 8 #> chrom start end name score strand .win_id namenum #> #> 1 chr1 100 110 A . + 1 A_1 #> 2 chr1 110 120 A . + 2 A_2 #> 3 chr1 120 130 A . + 3 A_3 #> 4 chr1 130 140 A . + 4 A_4 #> 5 chr1 140 150 A . + 5 A_5 #> 6 chr1 150 160 A . + 6 A_6 #> 7 chr1 160 170 A . + 7 A_7 #> 8 chr1 170 180 A . + 8 A_8 #> 9 chr1 180 190 A . + 9 A_9 #> 10 chr1 190 200 A . + 10 A_10"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate summaries from overlapping intervals. — bed_map","title":"Calculate summaries from overlapping intervals. — bed_map","text":"Apply functions like min() max() intersecting intervals. bed_map() uses bed_intersect() identify intersecting intervals, output columns suffixed .x .y. Expressions refer input columns x y columns must take suffixes account.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate summaries from overlapping intervals. — bed_map","text":"","code":"bed_map(x, y, ..., min_overlap = 1) concat(.data, sep = \",\") values_unique(.data, sep = \",\") values(.data, sep = \",\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate summaries from overlapping intervals. — bed_map","text":"x ivl_df y ivl_df ... name-value pairs specifying column names expressions apply min_overlap minimum overlap intervals. .data data sep separator character","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate summaries from overlapping intervals. — bed_map","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate summaries from overlapping intervals. — bed_map","text":"Book-ended intervals can included setting min_overlap = 0. Non-intersecting intervals x included result NA values. input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate summaries from overlapping intervals. — bed_map","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, 'chr1', 100, 250, 'chr2', 250, 500 ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, 'chr1', 100, 250, 10, 'chr1', 150, 250, 20, 'chr2', 250, 500, 500 ) bed_glyph(bed_map(x, y, value = sum(value)), label = 'value') # summary examples bed_map(x, y, .sum = sum(value)) #> # A tibble: 2 × 4 #> chrom start end .sum #> #> 1 chr1 100 250 30 #> 2 chr2 250 500 500 bed_map(x, y, .min = min(value), .max = max(value)) #> # A tibble: 2 × 5 #> chrom start end .min .max #> #> 1 chr1 100 250 10 20 #> 2 chr2 250 500 500 500 # identify non-intersecting intervals to include in the result res <- bed_map(x, y, .sum = sum(value)) x_not <- bed_intersect(x, y, invert = TRUE) dplyr::bind_rows(res, x_not) #> # A tibble: 2 × 4 #> chrom start end .sum #> #> 1 chr1 100 250 30 #> 2 chr2 250 500 500 # create a list-column bed_map(x, y, .values = list(value)) #> # A tibble: 2 × 4 #> chrom start end .values #> #> 1 chr1 100 250 #> 2 chr2 250 500 # use `nth` family from dplyr bed_map(x, y, .first = dplyr::first(value)) #> # A tibble: 2 × 4 #> chrom start end .first #> #> 1 chr1 100 250 10 #> 2 chr2 250 500 500 bed_map(x, y, .absmax = abs(max(value))) #> # A tibble: 2 × 4 #> chrom start end .absmax #> #> 1 chr1 100 250 20 #> 2 chr2 250 500 500 bed_map(x, y, .count = length(value)) #> # A tibble: 2 × 4 #> chrom start end .count #> #> 1 chr1 100 250 2 #> 2 chr2 250 500 1 bed_map(x, y, .vals = values(value)) #> # A tibble: 2 × 4 #> chrom start end .vals #> #> 1 chr1 100 250 10,20 #> 2 chr2 250 500 500 # count defaults are NA not 0; differs from bedtools2 ... bed_map(x, y, .counts = dplyr::n()) #> # A tibble: 2 × 4 #> chrom start end .counts #> #> 1 chr1 100 250 2 #> 2 chr2 250 500 1 # ... but NA counts can be coverted to 0's dplyr::mutate(bed_map(x, y, .counts = dplyr::n()), .counts = ifelse(is.na(.counts), 0, .counts)) #> # A tibble: 2 × 4 #> chrom start end .counts #> #> 1 chr1 100 250 2 #> 2 chr2 250 500 1"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge overlapping intervals. — bed_merge","title":"Merge overlapping intervals. — bed_merge","text":"Operations can performed merged intervals specifying name-value pairs. Default max_dist 0 means book-ended intervals merged.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge overlapping intervals. — bed_merge","text":"","code":"bed_merge(x, max_dist = 0, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge overlapping intervals. — bed_merge","text":"x ivl_df max_dist maximum distance intervals merge ... name-value pairs specify operations merged intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Merge overlapping intervals. — bed_merge","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Merge overlapping intervals. — bed_merge","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Merge overlapping intervals. — bed_merge","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 50, \"chr1\", 10, 75, \"chr1\", 100, 120 ) bed_glyph(bed_merge(x)) x <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 1, 50, 1, \"+\", \"chr1\", 100, 200, 2, \"+\", \"chr1\", 150, 250, 3, \"-\", \"chr2\", 1, 25, 4, \"+\", \"chr2\", 200, 400, 5, \"-\", \"chr2\", 400, 500, 6, \"+\", \"chr2\", 450, 550, 7, \"+\" ) bed_merge(x) #> # A tibble: 4 × 3 #> chrom start end #> #> 1 chr1 1 50 #> 2 chr1 100 250 #> 3 chr2 1 25 #> 4 chr2 200 550 bed_merge(x, max_dist = 100) #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 1 250 #> 2 chr2 1 25 #> 3 chr2 200 550 # merge intervals on same strand bed_merge(dplyr::group_by(x, strand)) #> # A tibble: 6 × 4 #> # Groups: strand [2] #> chrom start end strand #> #> 1 chr1 1 50 + #> 2 chr1 100 200 + #> 3 chr1 150 250 - #> 4 chr2 1 25 + #> 5 chr2 400 550 + #> 6 chr2 200 400 - bed_merge(x, .value = sum(value)) #> # A tibble: 4 × 4 #> chrom start end .value #> #> 1 chr1 1 50 1 #> 2 chr1 100 250 5 #> 3 chr2 1 25 4 #> 4 chr2 200 550 18"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":null,"dir":"Reference","previous_headings":"","what":"Partition intervals into elemental intervals — bed_partition","title":"Partition intervals into elemental intervals — bed_partition","text":"Convert set intervals elemental intervals contain start end position set.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Partition intervals into elemental intervals — bed_partition","text":"","code":"bed_partition(x, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Partition intervals into elemental intervals — bed_partition","text":"x ivl_df ... name-value pairs specifying column names expressions apply","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Partition intervals into elemental intervals — bed_partition","text":"ivl_df()","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Partition intervals into elemental intervals — bed_partition","text":"Summary operations, min() max() can performed elemental intervals specifying name-value pairs. function useful calculating summaries across overlapping intervals without merging intervals. input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Partition intervals into elemental intervals — bed_partition","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 100, 500, 10, \"+\", \"chr1\", 200, 400, 20, \"-\", \"chr1\", 300, 550, 30, \"+\", \"chr1\", 550, 575, 2, \"+\", \"chr1\", 800, 900, 5, \"+\" ) bed_glyph(bed_partition(x)) bed_glyph(bed_partition(x, value = sum(value)), label = \"value\") bed_partition(x) #> # A tibble: 7 × 3 #> chrom start end #> #> 1 chr1 100 200 #> 2 chr1 200 300 #> 3 chr1 300 400 #> 4 chr1 400 500 #> 5 chr1 500 550 #> 6 chr1 550 575 #> 7 chr1 800 900 # compute summary over each elemental interval bed_partition(x, value = sum(value)) #> # A tibble: 7 × 4 #> chrom start end value #> #> 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 × 5 #> chrom start end strand value #> #> 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 <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 10, 500, 100, \"+\", \"chr1\", 250, 420, 200, \"-\", \"chr1\", 350, 550, 300, \"+\", \"chr1\", 550, 555, 20, \"+\", \"chr1\", 800, 900, 50, \"+\" ) x <- dplyr::bind_rows(x, y) bed_partition(x, value = sum(value)) #> # A tibble: 11 × 5 #> chrom start end strand value #> #> 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"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":null,"dir":"Reference","previous_headings":"","what":"Projection test for query interval overlap. — bed_projection","title":"Projection test for query interval overlap. — bed_projection","text":"Projection test query interval overlap.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projection test for query interval overlap. — bed_projection","text":"","code":"bed_projection(x, y, genome, by_chrom = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Projection test for query interval overlap. — bed_projection","text":"x ivl_df y ivl_df genome genome_df by_chrom compute test per chromosome","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Projection test for query interval overlap. — bed_projection","text":"ivl_df following columns: chrom name chromosome tested by_chrom = TRUE, otherwise value whole_genome p.value p-value binomial test. p-values > 0.5 converted 1 - p-value lower_tail FALSE obs_exp_ratio ratio observed expected overlap frequency lower_tail TRUE indicates observed overlaps lower tail distribution (e.g., less overlap expected). FALSE indicates observed overlaps upper tail distribution (e.g., overlap expected)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Projection test for query interval overlap. — bed_projection","text":"Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Projection test for query interval overlap. — bed_projection","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_projection(x, y, genome) #> # A tibble: 1 × 4 #> chrom p.value obs_exp_ratio lower_tail #> #> 1 whole_genome 0.000850 1.01 FALSE bed_projection(x, y, genome, by_chrom = TRUE) #> # A tibble: 25 × 4 #> chrom p.value obs_exp_ratio lower_tail #> #> 1 chr1 0.176 1.01 FALSE #> 2 chr10 0.0209 1.02 FALSE #> 3 chr11 0.118 1.01 FALSE #> 4 chr12 0.479 1.00 FALSE #> 5 chr13 0.245 1.01 FALSE #> 6 chr14 0.120 0.990 TRUE #> 7 chr15 0.333 1.00 FALSE #> 8 chr16 0.213 1.01 FALSE #> 9 chr17 0.181 0.991 TRUE #> 10 chr18 0.0306 1.02 FALSE #> # ℹ 15 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate randomly placed intervals on a genome. — bed_random","title":"Generate randomly placed intervals on a genome. — bed_random","text":"Generate randomly placed intervals genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate randomly placed intervals on a genome. — bed_random","text":"","code":"bed_random(genome, length = 1000, n = 1e+06, seed = 0, sorted = TRUE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate randomly placed intervals on a genome. — bed_random","text":"genome genome_df length length intervals n number intervals generate seed seed RNG reproducible intervals sorted return sorted output","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate randomly placed intervals on a genome. — bed_random","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate randomly placed intervals on a genome. — bed_random","text":"Sorting can suppressed sorted = FALSE.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate randomly placed intervals on a genome. — bed_random","text":"","code":"genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 10000000, \"chr2\", 50000000, \"chr3\", 60000000, \"chrX\", 5000000 ) bed_random(genome, seed = 10104) #> # A tibble: 1,000,000 × 3 #> chrom start end #> #> 1 chr1 265 1265 #> 2 chr1 315 1315 #> 3 chr1 335 1335 #> 4 chr1 513 1513 #> 5 chr1 625 1625 #> 6 chr1 635 1635 #> 7 chr1 653 1653 #> 8 chr1 731 1731 #> 9 chr1 859 1859 #> 10 chr1 1024 2024 #> # ℹ 999,990 more rows # sorting can be suppressed bed_random(genome, sorted = FALSE, seed = 10104) #> # A tibble: 1,000,000 × 3 #> chrom start end #> #> 1 chr3 2681468 2682468 #> 2 chr3 25364020 25365020 #> 3 chr2 43134407 43135407 #> 4 chr2 36344257 36345257 #> 5 chr3 39019690 39020690 #> 6 chr3 59869387 59870387 #> 7 chr3 56220373 56221373 #> 8 chr3 57965913 57966913 #> 9 chr2 25303342 25304342 #> 10 chr3 16018594 16019594 #> # ℹ 999,990 more rows # 500 random intervals of length 500 bed_random(genome, length = 500, n = 500, seed = 10104) #> # A tibble: 500 × 3 #> chrom start end #> #> 1 chr1 379360 379860 #> 2 chr1 394770 395270 #> 3 chr1 1215880 1216380 #> 4 chr1 1339287 1339787 #> 5 chr1 2046513 2047013 #> 6 chr1 2156755 2157255 #> 7 chr1 2189109 2189609 #> 8 chr1 2221665 2222165 #> 9 chr1 2223456 2223956 #> 10 chr1 2253135 2253635 #> # ℹ 490 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute relative distances between intervals. — bed_reldist","title":"Compute relative distances between intervals. — bed_reldist","text":"Compute relative distances intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute relative distances between intervals. — bed_reldist","text":"","code":"bed_reldist(x, y, detail = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute relative distances between intervals. — bed_reldist","text":"x ivl_df y ivl_df detail report relative distances x interval.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute relative distances between intervals. — bed_reldist","text":"detail = FALSE, ivl_df summarizes calculated .reldist values following columns: .reldist relative distance metric .counts number metric observations .total total observations .freq frequency observation detail = TRUE, .reldist column reports relative distance input x interval.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute relative distances between intervals. — bed_reldist","text":"Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute relative distances between intervals. — bed_reldist","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_reldist(x, y) #> # A tibble: 51 × 4 #> .reldist .counts .total .freq #> #> 1 0 20202 999938 0.0202 #> 2 0.01 20031 999938 0.0200 #> 3 0.02 19977 999938 0.0200 #> 4 0.03 19871 999938 0.0199 #> 5 0.04 20129 999938 0.0201 #> 6 0.05 20197 999938 0.0202 #> 7 0.06 20020 999938 0.0200 #> 8 0.07 20063 999938 0.0201 #> 9 0.08 20053 999938 0.0201 #> 10 0.09 20021 999938 0.0200 #> # ℹ 41 more rows bed_reldist(x, y, detail = TRUE) #> # A tibble: 999,938 × 4 #> chrom start end .reldist #> #> 1 chr1 5184 6184 0.270 #> 2 chr1 7663 8663 0.226 #> 3 chr1 9858 10858 0.317 #> 4 chr1 13805 14805 0.361 #> 5 chr1 14081 15081 0.402 #> 6 chr1 16398 17398 0.253 #> 7 chr1 17486 18486 0.0912 #> 8 chr1 22063 23063 0.107 #> 9 chr1 22494 23494 0.207 #> 10 chr1 29351 30351 0.400 #> # ℹ 999,928 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Adjust intervals by a fixed size. — bed_shift","title":"Adjust intervals by a fixed size. — bed_shift","text":"--bounds intervals removed default.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adjust intervals by a fixed size. — bed_shift","text":"","code":"bed_shift(x, genome, size = 0, fraction = 0, trim = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adjust intervals by a fixed size. — bed_shift","text":"x ivl_df genome ivl_df size number bases shift. positive numbers shift right, negative shift left. fraction define size fraction interval trim adjust coordinates --bounds intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adjust intervals by a fixed size. — bed_shift","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Adjust intervals by a fixed size. — bed_shift","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 125 ) bed_glyph(bed_shift(x, genome, size = -20)) x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 100, 150, \"+\", \"chr1\", 200, 250, \"+\", \"chr2\", 300, 350, \"+\", \"chr2\", 400, 450, \"-\", \"chr3\", 500, 550, \"-\", \"chr3\", 600, 650, \"-\" ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 1000, \"chr2\", 2000, \"chr3\", 3000 ) bed_shift(x, genome, 100) #> # A tibble: 6 × 4 #> chrom start end strand #> #> 1 chr1 200 250 + #> 2 chr1 300 350 + #> 3 chr2 400 450 + #> 4 chr2 500 550 - #> 5 chr3 600 650 - #> 6 chr3 700 750 - bed_shift(x, genome, fraction = 0.5) #> # A tibble: 6 × 4 #> chrom start end strand #> #> 1 chr1 125 175 + #> 2 chr1 225 275 + #> 3 chr2 325 375 + #> 4 chr2 425 475 - #> 5 chr3 525 575 - #> 6 chr3 625 675 - # shift with respect to strand stranded <- dplyr::group_by(x, strand) bed_shift(stranded, genome, 100) #> # A tibble: 6 × 4 #> chrom start end strand #> #> 1 chr1 200 250 + #> 2 chr1 300 350 + #> 3 chr2 400 450 + #> 4 chr2 300 350 - #> 5 chr3 400 450 - #> 6 chr3 500 550 -"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":null,"dir":"Reference","previous_headings":"","what":"Shuffle input intervals. — bed_shuffle","title":"Shuffle input intervals. — bed_shuffle","text":"Shuffle input intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shuffle input intervals. — bed_shuffle","text":"","code":"bed_shuffle( x, genome, incl = NULL, excl = NULL, max_tries = 1000, within = FALSE, seed = 0 )"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shuffle input intervals. — bed_shuffle","text":"x ivl_df genome genome_df incl ivl_df included intervals excl ivl_df excluded intervals max_tries maximum tries identify bounded interval within shuffle within chromosomes seed seed reproducible intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Shuffle input intervals. — bed_shuffle","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Shuffle input intervals. — bed_shuffle","text":"","code":"genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 1e6, \"chr2\", 2e6, \"chr3\", 4e6 ) x <- bed_random(genome, seed = 1010486) bed_shuffle(x, genome, seed = 9830491) #> # A tibble: 1,000,000 × 3 #> chrom start end #> #> 1 chr2 1463822 1464822 #> 2 chr2 619967 620967 #> 3 chr2 1769865 1770865 #> 4 chr2 203953 204953 #> 5 chr3 2119387 2120387 #> 6 chr2 1216667 1217667 #> 7 chr3 2109652 2110652 #> 8 chr2 213473 214473 #> 9 chr1 154156 155156 #> 10 chr3 2201278 2202278 #> # ℹ 999,990 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":null,"dir":"Reference","previous_headings":"","what":"Increase the size of input intervals. — bed_slop","title":"Increase the size of input intervals. — bed_slop","text":"Increase size input intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Increase the size of input intervals. — bed_slop","text":"","code":"bed_slop( x, genome, both = 0, left = 0, right = 0, fraction = FALSE, strand = FALSE, trim = FALSE, ... )"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Increase the size of input intervals. — bed_slop","text":"x ivl_df genome genome_df number bases sizes left number bases left side right number bases right side fraction define flanks based fraction interval length strand define left right based strand trim adjust coordinates --bounds intervals ... extra arguments (used)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Increase the size of input intervals. — bed_slop","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Increase the size of input intervals. — bed_slop","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 110, 120, \"chr1\", 225, 235 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 400 ) bed_glyph(bed_slop(x, genome, both = 20, trim = TRUE)) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 5000 ) x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 500, 1000, \".\", \".\", \"+\", \"chr1\", 1000, 1500, \".\", \".\", \"-\" ) bed_slop(x, genome, left = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 400 1000 . . + #> 2 chr1 900 1500 . . - bed_slop(x, genome, right = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 500 1100 . . + #> 2 chr1 1000 1600 . . - bed_slop(x, genome, both = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 400 1100 . . + #> 2 chr1 900 1600 . . - bed_slop(x, genome, both = 0.5, fraction = TRUE) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 250 1250 . . + #> 2 chr1 750 1750 . . -"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":null,"dir":"Reference","previous_headings":"","what":"Sort a set of intervals. — bed_sort","title":"Sort a set of intervals. — bed_sort","text":"Sort set intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sort a set of intervals. — bed_sort","text":"","code":"bed_sort(x, by_size = FALSE, by_chrom = FALSE, reverse = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sort a set of intervals. — bed_sort","text":"x ivl_df by_size sort interval size by_chrom sort within chromosome reverse reverse sort order","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sort a set of intervals. — bed_sort","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr8\", 500, 1000, \"chr8\", 1000, 5000, \"chr8\", 100, 200, \"chr1\", 100, 300, \"chr1\", 100, 200 ) # sort by chrom and start bed_sort(x) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr1 100 200 #> 2 chr1 100 300 #> 3 chr8 100 200 #> 4 chr8 500 1000 #> 5 chr8 1000 5000 # reverse sort order bed_sort(x, reverse = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr1 100 300 #> 2 chr1 100 200 #> 3 chr8 1000 5000 #> 4 chr8 500 1000 #> 5 chr8 100 200 # sort by interval size bed_sort(x, by_size = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr8 100 200 #> 2 chr1 100 200 #> 3 chr1 100 300 #> 4 chr8 500 1000 #> 5 chr8 1000 5000 # sort by decreasing interval size bed_sort(x, by_size = TRUE, reverse = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr8 1000 5000 #> 2 chr8 500 1000 #> 3 chr1 100 300 #> 4 chr8 100 200 #> 5 chr1 100 200 # sort by interval size within chrom bed_sort(x, by_size = TRUE, by_chrom = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr1 100 200 #> 2 chr1 100 300 #> 3 chr8 100 200 #> 4 chr8 500 1000 #> 5 chr8 1000 5000"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":null,"dir":"Reference","previous_headings":"","what":"Subtract two sets of intervals. — bed_subtract","title":"Subtract two sets of intervals. — bed_subtract","text":"Subtract y intervals x intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subtract two sets of intervals. — bed_subtract","text":"","code":"bed_subtract(x, y, any = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subtract two sets of intervals. — bed_subtract","text":"x ivl_df y ivl_df remove x intervals overlap y","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subtract two sets of intervals. — bed_subtract","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subtract two sets of intervals. — bed_subtract","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 100 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 50, 75 ) bed_glyph(bed_subtract(x, y)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 200, \"chr1\", 250, 400, \"chr1\", 500, 600, \"chr1\", 1000, 1200, \"chr1\", 1300, 1500 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 150, 175, \"chr1\", 510, 525, \"chr1\", 550, 575, \"chr1\", 900, 1050, \"chr1\", 1150, 1250, \"chr1\", 1299, 1501 ) bed_subtract(x, y) #> # A tibble: 7 × 3 #> chrom start end #> #> 1 chr1 100 150 #> 2 chr1 175 200 #> 3 chr1 250 400 #> 4 chr1 500 510 #> 5 chr1 525 550 #> 6 chr1 575 600 #> 7 chr1 1050 1150 bed_subtract(x, y, any = TRUE) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 250 400"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify intervals within a specified distance. — bed_window","title":"Identify intervals within a specified distance. — bed_window","text":"Identify intervals within specified distance.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify intervals within a specified distance. — bed_window","text":"","code":"bed_window(x, y, genome, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify intervals within a specified distance. — bed_window","text":"x ivl_df y ivl_df genome genome_df ... params bed_slop bed_intersect","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify intervals within a specified distance. — bed_window","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify intervals within a specified distance. — bed_window","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 60, 75 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 125 ) bed_glyph(bed_window(x, y, genome, both = 15)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 10, 100, \"chr2\", 200, 400, \"chr2\", 300, 500, \"chr2\", 800, 900 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 150, 400, \"chr2\", 230, 430, \"chr2\", 350, 430 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 500, \"chr2\", 1000 ) bed_window(x, y, genome, both = 100) #> # A tibble: 4 × 7 #> chrom start.x end.x start.y end.y .source .overlap #> #> 1 chr2 200 400 230 430 1 200 #> 2 chr2 200 400 350 430 1 80 #> 3 chr2 300 500 230 430 1 200 #> 4 chr2 300 500 350 430 1 80"},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":null,"dir":"Reference","previous_headings":"","what":"Select intervals bounded by a genome. — bound_intervals","title":"Select intervals bounded by a genome. — bound_intervals","text":"Used remove --bounds intervals, trim interval coordinates using genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select intervals bounded by a genome. — bound_intervals","text":"","code":"bound_intervals(x, genome, trim = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select intervals bounded by a genome. — bound_intervals","text":"x ivl_df genome genome_df trim adjust coordinates --bounds intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select intervals bounded by a genome. — bound_intervals","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select intervals bounded by a genome. — bound_intervals","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", -100, 500, \"chr1\", 100, 1e9, \"chr1\", 500, 1000 ) genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) # out-of-bounds are removed by default ... bound_intervals(x, genome) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 500 1000 # ... or can be trimmed within the bounds of a genome bound_intervals(x, genome, trim = TRUE) #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 0 500 #> 2 chr1 100 249250621 #> 3 chr1 500 1000"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":null,"dir":"Reference","previous_headings":"","what":"Create intron features. — create_introns","title":"Create intron features. — create_introns","text":"Numbers score column intron numbers 5' 3' independent strand. .e., first introns + - strand genes score values 1.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create intron features. — create_introns","text":"","code":"create_introns(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create intron features. — create_introns","text":"x ivl_df BED12 format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create intron features. — create_introns","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_introns(x) #> # A tibble: 1,583 × 6 #> chrom start end name score strand #> #> 1 chr1 3207049 3411782 NM_001011874 2 - #> 2 chr1 3411982 3660632 NM_001011874 1 - #> 3 chr1 4283093 4341990 NM_001195662 3 - #> 4 chr1 4342162 4342282 NM_001195662 2 - #> 5 chr1 4342918 4399250 NM_001195662 1 - #> 6 chr1 4848057 4857550 NM_001159750 1 + #> 7 chr1 4848057 4857550 NM_011541 1 + #> 8 chr1 4848584 4857550 NM_001159751 1 + #> 9 chr1 4857613 4868107 NM_001159750 2 + #> 10 chr1 4857613 4868107 NM_011541 2 + #> # ℹ 1,573 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":null,"dir":"Reference","previous_headings":"","what":"Create transcription start site features. — create_tss","title":"Create transcription start site features. — create_tss","text":"Create transcription start site features.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create transcription start site features. — create_tss","text":"","code":"create_tss(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create transcription start site features. — create_tss","text":"x ivl_df BED format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create transcription start site features. — create_tss","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_tss(x) #> # A tibble: 100 × 6 #> chrom start end name score strand #> #> 1 chr1 3661578 3661579 NM_001011874 0 - #> 2 chr1 4399321 4399322 NM_001195662 0 - #> 3 chr1 4847774 4847775 NM_001159750 0 + #> 4 chr1 4847774 4847775 NM_011541 0 + #> 5 chr1 4848408 4848409 NM_001159751 0 + #> 6 chr1 5008814 5008815 NM_001290372 0 - #> 7 chr1 5009619 5009620 NM_021374 0 - #> 8 chr1 5060365 5060366 NM_001177795 0 - #> 9 chr1 5073166 5073167 NM_001310442 0 + #> 10 chr1 5073166 5073167 NM_133826 0 + #> # ℹ 90 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":null,"dir":"Reference","previous_headings":"","what":"Create 3' UTR features. — create_utrs3","title":"Create 3' UTR features. — create_utrs3","text":"Create 3' UTR features.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create 3' UTR features. — create_utrs3","text":"","code":"create_utrs3(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create 3' UTR features. — create_utrs3","text":"x ivl_df BED12 format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create 3' UTR features. — create_utrs3","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_utrs3(x) #> # A tibble: 99 × 6 #> chrom start end name score strand #> #> 1 chr1 3204562 3206102 NM_001011874 0 - #> 2 chr1 4280926 4283061 NM_001195662 0 - #> 3 chr1 4886445 4887990 NM_001159750 0 + #> 4 chr1 4886445 4887990 NM_011541 0 + #> 5 chr1 4886445 4887990 NM_001159751 0 + #> 6 chr1 4899656 4900554 NM_001290372 0 - #> 7 chr1 4899656 4900554 NM_021374 0 - #> 8 chr1 4899656 4900554 NM_001177795 0 - #> 9 chr1 5152246 5152630 NM_001310442 0 + #> 10 chr1 5152246 5152630 NM_133826 0 + #> # ℹ 89 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":null,"dir":"Reference","previous_headings":"","what":"Create 5' UTR features. — create_utrs5","title":"Create 5' UTR features. — create_utrs5","text":"Create 5' UTR features.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create 5' UTR features. — create_utrs5","text":"","code":"create_utrs5(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create 5' UTR features. — create_utrs5","text":"x ivl_df BED12 format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create 5' UTR features. — create_utrs5","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_utrs5(x) #> # A tibble: 97 × 6 #> chrom start end name score strand #> #> 1 chr1 3661429 3661579 NM_001011874 0 - #> 2 chr1 4399268 4399322 NM_001195662 0 - #> 3 chr1 4847774 4847994 NM_001159750 0 + #> 4 chr1 4847774 4847994 NM_011541 0 + #> 5 chr1 4848408 4848488 NM_001159751 0 + #> 6 chr1 4914046 5008815 NM_001290372 0 - #> 7 chr1 5009460 5009620 NM_021374 0 - #> 8 chr1 5060258 5060366 NM_001177795 0 - #> 9 chr1 5073166 5074531 NM_001310442 0 + #> 10 chr1 5073166 5074531 NM_133826 0 + #> # ℹ 87 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch data from remote databases. — db","title":"Fetch data from remote databases. — db","text":"Currently db_ucsc db_ensembl available connections.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch data from remote databases. — db","text":"","code":"db_ucsc( dbname, host = \"genome-mysql.cse.ucsc.edu\", user = \"genomep\", password = \"password\", port = 3306, ... ) db_ensembl( dbname, host = \"ensembldb.ensembl.org\", user = \"anonymous\", password = \"\", port = 3306, ... )"},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch data from remote databases. — db","text":"dbname name database host hostname user username password password port MySQL connection port ... params connection","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch data from remote databases. — db","text":"","code":"if (FALSE) { # \\dontrun{ if (require(RMariaDB)) { library(dplyr) ucsc <- db_ucsc(\"hg38\") # fetch the `refGene` tbl tbl(ucsc, \"refGene\") # the `chromInfo` tbls have size information tbl(ucsc, \"chromInfo\") } } # } if (FALSE) { # \\dontrun{ if (require(RMariaDB)) { library(dplyr) # squirrel genome ensembl <- db_ensembl(\"spermophilus_tridecemlineatus_core_67_2\") tbl(ensembl, \"gene\") } } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":null,"dir":"Reference","previous_headings":"","what":"Flip strands in intervals. — flip_strands","title":"Flip strands in intervals. — flip_strands","text":"Flips positive (+) stranded intervals negative (-) strands, vice-versa. Facilitates comparisons among intervals opposing strands.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flip strands in intervals. — flip_strands","text":"","code":"flip_strands(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flip strands in intervals. — flip_strands","text":"x ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Flip strands in intervals. — flip_strands","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 1, 100, \"+\", \"chr2\", 1, 100, \"-\" ) flip_strands(x) #> # A tibble: 2 × 4 #> chrom start end strand #> #> 1 chr1 1 100 - #> 2 chr2 1 100 +"},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Granges to bed tibble — gr_to_bed","title":"Convert Granges to bed tibble — gr_to_bed","text":"Convert Granges bed tibble","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Granges to bed tibble — gr_to_bed","text":"","code":"gr_to_bed(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Granges to bed tibble — gr_to_bed","text":"x GRanges object convert bed tibble.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Granges to bed tibble — gr_to_bed","text":"tibble::tibble()","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Granges to bed tibble — gr_to_bed","text":"","code":"if (FALSE) { # \\dontrun{ gr <- GenomicRanges::GRanges( seqnames = S4Vectors::Rle( c(\"chr1\", \"chr2\", \"chr1\", \"chr3\"), c(1, 1, 1, 1) ), ranges = IRanges::IRanges( start = c(1, 10, 50, 100), end = c(100, 500, 1000, 2000), names = head(letters, 4) ), strand = S4Vectors::Rle( c(\"-\", \"+\"), c(2, 2) ) ) gr_to_bed(gr) # There are two ways to convert a bed-like data.frame to GRanges: gr <- GenomicRanges::GRanges( seqnames = S4Vectors::Rle(x$chrom), ranges = IRanges::IRanges( start = x$start + 1, end = x$end, names = x$name ), strand = S4Vectors::Rle(x$strand) ) # or: gr <- GenomicRanges::makeGRangesFromDataFrame(dplyr::mutate(x, start = start + 1)) } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":null,"dir":"Reference","previous_headings":"","what":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":"Properties: order(id) equivalent .call(order, df) rows containing data value drop = FALSE room possibilites","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":"","code":"id(.variables, drop = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":".variables list variables drop drop unusued factor levels?","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":"numeric vector attribute n, giving total number possibilities","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/id_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Plyr function id_var packaged due to plyr being retired Numeric id for a vector. — id_var","title":"Plyr function id_var packaged due to plyr being retired Numeric id for a vector. — id_var","text":"Plyr function id_var packaged due plyr retired Numeric id vector.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/id_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plyr function id_var packaged due to plyr being retired Numeric id for a vector. — id_var","text":"","code":"id_var(x, drop = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate interval spacing. — interval_spacing","title":"Calculate interval spacing. — interval_spacing","text":"Spacing first interval chromosome undefined (NA). leading interval overlapping interval pair negative value.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate interval spacing. — interval_spacing","text":"","code":"interval_spacing(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate interval spacing. — interval_spacing","text":"x ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate interval spacing. — interval_spacing","text":"ivl_df .spacing column.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate interval spacing. — interval_spacing","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 100, \"chr1\", 150, 200, \"chr2\", 200, 300 ) interval_spacing(x) #> # A tibble: 3 × 4 #> chrom start end .spacing #> #> 1 chr1 1 100 NA #> 2 chr1 150 200 50 #> 3 chr2 200 300 NA"},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Bed-like data.frame requirements for valr functions — ivl_df","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"Required column names interval dataframes chrom, start end. Internally interval dataframes validated using check_interval() Required column names genome dataframes chrom size. Internally genome dataframes validated using check_genome().","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"","code":"check_interval(x) check_genome(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"x data.frame tibble::tibble","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"","code":"# using tibble x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 50, \"chr1\", 10, 75, \"chr1\", 100, 120 ) check_interval(x) #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 1 50 #> 2 chr1 10 75 #> 3 chr1 100 120 # using base R data.frame x <- data.frame( chrom = \"chr1\", start = 0, end = 100, stringsAsFactors = FALSE ) check_interval(x) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 0 100 # example genome input x <- tibble::tribble( ~chrom, ~size, \"chr1\", 1e6 ) check_genome(x) #> # A tibble: 1 × 2 #> chrom size #> #> 1 chr1 1000000"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":null,"dir":"Reference","previous_headings":"","what":"Read BED and related files. — read_bed","title":"Read BED and related files. — read_bed","text":"read functions BED related formats. Filenames can local file URLs. read functions load data tbls consistent chrom, start end colnames.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read BED and related files. — read_bed","text":"","code":"read_bed( filename, col_types = bed12_coltypes, sort = TRUE, ..., n_fields = NULL ) read_bed12(filename, ...) read_bedgraph(filename, ...) read_narrowpeak(filename, ...) read_broadpeak(filename, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read BED and related files. — read_bed","text":"filename file URL col_types column type spec readr::read_tsv() sort sort tbl chrom start ... options pass readr::read_tsv() n_fields","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read BED and related files. — read_bed","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read BED and related files. — read_bed","text":"https://genome.ucsc.edu/FAQ/FAQformat.html#format1 https://genome.ucsc.edu/FAQ/FAQformat.html#format1 https://genome.ucsc.edu/goldenPath/help/bedgraph.html https://genome.ucsc.edu/FAQ/FAQformat.html#format12 https://genome.ucsc.edu/FAQ/FAQformat.html#format13","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read BED and related files. — read_bed","text":"","code":"# read_bed assumes 3 field BED format. read_bed(valr_example(\"3fields.bed.gz\")) #> # A tibble: 10 × 3 #> chrom start end #> #> 1 chr1 11873 14409 #> 2 chr1 14361 19759 #> 3 chr1 14406 29370 #> 4 chr1 34610 36081 #> 5 chr1 69090 70008 #> 6 chr1 134772 140566 #> 7 chr1 321083 321115 #> 8 chr1 321145 321207 #> 9 chr1 322036 326938 #> 10 chr1 327545 328439 # result is sorted by chrom and start unless `sort = FALSE` read_bed(valr_example(\"3fields.bed.gz\"), sort = FALSE) #> # A tibble: 10 × 3 #> chrom start end #> #> 1 chr1 11873 14409 #> 2 chr1 14361 19759 #> 3 chr1 14406 29370 #> 4 chr1 34610 36081 #> 5 chr1 69090 70008 #> 6 chr1 134772 140566 #> 7 chr1 321083 321115 #> 8 chr1 321145 321207 #> 9 chr1 322036 326938 #> 10 chr1 327545 328439 read_bed12(valr_example(\"mm9.refGene.bed.gz\")) #> # A tibble: 100 × 12 #> chrom start end name score strand cds_start cds_end item_rgb exon_count #> #> 1 chr1 3204562 3.66e6 NM_0… 0 - 3206102 3661429 0 3 #> 2 chr1 4280926 4.40e6 NM_0… 0 - 4283061 4399268 0 4 #> 3 chr1 4847774 4.89e6 NM_0… 0 + 4847994 4886445 0 10 #> 4 chr1 4847774 4.89e6 NM_0… 0 + 4847994 4886445 0 10 #> 5 chr1 4848408 4.89e6 NM_0… 0 + 4848488 4886445 0 10 #> 6 chr1 4899656 5.01e6 NM_0… 0 - 4900554 4914046 0 5 #> 7 chr1 4899656 5.01e6 NM_0… 0 - 4900554 5009460 0 5 #> 8 chr1 4899656 5.06e6 NM_0… 0 - 4900554 5060258 0 6 #> 9 chr1 5073166 5.15e6 NM_0… 0 + 5074531 5152246 0 13 #> 10 chr1 5073166 5.15e6 NM_1… 0 + 5074531 5152246 0 14 #> # ℹ 90 more rows #> # ℹ 2 more variables: exon_sizes , exon_starts read_bedgraph(valr_example(\"test.bg.gz\")) #> # A tibble: 4 × 4 #> chrom start end value #> #> 1 chr19 49302000 49302300 -1 #> 2 chr19 49302300 49302600 -0.75 #> 3 chr19 49302600 49302900 -0.5 #> 4 chr19 49302900 49303200 -0.25 read_narrowpeak(valr_example(\"sample.narrowPeak.gz\")) #> # A tibble: 570 × 10 #> chrom start end name score strand signal pvalue qvalue peak #> #> 1 chr22 17372940 17373090 . 0 . 4 4.63 -1 -1 #> 2 chr22 17392200 17392350 . 0 . 5 4.67 -1 -1 #> 3 chr22 17398400 17398550 . 0 . 10 11.6 -1 -1 #> 4 chr22 17539180 17539330 . 0 . 21 30.9 -1 -1 #> 5 chr22 17652440 17652590 . 0 . 6 5.35 -1 -1 #> 6 chr22 17652780 17652930 . 0 . 12 12.5 -1 -1 #> 7 chr22 17980800 17980950 . 0 . 12 12.6 -1 -1 #> 8 chr22 18038260 18038410 . 0 . 29 36.0 -1 -1 #> 9 chr22 18225280 18225430 . 0 . 21 25.0 -1 -1 #> 10 chr22 18268020 18268170 . 0 . 14 13.0 -1 -1 #> # ℹ 560 more rows read_broadpeak(valr_example(\"sample.broadPeak.gz\")) #> # A tibble: 1,181 × 9 #> chrom start end name score strand signal pvalue qvalue #> #> 1 chr22 16847903 16848440 . 503 . 10.5 2.5 -1 #> 2 chr22 16849452 16851326 . 483 . 9.81 15.7 -1 #> 3 chr22 16849955 16850086 . 1000 . 32.4 4.2 -1 #> 4 chr22 16850694 16850924 . 831 . 22.5 4.9 -1 #> 5 chr22 16852964 16853782 . 499 . 10.4 6.2 -1 #> 6 chr22 16855065 16855803 . 477 . 9.58 3.9 -1 #> 7 chr22 16855944 16856974 . 491 . 10.1 8.5 -1 #> 8 chr22 16857425 16857958 . 505 . 10.6 2.5 -1 #> 9 chr22 16858284 16858824 . 549 . 12.2 4.5 -1 #> 10 chr22 16859972 16862024 . 404 . 6.89 9.3 -1 #> # ℹ 1,171 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":null,"dir":"Reference","previous_headings":"","what":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"function output 5 column tibble zero-based chrom, start, end, score, strand columns.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"","code":"read_bigwig(path, set_strand = \"+\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"path path bigWig file set_strand strand add output (defaults \"+\")","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"functions uses rtracklayer import bigwigs unstable support windows platform therefore may error windows users (particularly 32 bit window users).","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"","code":"if (FALSE) { # \\dontrun{ if (.Platform$OS.type != \"windows\") { bw <- read_bigwig(valr_example(\"hg19.dnase1.bw\")) head(bw) } } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":null,"dir":"Reference","previous_headings":"","what":"Read genome files. — read_genome","title":"Read genome files. — read_genome","text":"Genome files (UCSC \"chromSize\" files) contain chromosome name size information. sizes used downstream functions identify computed intervals coordinates outside genome bounds.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read genome files. — read_genome","text":"","code":"read_genome(path)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read genome files. — read_genome","text":"path containing chrom/contig names sizes, one-pair-per-line, tab-delimited","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read genome files. — read_genome","text":"genome_df, sorted size","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Read genome files. — read_genome","text":"URLs genome files can also used.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read genome files. — read_genome","text":"","code":"read_genome(valr_example(\"hg19.chrom.sizes.gz\")) #> # A tibble: 25 × 2 #> chrom size #> #> 1 chr1 249250621 #> 2 chr2 243199373 #> 3 chr3 198022430 #> 4 chr4 191154276 #> 5 chr5 180915260 #> 6 chr6 171115067 #> 7 chr7 159138663 #> 8 chrX 155270560 #> 9 chr8 146364022 #> 10 chr9 141213431 #> # ℹ 15 more rows if (FALSE) { # \\dontrun{ # `read_genome` accepts a URL read_genome(\"https://genome.ucsc.edu/goldenpath/help/hg19.chrom.sizes\") } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":null,"dir":"Reference","previous_headings":"","what":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"function output tibble required chrom, start, end columns, well columns depending content GTF/GFF file.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"","code":"read_gtf(path, zero_based = TRUE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"path path gtf gff file zero_based TRUE, convert zero based","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"","code":"gtf <- read_gtf(valr_example(\"hg19.gencode.gtf.gz\")) head(gtf) #> # A tibble: 6 × 26 #> chrom start end width strand source type score phase gene_id #> #> 1 chr2 43449540 43453748 4208 - HAVANA gene NA NA ENSG00000… #> 2 chr2 43449540 43453748 4208 - HAVANA transcript NA NA ENSG00000… #> 3 chr2 43453403 43453748 345 - HAVANA exon NA NA ENSG00000… #> 4 chr2 43453403 43453454 51 - HAVANA CDS NA 0 ENSG00000… #> 5 chr2 43453451 43453454 3 - HAVANA start_codon NA 0 ENSG00000… #> 6 chr2 43449540 43452891 3351 - HAVANA exon NA NA ENSG00000… #> # ℹ 16 more variables: transcript_id , gene_type , gene_status , #> # gene_name , transcript_type , transcript_status , #> # transcript_name , level , havana_gene , protein_id , #> # tag , ccdsid , havana_transcript , exon_number , #> # exon_id , ont "},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a VCF file. — read_vcf","title":"Read a VCF file. — read_vcf","text":"Read VCF file.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a VCF file. — read_vcf","text":"","code":"read_vcf(vcf)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a VCF file. — read_vcf","text":"vcf vcf filename","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a VCF file. — read_vcf","text":"data_frame","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Read a VCF file. — read_vcf","text":"return value chrom, start end columns. Interval lengths size 'REF' field.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a VCF file. — read_vcf","text":"","code":"vcf_file <- valr_example(\"test.vcf.gz\") read_vcf(vcf_file) #> # A tibble: 11 × 18 #> CHROM POS ID REF ALT QUAL FILTER INFO FORMAT X1 X2 X3 #> #> 1 1 10 1:10 A T 100 PASS NS=5;A… GT 0/0 ./. 0/0 #> 2 1 20 1:20 G C 100 PASS NS=0;A… GT ./. ./. ./. #> 3 1 30 1:30 C A 100 PASS NS=6;A… GT 0/0 0/0 0/0 #> 4 1 40 1:40 A C 100 PASS NS=6;A… GT 0/0 0/0 0/0 #> 5 1 10000 1:10000 G C 100 PASS NS=6;A… GT 0/0 0/0 0/0 #> 6 1 20000 1:20000 T A 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 7 4 5000 4:5000 A T 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 8 4 6000 4:6000 C T 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 9 X 800 X:800 A C 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 10 X 900 X:900 A T 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 11 X 1000 X:1000 T G 100 PASS NS=5;A… GT 1/1 1/1 1/1 #> # ℹ 6 more variables: X4 , X5 , X6 , chrom , start , #> # end "},{"path":"https://rnabioco.github.io/valr/dev/reference/valr.html","id":null,"dir":"Reference","previous_headings":"","what":"valr: genome interval arithmetic in R — valr","title":"valr: genome interval arithmetic in R — valr","text":"valr provides tools read manipulate intervals signals genome reference. valr developed facilitate interactive analysis genome-scale data sets, leveraging power dplyr piping.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"valr: genome interval arithmetic in R — valr","text":"learn valr, start vignette: browseVignettes(package = \"valr\")","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/valr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"valr: genome interval arithmetic in R — valr","text":"Jay Hesselberth jay.hesselberth@gmail.com Kent Riemondy kent.riemondy@gmail.com","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide working directory for valr example files. — valr_example","title":"Provide working directory for valr example files. — valr_example","text":"Provide working directory valr example files.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide working directory for valr example files. — valr_example","text":"","code":"valr_example(path)"},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide working directory for valr example files. — valr_example","text":"path path file","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Provide working directory for valr example files. — valr_example","text":"","code":"valr_example(\"hg19.chrom.sizes.gz\") #> [1] \"/home/runner/work/_temp/Library/valr/extdata/hg19.chrom.sizes.gz\""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-development-version","dir":"Changelog","previous_headings":"","what":"valr (development version)","title":"valr (development version)","text":"valr now depends R >= 4.0.0.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-082","dir":"Changelog","previous_headings":"","what":"valr 0.8.2","title":"valr 0.8.2","text":"CRAN release: 2024-08-30 Address NOTE CRAN Rd link targets. Change maintainer email address.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-081","dir":"Changelog","previous_headings":"","what":"valr 0.8.1","title":"valr 0.8.1","text":"CRAN release: 2024-04-22 Make vdiffr dependency optional package testing.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-080","dir":"Changelog","previous_headings":"","what":"valr 0.8.0","title":"valr 0.8.0","text":"CRAN release: 2024-04-04 Added bed_genomecov() compute interval coverage across genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-070","dir":"Changelog","previous_headings":"","what":"valr 0.7.0","title":"valr 0.7.0","text":"CRAN release: 2023-09-18 read_bed related functions now automatically calculate fields. Use n_fields deprecated.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-068","dir":"Changelog","previous_headings":"","what":"valr 0.6.8","title":"valr 0.6.8","text":"CRAN release: 2023-05-16 bed_closest() now reports x intervals, even closest y intervals (e.g. matching chromosome y intervals). intervals returned populated NA .overlap, .dist y interval locations. Reimplemented bed_closest() use binary search rather interval tree search. closest y interval can missed previous search strategy high depth interval trees. Fix one error using max_dist argument bed_cluster() (#401).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-067","dir":"Changelog","previous_headings":"","what":"valr 0.6.7","title":"valr 0.6.7","text":"CRAN release: 2023-02-18 Removed SystemRequirements DESCRIPTION eliminate NOTE CRAN. bed_coverage() now reports intervals x matching group y (#395).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-066","dir":"Changelog","previous_headings":"","what":"valr 0.6.6","title":"valr 0.6.6","text":"CRAN release: 2022-10-11 Updated intervalTree header commit f0c4046 valr now uses cli consistent errors messages interactive use. deprecated genome argument bed_makewindows() removed.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-065","dir":"Changelog","previous_headings":"","what":"valr 0.6.5","title":"valr 0.6.5","text":"CRAN release: 2022-08-19 Handle max_dist first intervals bed_cluster() (#388)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-064","dir":"Changelog","previous_headings":"","what":"valr 0.6.4","title":"valr 0.6.4","text":"CRAN release: 2021-12-08 Fixed intron score numbering error create_introns (#377 @sheridar) Fixed bug handling list inputs bed_intersect()(#380 @sheridar) Added read_bigwig read_gtf functions import data valr compatible tibbles (#379) Kent Riemondy now maintainer.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-063","dir":"Changelog","previous_headings":"","what":"valr 0.6.3","title":"valr 0.6.3","text":"CRAN release: 2021-05-15 Update prepare readr 2.0.0","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-062","dir":"Changelog","previous_headings":"","what":"valr 0.6.2","title":"valr 0.6.2","text":"CRAN release: 2020-10-07","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-6-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.6.2","text":"RMariaDB replaced deprecated RMySQL package database backend. valr now imports Rcpp, always case, masked Import readr, recently dropped use Rcpp.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-061","dir":"Changelog","previous_headings":"","what":"valr 0.6.1","title":"valr 0.6.1","text":"CRAN release: 2020-05-08","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-6-1","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"valr 0.6.1","text":"Fixed rchk unprotect error (#365)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-060","dir":"Changelog","previous_headings":"","what":"valr 0.6.0","title":"valr 0.6.0","text":"CRAN release: 2020-05-04","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.6.0","text":"trbl_interval() trbl_genome() custom tibble subclasses deemed unnecessary removed package. coercing GRanges valr compatible data.frame now uses gr_to_bed() function rather .trbl_interal() methods.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.6.0","text":"dplyr version < 0.8.0 longer supported due unnecessary code bloat challenges handling multiple grouping structures (#359). sort_by argument bed_random() changed sorted, now default use bed_sort() sort output, rather rely naming sorting columns. Sorting can suppressed using sorted = FALSE. bed_sort() now uses base R sorting radix method increased speed. (#353) tbls processed bed_merge()bed_sort() longer store either merged sorted attributes, due attributes rarely checked codebase potential sources unexpected behavior.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-6-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.6.0","text":"Fixed bed_closest() prevent erroneous intervals reported adjacent closest intervals present y table. (#348) Factor columns used grouping returned factors rather inappropriately coerced integer vectors (#360)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-050","dir":"Changelog","previous_headings":"","what":"valr 0.5.0","title":"valr 0.5.0","text":"CRAN release: 2019-01-03","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.5.0","text":"Internal Rcpp functions reorganized remove dependencies dplyr C++ functions.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.5.0","text":"Due internal refactoring Rcpp functions, data.frames containing Numeric, Logical, Integer, Character, List column types supported. Columns containing Raw, Complex, R classes supported issue error. Factors now disallowed grouping variables multiset operations avoid sort order discrepancies, compatibility factor handling dplyr v.0.8.0. Factors now internally type-converted character warning issued.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-042","dir":"Changelog","previous_headings":"","what":"valr 0.4.2","title":"valr 0.4.2","text":"CRAN release: 2018-11-17","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-4-2","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.4.2","text":"Changed behavior .tbl_interval() call as_tibble() non-tibble input, prevents groups stripped tibble() input (#338).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-041","dir":"Changelog","previous_headings":"","what":"valr 0.4.1","title":"valr 0.4.1","text":"CRAN release: 2018-06-08 Added new function, bed_partition(), similar bed_merge() collapses intervals elemental intervals rather maximal overlapping region. bed_partition() also can compute summaries data overlapping intervals. See examples bed_partition() timings vignette('benchmarks') @kriemo. Several explicit comparisons Bioconductor GenomicRanges library included users considering using valr. See examples .tbl_interval() timings vignette('benchmarks').","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-040","dir":"Changelog","previous_headings":"","what":"valr 0.4.0","title":"valr 0.4.0","text":"CRAN release: 2018-01-25","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.4.0","text":"relevant tests bedtool2 ported valr. Bugs identified corner cases new tests fixed (#328 @raysinesis) bed_jaccard() now works grouped inputs (#216) Update dplyr header files v0.7 bed_intersect() internal intersect_impl refactored enable return non-intersecting intervals. genome argument bed_makewindows() deprecated produce warning used. Also error handling added check warn intervals smaller requested window size makewindows_impl() (#312 @kriemo)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-4-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.4.0","text":"Fixed one error reported distances bed_closest(). Distances reported now bedtools closest behavior (#311). bed_glyph() accepts trbl_intervals named x y (#318). bed_makewindows() now returns number windows specified num_win input intervals evenly divisble num_win, consistent bedtools behavior. output findOverlaps() now sorted subtract_impl() prevent reporting intervals dropped calling bed_subtract() (#316 @kriemo)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-031","dir":"Changelog","previous_headings":"","what":"valr 0.3.1","title":"valr 0.3.1","text":"CRAN release: 2017-07-22","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"enhancements-0-3-1","dir":"Changelog","previous_headings":"","what":"Enhancements","title":"valr 0.3.1","text":"manuscript describing valr published F1000Research. New S3 generic .tbl_interval() converts GenomicRanges::GRanges objects tbl_interval. New create_tss() creating transcription start sites. Improve documentation interval statistics complex examples.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-3-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.3.1","text":"bed_sort() de-deprecated reduce arrange calls library code.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-3-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.3.1","text":"bed_merge() now reports start/end columns spec provided (#288)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-030","dir":"Changelog","previous_headings":"","what":"valr 0.3.0","title":"valr 0.3.0","text":"CRAN release: 2017-06-15","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"enhancements-0-3-0","dir":"Changelog","previous_headings":"","what":"Enhancements","title":"valr 0.3.0","text":"New create_introns(), create_utrs5() create_utrs3() functions generating features BED12 files. Speed-ups bed_makewindows() (~50x), bed_merge() (~4x), bed_flank() (~4x) (thanks @kriemo @sheridar). Thanks sponsors Biofrontiers Hackathon caffeine underlying improvements.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-3-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.3.0","text":"intervals bed_random() now sorted properly.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-020","dir":"Changelog","previous_headings":"","what":"valr 0.2.0","title":"valr 0.2.0","text":"CRAN release: 2017-05-05","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.2.0","text":"Package dplyr v0.5.0 headers valr remove dplyr LinkingTo dependency. bed_intersect() now accepts multiple tbls intersection (#220 @kriemo). new tbl_interval() tbl_genome() wrap tibbles enforce strict column naming. trbl_interval() trbl_genome() constructors take tibble::tribble() formatting .tbl_interval() .tbl_genome() used check valid classes.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.2.0","text":"intervals returned bed_random() sorted chrom start default.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-2-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.2.0","text":"Merge intervals bed_jaccard() use numeric values calculation (fixes #204).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-012","dir":"Changelog","previous_headings":"","what":"valr 0.1.2","title":"valr 0.1.2","text":"CRAN release: 2017-03-16","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.1.2","text":"Deprecate bed_sort() favor using dplyr::arrange() explicitly (fixes #134).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.1.2","text":"add src/init.c calls R_registerRoutines R_useDynamicSymbols address NOTE r-devel Deprecate dist parameter bed_closest() favor using user supplied functions (#182 @kriemo) Make .id values sequential across chroms bed_cluster() output (#171) Transfer repository http://github.com/rnabioco/valr, update links docs. Move shiny app new repo (http://github.com/rnabioco/valrdata). Add Kent Riemondy LICENSE file.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-1-2","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.1.2","text":"bed_merge() now merges contained intervals (#177)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-011","dir":"Changelog","previous_headings":"","what":"valr 0.1.1","title":"valr 0.1.1","text":"CRAN release: 2016-12-01","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-1-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.1.1","text":"test / vignette guards Suggested RMySQL fixed memory leak absdist.cpp fixed vignette entry names","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-010","dir":"Changelog","previous_headings":"","what":"valr 0.1.0","title":"valr 0.1.0","text":"CRAN release: 2016-11-21","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.1.0","text":"initial release CRAN","code":""}] +[{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to valr","title":"Contributing to valr","text":"outlines propose change valr. detailed info contributing , tidyverse packages, please see development contributing guide.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to valr","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to valr","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to valr","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"rnabioco/valr\", fork = TRUE). Install development dependences devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to valr","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://rnabioco.github.io/valr/dev/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to valr","text":"Please note valr project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://rnabioco.github.io/valr/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2016-2018 Jay R Hesselberth Kent Riemondy Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://rnabioco.github.io/valr/dev/articles/interval-stats.html","id":"overview","dir":"Articles","previous_headings":"","what":"Overview","title":"Interval statistics","text":"valr includes several functions exploring statistical relationships sets intervals. Calculate significance overlaps sets intervals bed_fisher() bed_projection(). Quantify relative absolute distances sets intervals bed_reldist() bed_absdist(). Quantify extent overlap sets intervals bed_jaccard(). vignette explore relationship transcription start sites repetitive elements human genome.","code":"library(valr) #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found library(dplyr) library(ggplot2) library(cowplot) library(tidyr) # load repeats and genes. Data in the valr package is restricted to chr22; the entire # files can be downloaded from UCSC. rpts <- read_bed(valr_example(\"hg19.rmsk.chr22.bed.gz\")) genes <- read_bed12(valr_example(\"hg19.refGene.chr22.bed.gz\")) # load chrom sizes genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) # create 1 bp intervals representing transcription start sites tss <- create_tss(genes) tss #> # A tibble: 1,267 × 6 #> chrom start end name score strand #> #> 1 chr22 16193008 16193009 NR_122113 0 - #> 2 chr22 16157078 16157079 NR_133911 0 + #> 3 chr22 16162065 16162066 NR_073459 0 + #> 4 chr22 16162065 16162066 NR_073460 0 + #> 5 chr22 16231288 16231289 NR_132385 0 - #> 6 chr22 16287936 16287937 NM_001136213 0 - #> 7 chr22 16274608 16274609 NR_046571 0 + #> 8 chr22 16449803 16449804 NM_001005239 0 - #> 9 chr22 17073699 17073700 NM_014406 0 - #> 10 chr22 17082800 17082801 NR_001591 0 + #> # ℹ 1,257 more rows"},{"path":"https://rnabioco.github.io/valr/dev/articles/interval-stats.html","id":"distance-metrics","dir":"Articles","previous_headings":"","what":"Distance metrics","title":"Interval statistics","text":"First define function takes x y intervals computes distance statistics (using bed_reldist() bed_absdist()) specified groups. value statistic assigned .value column. use distance_stats() function apply bed_absdist() function group data. done set shuffled group data. bed_shuffle() used shuffle coordinates repeats within chromosome (.e., coordinates change, chromosome stays .) Now can bind observed shuffled data together, tidying put data format appropriate statistical test. involves: unnest()ing data frames creating groups repeat (name), stat (reldist absdist) type (obs shf) adding unique surrogate row numbers group using tidyr::pivot_wider() create two new obs shuf columns removing rows NA values. Now data formatted, can use non-parametric ks.test() determine whether significant differences observed shuffled data group. broom::tidy() used reformat results test tibble, results test pivoted type column test type. Histgrams different stats help visualize distribution p.values. can also assess false discovery rates (q.values) using p.adjust(). Finally can visualize results using stat_ecdf().","code":"distance_stats <- function(x, y, genome, group_var, type = NA) { group_by(x, !!rlang::sym(group_var)) |> do( reldist = bed_reldist(., y, detail = TRUE) |> select(.value = .reldist), absdist = bed_absdist(., y, genome) |> select(.value = .absdist) ) |> tidyr::pivot_longer( cols = -name, names_to = \"stat\", values_to = \"value\" ) |> mutate(type = type) } obs_stats <- distance_stats(rpts, tss, genome, \"name\", \"obs\") obs_stats #> # A tibble: 2,106 × 4 #> name stat value type #> #> 1 (A)n reldist obs #> 2 (A)n absdist obs #> 3 (AAAAACA)n reldist obs #> 4 (AAAAACA)n absdist obs #> 5 (AAAAC)n reldist obs #> 6 (AAAAC)n absdist obs #> 7 (AAAAG)n reldist obs #> 8 (AAAAG)n absdist obs #> 9 (AAAAT)n reldist obs #> 10 (AAAAT)n absdist obs #> # ℹ 2,096 more rows shfs <- bed_shuffle(rpts, genome, within = TRUE) shf_stats <- distance_stats(shfs, tss, genome, \"name\", \"shuf\") res <- bind_rows(obs_stats, shf_stats) |> tidyr::unnest(value) |> group_by(name, stat, type) |> mutate(.id = row_number()) |> tidyr::pivot_wider( names_from = \"type\", values_from = \".value\" ) |> na.omit() res #> # A tibble: 16,785 × 5 #> # Groups: name, stat [1,904] #> name stat .id obs shuf #> #> 1 (A)n reldist 1 0.363 0.177 #> 2 (A)n reldist 2 0.429 0.404 #> 3 (A)n reldist 3 0.246 0.119 #> 4 (A)n reldist 4 0.478 0.157 #> 5 (A)n reldist 5 0.260 0.176 #> 6 (A)n reldist 6 0.286 0.225 #> 7 (A)n reldist 7 0.498 0.128 #> 8 (A)n reldist 8 0.237 0.385 #> 9 (A)n reldist 9 0.314 0.413 #> 10 (A)n reldist 10 0.149 0.234 #> # ℹ 16,775 more rows library(broom) pvals <- res |> do( twosided = tidy(ks.test(.$obs, .$shuf)), less = tidy(ks.test(.$obs, .$shuf, alternative = \"less\")), greater = tidy(ks.test(.$obs, .$shuf, alternative = \"greater\")) ) |> tidyr::pivot_longer(cols = -c(name, stat), names_to = \"alt\", values_to = \"type\") |> unnest(type) |> select(name:p.value) |> arrange(p.value) ggplot(pvals, aes(p.value)) + geom_histogram(binwidth = 0.05) + facet_grid(stat ~ alt) + theme_cowplot() pvals <- group_by(pvals, stat, alt) |> mutate(q.value = p.adjust(p.value)) |> ungroup() |> arrange(q.value) res_gather <- tidyr::pivot_longer(res, cols = -c(name, stat, .id), names_to = \"type\", values_to = \"value\" ) signif <- head(pvals, 5) res_signif <- signif |> left_join(res_gather, by = c(\"name\", \"stat\")) #> Warning in left_join(signif, res_gather, by = c(\"name\", \"stat\")): Detected an unexpected many-to-many relationship between `x` and `y`. #> ℹ Row 1 of `x` matches multiple rows in `y`. #> ℹ Row 29037 of `y` matches multiple rows in `x`. #> ℹ If a many-to-many relationship is expected, set `relationship = #> \"many-to-many\"` to silence this warning. ggplot(res_signif, aes(x = value, color = type)) + stat_ecdf() + facet_grid(stat ~ name) + theme_cowplot() + scale_x_log10() + scale_color_brewer(palette = \"Set1\")"},{"path":"https://rnabioco.github.io/valr/dev/articles/interval-stats.html","id":"projection-test","dir":"Articles","previous_headings":"","what":"Projection test","title":"Interval statistics","text":"bed_projection() statistical approach assess relationship two intervals based binomial distribution. , examine distribution repetitive elements within promoters coding non-coding genes. First ’ll extract 5 kb regions upstream transcription start sites represent promoter regions coding non-coding genes. Next ’ll apply bed_projection() test repeat class coding non-coding regions. projection test two-tailed statistical test. significant p-value indicates either enrichment depletion query intervals compared reference interval sets. value lower_tail = TRUE column indicates query intervals depleted, whereas lower_tail = FALSE indicates query intervals enriched.","code":"# create intervals 5kb upstream of tss representing promoters promoters <- bed_flank(genes, genome, left = 5000, strand = TRUE) |> mutate(name = ifelse(grepl(\"NR_\", name), \"non-coding\", \"coding\")) |> select(chrom:strand) # select coding and non-coding promoters promoters_coding <- filter(promoters, name == \"coding\") promoters_ncoding <- filter(promoters, name == \"non-coding\") promoters_coding #> # A tibble: 973 × 6 #> chrom start end name score strand #> #> 1 chr22 16287937 16292937 coding 0 - #> 2 chr22 16449804 16454804 coding 0 - #> 3 chr22 17073700 17078700 coding 0 - #> 4 chr22 17302589 17307589 coding 0 - #> 5 chr22 17302589 17307589 coding 0 - #> 6 chr22 17489112 17494112 coding 0 - #> 7 chr22 17560848 17565848 coding 0 + #> 8 chr22 17560848 17565848 coding 0 + #> 9 chr22 17602213 17607213 coding 0 - #> 10 chr22 17602257 17607257 coding 0 - #> # ℹ 963 more rows promoters_ncoding #> # A tibble: 294 × 6 #> chrom start end name score strand #> #> 1 chr22 16152078 16157078 non-coding 0 + #> 2 chr22 16157065 16162065 non-coding 0 + #> 3 chr22 16157065 16162065 non-coding 0 + #> 4 chr22 16193009 16198009 non-coding 0 - #> 5 chr22 16231289 16236289 non-coding 0 - #> 6 chr22 16269608 16274608 non-coding 0 + #> 7 chr22 17077800 17082800 non-coding 0 + #> 8 chr22 17156430 17161430 non-coding 0 - #> 9 chr22 17229328 17234328 non-coding 0 - #> 10 chr22 17303363 17308363 non-coding 0 + #> # ℹ 284 more rows # function to apply bed_projection to groups projection_stats <- function(x, y, genome, group_var, type = NA) { group_by(x, !!rlang::sym(group_var)) |> do( n_repeats = nrow(.), projection = bed_projection(., y, genome) ) |> mutate(type = type) } pvals_coding <- projection_stats(rpts, promoters_coding, genome, \"name\", \"coding\") pvals_ncoding <- projection_stats(rpts, promoters_ncoding, genome, \"name\", \"non_coding\") pvals <- bind_rows(pvals_ncoding, pvals_coding) |> ungroup() |> tidyr::unnest(cols = c(n_repeats, projection)) |> select(-chrom) # filter for repeat classes with at least 10 intervals pvals <- filter( pvals, n_repeats > 10, obs_exp_ratio != 0 ) # adjust pvalues pvals <- mutate(pvals, q.value = p.adjust(p.value)) pvals #> # A tibble: 179 × 7 #> name n_repeats p.value obs_exp_ratio lower_tail type q.value #> #> 1 (A)n 28 0.00353 4.72 FALSE non_coding 0.558 #> 2 (AT)n 48 0.298 0.917 FALSE non_coding 1 #> 3 (CA)n 31 0.156 1.42 FALSE non_coding 1 #> 4 (GT)n 42 0.247 1.05 FALSE non_coding 1 #> 5 (T)n 61 0.405 0.721 FALSE non_coding 1 #> 6 (TG)n 40 0.0622 2.20 FALSE non_coding 1 #> 7 A-rich 54 0.348 0.815 FALSE non_coding 1 #> 8 Alu 15 0.0446 2.93 FALSE non_coding 1 #> 9 AluJb 271 0.0225 1.79 FALSE non_coding 1 #> 10 AluJo 208 0.0216 1.90 FALSE non_coding 1 #> # ℹ 169 more rows library(DT) # find and show top 5 most significant repeats signif_tests <- pvals |> arrange(q.value) |> group_by(type) |> top_n(-5, q.value) |> arrange(type) DT::datatable(signif_tests)"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"familiar-tools-natively-in-r","dir":"Articles","previous_headings":"","what":"Familiar tools, natively in R","title":"valr overview","text":"functions valr similar names BEDtools counterparts, familiar users coming BEDtools suite. Similar pybedtools, valr terse syntax:","code":"library(valr) library(dplyr) snps <- read_bed(valr_example(\"hg19.snps147.chr22.bed.gz\")) genes <- read_bed(valr_example(\"genes.hg19.chr22.bed.gz\")) # find snps in intergenic regions intergenic <- bed_subtract(snps, genes) # distance from intergenic snps to nearest gene nearby <- bed_closest(intergenic, genes) nearby |> select(starts_with(\"name\"), .overlap, .dist) |> filter(abs(.dist) < 1000) #> # A tibble: 285 × 4 #> name.x name.y .overlap .dist #> #> 1 rs2261631 P704P 0 -268 #> 2 rs570770556 POTEH 0 -913 #> 3 rs538163832 POTEH 0 -953 #> 4 rs9606135 TPTEP1 0 -422 #> 5 rs11912392 ANKRD62P1-PARP4P3 0 105 #> 6 rs8136454 BC038197 0 356 #> 7 rs5992556 XKR3 0 -456 #> 8 rs114101676 GAB4 0 474 #> 9 rs62236167 CECR7 0 262 #> 10 rs5747023 CECR1 0 -387 #> # ℹ 275 more rows"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"input-data","dir":"Articles","previous_headings":"","what":"Input data","title":"valr overview","text":"valr assigns common column names facilitate comparisons tbls. tbls chrom, start, end columns, tbls multi-column formats additional pre-determined column names. See read_bed() documentation details. valr can also operate BED-like data.frames already constructed R, provided columns named chrom, start end present. New tbls can also constructed either tibbles base R data.frames.","code":"bed_file <- valr_example(\"3fields.bed.gz\") read_bed(bed_file) # accepts filepaths or URLs #> # A tibble: 10 × 3 #> chrom start end #> #> 1 chr1 11873 14409 #> 2 chr1 14361 19759 #> 3 chr1 14406 29370 #> 4 chr1 34610 36081 #> 5 chr1 69090 70008 #> 6 chr1 134772 140566 #> 7 chr1 321083 321115 #> 8 chr1 321145 321207 #> 9 chr1 322036 326938 #> 10 chr1 327545 328439 bed <- tribble( ~chrom, ~start, ~end, \"chr1\", 1657492, 2657492, \"chr2\", 2501324, 3094650 ) bed #> # A tibble: 2 × 3 #> chrom start end #> #> 1 chr1 1657492 2657492 #> 2 chr2 2501324 3094650"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"interval-coordinates","dir":"Articles","previous_headings":"","what":"Interval coordinates","title":"valr overview","text":"valr adheres BED format specifies start position interval zero based end position one-based. first position chromosome 0. end position chromosome one position passed last base, included interval. example:","code":"# a chromosome 100 basepairs in length chrom <- tribble( ~chrom, ~start, ~end, \"chr1\", 0, 100 ) chrom #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 0 100 # single base-pair intervals bases <- tribble( ~chrom, ~start, ~end, \"chr1\", 0, 1, # first base of chromosome \"chr1\", 1, 2, # second base of chromosome \"chr1\", 99, 100 # last base of chromosome ) bases #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 0 1 #> 2 chr1 1 2 #> 3 chr1 99 100"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"remote-databases","dir":"Articles","previous_headings":"","what":"Remote databases","title":"valr overview","text":"Remote databases can accessed db_ucsc() (access UCSC Browser) db_ensembl() (access Ensembl databases).","code":"# access the `refGene` tbl on the `hg38` assembly. if (require(RMariaDB)) { ucsc <- db_ucsc(\"hg38\") tbl(ucsc, \"refGene\") }"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"visual-documentation","dir":"Articles","previous_headings":"","what":"Visual documentation","title":"valr overview","text":"bed_glyph() tool illustrates results operations valr, similar found BEDtools documentation. glyph shows result intersecting x y intervals bed_intersect(): glyph illustrates bed_merge():","code":"x <- tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tribble( ~chrom, ~start, ~end, \"chr1\", 30, 75 ) bed_glyph(bed_intersect(x, y)) x <- tribble( ~chrom, ~start, ~end, \"chr1\", 1, 50, \"chr1\", 10, 75, \"chr1\", 100, 120 ) bed_glyph(bed_merge(x))"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"grouping-data","dir":"Articles","previous_headings":"","what":"Grouping data","title":"valr overview","text":"group_by function dplyr can used perform functions subsets single multiple data_frames. Functions valr leverage grouping enable variety comparisons. example, intervals can grouped strand perform comparisons among intervals strand. Comparisons intervals opposite strands done using flip_strands() function: single set (e.g. bed_merge()) multi set operations respect groupings input intervals.","code":"x <- tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 1, 100, \"+\", \"chr1\", 50, 150, \"+\", \"chr2\", 100, 200, \"-\" ) y <- tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 50, 125, \"+\", \"chr1\", 50, 150, \"-\", \"chr2\", 50, 150, \"+\" ) # intersect tbls by strand x <- group_by(x, strand) y <- group_by(y, strand) bed_intersect(x, y) #> # A tibble: 2 × 8 #> chrom start.x end.x strand.x start.y end.y strand.y .overlap #> #> 1 chr1 1 100 + 50 125 + 50 #> 2 chr1 50 150 + 50 125 + 75 x <- group_by(x, strand) y <- flip_strands(y) y <- group_by(y, strand) bed_intersect(x, y) #> # A tibble: 3 × 8 #> chrom start.x end.x strand.x start.y end.y strand.y .overlap #> #> 1 chr1 1 100 + 50 150 + 50 #> 2 chr1 50 150 + 50 150 + 100 #> 3 chr2 100 200 - 50 150 - 50"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"column-specification","dir":"Articles","previous_headings":"","what":"Column specification","title":"valr overview","text":"Columns BEDtools referred position: valr, columns referred name can used multiple name/value expressions summaries.","code":"# calculate the mean of column 6 for intervals in `b` that overlap with `a` bedtools map -a a.bed -b b.bed -c 6 -o mean # calculate the mean and variance for a `value` column bed_map(a, b, .mean = mean(value), .var = var(value)) # report concatenated and max values for merged intervals bed_merge(a, .concat = concat(value), .max = max(value))"},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"meta-analysis","dir":"Articles","previous_headings":"Getting started","what":"Meta-analysis","title":"valr overview","text":"demonstration illustrates use valr tools perform “meta-analysis” signals relative genomic features. analyze distribution histone marks surrounding transcription start sites. First load libraries relevant data. generate 1 bp intervals represent transcription start sites (TSSs). focus + strand genes, - genes easily accommodated filtering using bed_makewindows() reversed window numbers. Now use .win_id group bed_map() calculate sum mapping y signals onto intervals x. data regrouped .win_id summary mean sd values calculated. Finally, summary statistics used construct plot illustrates histone density surrounding TSSs.","code":"# `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) genome <- read_genome(genomefile) y <- read_bedgraph(bgfile) # 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 × 7 #> chrom start end name score strand .win_id #> #> 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 #> # ℹ 13,520 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 × 3 #> .win_id win_mean win_sd #> #> 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 #> # ℹ 31 more rows 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 ) + labs( x = \"Position (bp from TSS)\", y = \"Signal\", title = \"Human H3K4me3 signal near transcription start sites\" ) + theme_classic()"},{"path":"https://rnabioco.github.io/valr/dev/articles/valr.html","id":"related-work","dir":"Articles","previous_headings":"","what":"Related work","title":"valr overview","text":"Command-line tools BEDtools bedops. Python library pybedtools wraps BEDtools. R packages GenomicRanges, bedr, IRanges GenometriCorr provide similar capability different philosophy.","code":""},{"path":"https://rnabioco.github.io/valr/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jay Hesselberth. Author. Kent Riemondy. Author, maintainer. RNA Bioscience Initiative. Funder, copyright holder.","code":""},{"path":"https://rnabioco.github.io/valr/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Riemondy KA, Sheridan RM, Gillen , Yu Y, Bennett CG, Hesselberth JR (2017). “valr: Reproducible Genome Interval Arithmetic R.” F1000Research. doi:10.12688/f1000research.11997.1.","code":"@Article{, title = {valr: Reproducible Genome Interval Arithmetic in R}, year = {2017}, author = {Kent A. Riemondy and Ryan M. Sheridan and Austin Gillen and Yinni Yu and Christopher G. Bennett and Jay R. Hesselberth}, journal = {F1000Research}, doi = {10.12688/f1000research.11997.1}, }"},{"path":"https://rnabioco.github.io/valr/dev/index.html","id":"valr-","dir":"","previous_headings":"","what":"Genome Interval Arithmetic","title":"Genome Interval Arithmetic","text":"valr provides tools read manipulate genome intervals signals, similar BEDtools suite.","code":""},{"path":"https://rnabioco.github.io/valr/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Genome Interval Arithmetic","text":"","code":"# Install development version from GitHub # install.packages(\"pak\") pak::pak(\"rnabioco/valr\")"},{"path":"https://rnabioco.github.io/valr/dev/index.html","id":"valr-example","dir":"","previous_headings":"","what":"valr Example","title":"Genome Interval Arithmetic","text":"Functions valr similar names BEDtools counterparts, familiar users coming BEDtools suite. Unlike tools wrap BEDtools write temporary files disk, valr tools run natively memory. Similar pybedtools, valr terse syntax:","code":"library(valr) library(dplyr) snps <- read_bed(valr_example(\"hg19.snps147.chr22.bed.gz\")) genes <- read_bed(valr_example(\"genes.hg19.chr22.bed.gz\")) # 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 × 4 #> name.x name.y .overlap .dist #> #> 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 #> # ℹ 1,037 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert BED12 to individual exons in BED6. — bed12_to_exons","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"conversion BED6 format, score column contains exon number, respect strand (.e., first exon - strand genes larger start end coordinates).","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"","code":"bed12_to_exons(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"x ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed12_to_exons.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert BED12 to individual exons in BED6. — bed12_to_exons","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) bed12_to_exons(x) #> # A tibble: 1,683 × 6 #> chrom start end name score strand #> #> 1 chr1 3204562 3207049 NM_001011874 3 - #> 2 chr1 3411782 3411982 NM_001011874 2 - #> 3 chr1 3660632 3661579 NM_001011874 1 - #> 4 chr1 4280926 4283093 NM_001195662 4 - #> 5 chr1 4341990 4342162 NM_001195662 3 - #> 6 chr1 4342282 4342918 NM_001195662 2 - #> 7 chr1 4399250 4399322 NM_001195662 1 - #> 8 chr1 4847774 4848057 NM_001159750 1 + #> 9 chr1 4847774 4848057 NM_011541 1 + #> 10 chr1 4848408 4848584 NM_001159751 1 + #> # ℹ 1,673 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute absolute distances between intervals. — bed_absdist","title":"Compute absolute distances between intervals. — bed_absdist","text":"Computes absolute distance midpoint x interval midpoints closest y interval.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute absolute distances between intervals. — bed_absdist","text":"","code":"bed_absdist(x, y, genome)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute absolute distances between intervals. — bed_absdist","text":"x ivl_df y ivl_df genome genome_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute absolute distances between intervals. — bed_absdist","text":"ivl_df .absdist .absdist_scaled columns.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute absolute distances between intervals. — bed_absdist","text":"Absolute distances scaled inter-reference gap chromosome follows. Q query points R reference points chromosome, scale distance query point closest reference point inter-reference gap chromosome. x interval matching y chromosome, .absdist NA. $$d_i(x,y) = min_k(|q_i - r_k|)\\frac{R}{Length\\ \\ chromosome}$$ absolute scaled distances reported .absdist .absdist_scaled. Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_absdist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute absolute distances between intervals. — bed_absdist","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_absdist(x, y, genome) #> # A tibble: 1,000,000 × 5 #> chrom start end .absdist .absdist_scaled #> #> 1 chr1 5184 6184 1392 0.448 #> 2 chr1 7663 8663 1087 0.350 #> 3 chr1 9858 10858 1526 0.491 #> 4 chr1 13805 14805 2421 0.779 #> 5 chr1 14081 15081 2697 0.868 #> 6 chr1 16398 17398 1700 0.547 #> 7 chr1 17486 18486 612 0.197 #> 8 chr1 22063 23063 466 0.150 #> 9 chr1 22494 23494 897 0.289 #> 10 chr1 29351 30351 1143 0.368 #> # ℹ 999,990 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify closest intervals. — bed_closest","title":"Identify closest intervals. — bed_closest","text":"Identify closest intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify closest intervals. — bed_closest","text":"","code":"bed_closest(x, y, overlap = TRUE, suffix = c(\".x\", \".y\"))"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify closest intervals. — bed_closest","text":"x ivl_df y ivl_df overlap report overlapping intervals suffix colname suffixes output","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify closest intervals. — bed_closest","text":"ivl_df additional columns: .overlap amount overlap overlapping interval. Non-overlapping adjacent intervals overlap 0. .overlap included output overlap = FALSE. .dist distance closest interval. Negative distances denote upstream intervals. Book-ended intervals distance 1.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify closest intervals. — bed_closest","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Identify closest intervals. — bed_closest","text":"interval x bed_closest() returns overlapping intervals y closest non-intersecting y interval. Setting overlap = FALSE report closest non-intersecting y intervals, ignoring overlapping y intervals.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_closest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify closest intervals. — bed_closest","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 140, 175 ) bed_glyph(bed_closest(x, y)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 500, 600, \"chr2\", 5000, 6000 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 200, \"chr1\", 150, 200, \"chr1\", 550, 580, \"chr2\", 7000, 8500 ) bed_closest(x, y) #> # A tibble: 4 × 7 #> chrom start.x end.x start.y end.y .overlap .dist #> #> 1 chr1 500 600 550 580 30 0 #> 2 chr1 500 600 100 200 0 -301 #> 3 chr1 500 600 150 200 0 -301 #> 4 chr2 5000 6000 7000 8500 0 1001 bed_closest(x, y, overlap = FALSE) #> # A tibble: 3 × 6 #> chrom start.x end.x start.y end.y .dist #> #> 1 chr1 500 600 100 200 -301 #> 2 chr1 500 600 150 200 -301 #> 3 chr2 5000 6000 7000 8500 1001 # Report distance based on strand x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 10, 20, \"a\", 1, \"-\" ) y <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 8, 9, \"b\", 1, \"+\", \"chr1\", 21, 22, \"b\", 1, \"-\" ) res <- bed_closest(x, y) # convert distance based on strand res$.dist_strand <- ifelse(res$strand.x == \"+\", res$.dist, -(res$.dist)) res #> # A tibble: 2 × 14 #> chrom start.x end.x name.x score.x strand.x start.y end.y name.y score.y #> #> 1 chr1 10 20 a 1 - 21 22 b 1 #> 2 chr1 10 20 a 1 - 8 9 b 1 #> # ℹ 4 more variables: strand.y , .overlap , .dist , #> # .dist_strand # report absolute distances res$.abs_dist <- abs(res$.dist) res #> # A tibble: 2 × 15 #> chrom start.x end.x name.x score.x strand.x start.y end.y name.y score.y #> #> 1 chr1 10 20 a 1 - 21 22 b 1 #> 2 chr1 10 20 a 1 - 8 9 b 1 #> # ℹ 5 more variables: strand.y , .overlap , .dist , #> # .dist_strand , .abs_dist "},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":null,"dir":"Reference","previous_headings":"","what":"Cluster neighboring intervals. — bed_cluster","title":"Cluster neighboring intervals. — bed_cluster","text":"output .id column can used downstream grouping operations. Default max_dist = 0 means overlapping book-ended intervals clustered.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cluster neighboring intervals. — bed_cluster","text":"","code":"bed_cluster(x, max_dist = 0)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cluster neighboring intervals. — bed_cluster","text":"x ivl_df max_dist maximum distance clustered intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cluster neighboring intervals. — bed_cluster","text":"ivl_df .id column specifying sets clustered intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cluster neighboring intervals. — bed_cluster","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_cluster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cluster neighboring intervals. — bed_cluster","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 200, \"chr1\", 180, 250, \"chr1\", 250, 500, \"chr1\", 501, 1000, \"chr2\", 1, 100, \"chr2\", 150, 200 ) bed_cluster(x) #> # A tibble: 6 × 4 #> chrom start end .id #> #> 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 <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 10, \"chr1\", 5, 20, \"chr1\", 30, 40, \"chr1\", 40, 50, \"chr1\", 80, 90 ) bed_glyph(bed_cluster(x), label = \".id\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify intervals in a genome not covered by a query. — bed_complement","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"Identify intervals genome covered query.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"","code":"bed_complement(x, genome)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"x ivl_df genome ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_complement.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify intervals in a genome not covered by a query. — bed_complement","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 0, 10, \"chr1\", 75, 100 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 200 ) bed_glyph(bed_complement(x, genome)) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 500, \"chr2\", 600, \"chr3\", 800 ) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 300, \"chr1\", 200, 400, \"chr2\", 0, 100, \"chr2\", 200, 400, \"chr3\", 500, 600 ) # intervals not covered by x bed_complement(x, genome) #> # A tibble: 6 × 3 #> chrom start end #> #> 1 chr1 0 100 #> 2 chr1 400 500 #> 3 chr2 100 200 #> 4 chr2 400 600 #> 5 chr3 0 500 #> 6 chr3 600 800"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute coverage of intervals. — bed_coverage","title":"Compute coverage of intervals. — bed_coverage","text":"Compute coverage intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute coverage of intervals. — bed_coverage","text":"","code":"bed_coverage(x, y, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute coverage of intervals. — bed_coverage","text":"x ivl_df y ivl_df ... extra arguments (used)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute coverage of intervals. — bed_coverage","text":"ivl_df following additional columns: .ints number x intersections .cov per-base coverage x intervals .len total length y intervals covered x intervals .frac .len scaled number y intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute coverage of intervals. — bed_coverage","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Compute coverage of intervals. — bed_coverage","text":"Book-ended intervals included coverage calculations.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_coverage.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute coverage of intervals. — bed_coverage","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 100, 500, \"+\", \"chr2\", 200, 400, \"+\", \"chr2\", 300, 500, \"-\", \"chr2\", 800, 900, \"-\" ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 150, 400, 100, \"+\", \"chr1\", 500, 550, 100, \"+\", \"chr2\", 230, 430, 200, \"-\", \"chr2\", 350, 430, 300, \"-\" ) bed_coverage(x, y) #> # A tibble: 4 × 8 #> chrom start end strand .ints .cov .len .frac #> #> 1 chr1 100 500 + 2 250 400 0.625 #> 2 chr2 200 400 + 2 170 200 0.85 #> 3 chr2 300 500 - 2 130 200 0.65 #> 4 chr2 800 900 - 0 0 100 0"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":null,"dir":"Reference","previous_headings":"","what":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"Calculate Fisher's test number intervals shared unique two sets x y intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"","code":"bed_fisher(x, y, genome)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"x ivl_df y ivl_df genome genome_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_fisher.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fisher's test to measure overlap between two sets of intervals. — bed_fisher","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, n = 1e4, seed = 1010486) y <- bed_random(genome, n = 1e4, seed = 9203911) bed_fisher(x, y, genome) #> # A tibble: 1 × 6 #> estimate p.value conf.low conf.high method alternative #> #> 1 0.945 0.707 0.722 1.22 Fisher's Exact Test for Count… two.sided"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":null,"dir":"Reference","previous_headings":"","what":"Create flanking intervals from input intervals. — bed_flank","title":"Create flanking intervals from input intervals. — bed_flank","text":"Create flanking intervals input intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create flanking intervals from input intervals. — bed_flank","text":"","code":"bed_flank( x, genome, both = 0, left = 0, right = 0, fraction = FALSE, strand = FALSE, trim = FALSE, ... )"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create flanking intervals from input intervals. — bed_flank","text":"x ivl_df genome genome_df number bases sizes left number bases left side right number bases right side fraction define flanks based fraction interval length strand define left right based strand trim adjust coordinates --bounds intervals ... extra arguments (used)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create flanking intervals from input intervals. — bed_flank","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_flank.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create flanking intervals from input intervals. — bed_flank","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 130 ) bed_glyph(bed_flank(x, genome, both = 20)) x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 500, 1000, \".\", \".\", \"+\", \"chr1\", 1000, 1500, \".\", \".\", \"-\" ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 5000 ) bed_flank(x, genome, left = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 400 500 . . + #> 2 chr1 900 1000 . . - bed_flank(x, genome, right = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 1000 1100 . . + #> 2 chr1 1500 1600 . . - bed_flank(x, genome, both = 100) #> # A tibble: 4 × 6 #> chrom start end name score strand #> #> 1 chr1 400 500 . . + #> 2 chr1 900 1000 . . - #> 3 chr1 1000 1100 . . + #> 4 chr1 1500 1600 . . - bed_flank(x, genome, both = 0.5, fraction = TRUE) #> # A tibble: 4 × 6 #> chrom start end name score strand #> #> 1 chr1 250 500 . . + #> 2 chr1 750 1000 . . - #> 3 chr1 1000 1250 . . + #> 4 chr1 1500 1750 . . -"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate coverage across a genome — bed_genomecov","title":"Calculate coverage across a genome — bed_genomecov","text":"function useful calculating interval coverage across entire genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate coverage across a genome — bed_genomecov","text":"","code":"bed_genomecov(x, genome, zero_depth = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate coverage across a genome — bed_genomecov","text":"x ivl_df genome genome_df zero_depth TRUE, report intervals zero depth. Zero depth intervals reported respect groups.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate coverage across a genome — bed_genomecov","text":"ivl_df additional column: .depth depth interval coverage","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate coverage across a genome — bed_genomecov","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_genomecov.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate coverage across a genome — bed_genomecov","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 20, 70, \"+\", \"chr1\", 50, 100, \"-\", \"chr1\", 200, 250, \"+\", \"chr1\", 220, 250, \"+\" ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 500, \"chr2\", 1000 ) bed_genomecov(x, genome) #> # A tibble: 5 × 4 #> chrom start end .depth #> #> 1 chr1 20 50 1 #> 2 chr1 50 70 2 #> 3 chr1 70 100 1 #> 4 chr1 200 220 1 #> 5 chr1 220 250 2 bed_genomecov(dplyr::group_by(x, strand), genome) #> # A tibble: 4 × 5 #> chrom start end strand .depth #> #> 1 chr1 20 70 + 1 #> 2 chr1 200 220 + 1 #> 3 chr1 220 250 + 2 #> 4 chr1 50 100 - 1 bed_genomecov(dplyr::group_by(x, strand), genome, zero_depth = TRUE) #> # A tibble: 11 × 5 #> chrom start end strand .depth #> #> 1 chr1 0 20 + 0 #> 2 chr1 0 50 - 0 #> 3 chr1 20 70 + 1 #> 4 chr1 50 100 - 1 #> 5 chr1 70 200 + 0 #> 6 chr1 100 500 - 0 #> 7 chr1 200 220 + 1 #> 8 chr1 220 250 + 2 #> 9 chr1 250 500 + 0 #> 10 chr2 0 1000 + 0 #> 11 chr2 0 1000 - 0"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"Create example glyphs for valr functions. — bed_glyph","title":"Create example glyphs for valr functions. — bed_glyph","text":"Used illustrate output valr functions small examples.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create example glyphs for valr functions. — bed_glyph","text":"","code":"bed_glyph(expr, label = NULL)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create example glyphs for valr functions. — bed_glyph","text":"expr expression evaluate label column name use label values. present result call.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create example glyphs for valr functions. — bed_glyph","text":"ggplot2::ggplot()","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_glyph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create example glyphs for valr functions. — bed_glyph","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, \"chr1\", 30, 75, 50 ) bed_glyph(bed_intersect(x, y)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 30, 75, \"chr1\", 50, 90, \"chr1\", 91, 120 ) bed_glyph(bed_merge(x)) bed_glyph(bed_cluster(x), label = \".id\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify intersecting intervals. — bed_intersect","title":"Identify intersecting intervals. — bed_intersect","text":"Report intersecting intervals x y tbls. Book-ended intervals .overlap values 0 output.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify intersecting intervals. — bed_intersect","text":"","code":"bed_intersect(x, ..., invert = FALSE, suffix = c(\".x\", \".y\"))"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify intersecting intervals. — bed_intersect","text":"x ivl_df ... one (e.g. list ) y ivl_df()s invert report x intervals y suffix colname suffixes output","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify intersecting intervals. — bed_intersect","text":"ivl_df original columns x y suffixed .x .y, new .overlap column extent overlap intersecting intervals. multiple y tbls supplied, .source contains variable names associated interval. original columns y suffixed .y output. ... contains named inputs (.e = y, b = z list(= y, b = z)), .source contain supplied names (see examples).","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify intersecting intervals. — bed_intersect","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_intersect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify intersecting intervals. — bed_intersect","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 30, 75 ) bed_glyph(bed_intersect(x, y)) bed_glyph(bed_intersect(x, y, invert = TRUE)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 500, \"chr2\", 200, 400, \"chr2\", 300, 500, \"chr2\", 800, 900 ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, \"chr1\", 150, 400, 100, \"chr1\", 500, 550, 100, \"chr2\", 230, 430, 200, \"chr2\", 350, 430, 300 ) bed_intersect(x, y) #> # A tibble: 6 × 7 #> chrom start.x end.x start.y end.y value.y .overlap #> #> 1 chr1 100 500 150 400 100 250 #> 2 chr1 100 500 500 550 100 0 #> 3 chr2 200 400 230 430 200 170 #> 4 chr2 200 400 350 430 300 50 #> 5 chr2 300 500 230 430 200 130 #> 6 chr2 300 500 350 430 300 80 bed_intersect(x, y, invert = TRUE) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr2 800 900 # start and end of each overlapping interval res <- bed_intersect(x, y) dplyr::mutate(res, start = pmax(start.x, start.y), end = pmin(end.x, end.y) ) #> # A tibble: 6 × 9 #> chrom start.x end.x start.y end.y value.y .overlap start end #> #> 1 chr1 100 500 150 400 100 250 150 400 #> 2 chr1 100 500 500 550 100 0 500 500 #> 3 chr2 200 400 230 430 200 170 230 400 #> 4 chr2 200 400 350 430 300 50 350 400 #> 5 chr2 300 500 230 430 200 130 300 430 #> 6 chr2 300 500 350 430 300 80 350 430 z <- tibble::tribble( ~chrom, ~start, ~end, ~value, \"chr1\", 150, 400, 100, \"chr1\", 500, 550, 100, \"chr2\", 230, 430, 200, \"chr2\", 750, 900, 400 ) bed_intersect(x, y, z) #> # A tibble: 11 × 8 #> chrom start.x end.x start.y end.y value.y .source .overlap #> #> 1 chr1 100 500 150 400 100 y 250 #> 2 chr1 100 500 150 400 100 z 250 #> 3 chr1 100 500 500 550 100 y 0 #> 4 chr1 100 500 500 550 100 z 0 #> 5 chr2 200 400 230 430 200 y 170 #> 6 chr2 200 400 230 430 200 z 170 #> 7 chr2 200 400 350 430 300 y 50 #> 8 chr2 300 500 230 430 200 y 130 #> 9 chr2 300 500 230 430 200 z 130 #> 10 chr2 300 500 350 430 300 y 80 #> 11 chr2 800 900 750 900 400 z 100 bed_intersect(x, exons = y, introns = z) #> # A tibble: 11 × 8 #> chrom start.x end.x start.y end.y value.y .source .overlap #> #> 1 chr1 100 500 150 400 100 exons 250 #> 2 chr1 100 500 150 400 100 introns 250 #> 3 chr1 100 500 500 550 100 exons 0 #> 4 chr1 100 500 500 550 100 introns 0 #> 5 chr2 200 400 230 430 200 exons 170 #> 6 chr2 200 400 230 430 200 introns 170 #> 7 chr2 200 400 350 430 300 exons 50 #> 8 chr2 300 500 230 430 200 exons 130 #> 9 chr2 300 500 230 430 200 introns 130 #> 10 chr2 300 500 350 430 300 exons 80 #> 11 chr2 800 900 750 900 400 introns 100 # a list of tbl_intervals can also be passed bed_intersect(x, list(exons = y, introns = z)) #> # A tibble: 11 × 8 #> chrom start.x end.x start.y end.y value.y .source .overlap #> #> 1 chr1 100 500 150 400 100 exons 250 #> 2 chr1 100 500 150 400 100 introns 250 #> 3 chr1 100 500 500 550 100 exons 0 #> 4 chr1 100 500 500 550 100 introns 0 #> 5 chr2 200 400 230 430 200 exons 170 #> 6 chr2 200 400 230 430 200 introns 170 #> 7 chr2 200 400 350 430 300 exons 50 #> 8 chr2 300 500 230 430 200 exons 130 #> 9 chr2 300 500 230 430 200 introns 130 #> 10 chr2 300 500 350 430 300 exons 80 #> 11 chr2 800 900 750 900 400 introns 100"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"Quantifies extent overlap sets intervals terms base-pairs. Groups shared input used calculate statistic subsets data.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"","code":"bed_jaccard(x, y)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"x ivl_df y ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"tibble following columns: len_i length intersection base-pairs len_u length union base-pairs jaccard value jaccard statistic n_int number intersecting intervals x y inputs grouped, return value contain one set values per group.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"Jaccard statistic takes values [0,1] measured : $$ J(x,y) = \\frac{\\mid x \\bigcap y \\mid} {\\mid x \\bigcup y \\mid} = \\frac{\\mid x \\bigcap y \\mid} {\\mid x \\mid + \\mid y \\mid - \\mid x \\bigcap y \\mid} $$ Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_jaccard.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the Jaccard statistic for two sets of intervals. — bed_jaccard","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_jaccard(x, y) #> # A tibble: 1 × 4 #> len_i len_u jaccard n #> #> 1 236184699 1708774142 0.160 399981 # calculate jaccard per chromosome bed_jaccard( dplyr::group_by(x, chrom), dplyr::group_by(y, chrom) ) #> # A tibble: 25 × 5 #> chrom len_i len_u jaccard n #> #> 1 chr1 18939046 137345996 0.160 32156 #> 2 chr10 10524360 75209830 0.163 17830 #> 3 chr11 10378246 74655177 0.161 17497 #> 4 chr12 10146255 73725046 0.160 17163 #> 5 chr13 8867024 63737541 0.162 14992 #> 6 chr14 8047103 59033144 0.158 13647 #> 7 chr15 7794057 56514322 0.160 13236 #> 8 chr16 6907575 49874077 0.161 11650 #> 9 chr17 6186446 44917522 0.160 10487 #> 10 chr18 6044900 43248877 0.162 10129 #> # ℹ 15 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":null,"dir":"Reference","previous_headings":"","what":"Divide intervals into new sub-intervals (","title":"Divide intervals into new sub-intervals (","text":"Divide intervals new sub-intervals (\"windows\").","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Divide intervals into new sub-intervals (","text":"","code":"bed_makewindows(x, win_size = 0, step_size = 0, num_win = 0, reverse = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Divide intervals into new sub-intervals (","text":"x ivl_df win_size divide intervals fixed-size windows step_size size step next window num_win divide intervals fixed number windows reverse reverse window numbers","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Divide intervals into new sub-intervals (","text":"ivl_df .win_id column contains numeric identifier window.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Divide intervals into new sub-intervals (","text":"name .win_id columns can used create new interval names (see 'namenum' example ) subsequent group_by operations (see vignette).","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_makewindows.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Divide intervals into new sub-intervals (","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 100, 200, \"A\", \".\", \"+\" ) bed_glyph(bed_makewindows(x, num_win = 10), label = \".win_id\") # Fixed number of windows bed_makewindows(x, num_win = 10) #> # A tibble: 10 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 1 #> 2 chr1 110 120 A . + 2 #> 3 chr1 120 130 A . + 3 #> 4 chr1 130 140 A . + 4 #> 5 chr1 140 150 A . + 5 #> 6 chr1 150 160 A . + 6 #> 7 chr1 160 170 A . + 7 #> 8 chr1 170 180 A . + 8 #> 9 chr1 180 190 A . + 9 #> 10 chr1 190 200 A . + 10 # Fixed window size bed_makewindows(x, win_size = 10) #> # A tibble: 10 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 1 #> 2 chr1 110 120 A . + 2 #> 3 chr1 120 130 A . + 3 #> 4 chr1 130 140 A . + 4 #> 5 chr1 140 150 A . + 5 #> 6 chr1 150 160 A . + 6 #> 7 chr1 160 170 A . + 7 #> 8 chr1 170 180 A . + 8 #> 9 chr1 180 190 A . + 9 #> 10 chr1 190 200 A . + 10 # Fixed window size with overlaps bed_makewindows(x, win_size = 10, step_size = 5) #> # A tibble: 20 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 1 #> 2 chr1 105 115 A . + 2 #> 3 chr1 110 120 A . + 3 #> 4 chr1 115 125 A . + 4 #> 5 chr1 120 130 A . + 5 #> 6 chr1 125 135 A . + 6 #> 7 chr1 130 140 A . + 7 #> 8 chr1 135 145 A . + 8 #> 9 chr1 140 150 A . + 9 #> 10 chr1 145 155 A . + 10 #> 11 chr1 150 160 A . + 11 #> 12 chr1 155 165 A . + 12 #> 13 chr1 160 170 A . + 13 #> 14 chr1 165 175 A . + 14 #> 15 chr1 170 180 A . + 15 #> 16 chr1 175 185 A . + 16 #> 17 chr1 180 190 A . + 17 #> 18 chr1 185 195 A . + 18 #> 19 chr1 190 200 A . + 19 #> 20 chr1 195 200 A . + 20 # reverse win_id bed_makewindows(x, win_size = 10, reverse = TRUE) #> # A tibble: 10 × 7 #> chrom start end name score strand .win_id #> #> 1 chr1 100 110 A . + 10 #> 2 chr1 110 120 A . + 9 #> 3 chr1 120 130 A . + 8 #> 4 chr1 130 140 A . + 7 #> 5 chr1 140 150 A . + 6 #> 6 chr1 150 160 A . + 5 #> 7 chr1 160 170 A . + 4 #> 8 chr1 170 180 A . + 3 #> 9 chr1 180 190 A . + 2 #> 10 chr1 190 200 A . + 1 # bedtools 'namenum' wins <- bed_makewindows(x, win_size = 10) dplyr::mutate(wins, namenum = stringr::str_c(name, \"_\", .win_id)) #> # A tibble: 10 × 8 #> chrom start end name score strand .win_id namenum #> #> 1 chr1 100 110 A . + 1 A_1 #> 2 chr1 110 120 A . + 2 A_2 #> 3 chr1 120 130 A . + 3 A_3 #> 4 chr1 130 140 A . + 4 A_4 #> 5 chr1 140 150 A . + 5 A_5 #> 6 chr1 150 160 A . + 6 A_6 #> 7 chr1 160 170 A . + 7 A_7 #> 8 chr1 170 180 A . + 8 A_8 #> 9 chr1 180 190 A . + 9 A_9 #> 10 chr1 190 200 A . + 10 A_10"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate summaries from overlapping intervals. — bed_map","title":"Calculate summaries from overlapping intervals. — bed_map","text":"Apply functions like min() max() intersecting intervals. bed_map() uses bed_intersect() identify intersecting intervals, output columns suffixed .x .y. Expressions refer input columns x y columns must take suffixes account.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate summaries from overlapping intervals. — bed_map","text":"","code":"bed_map(x, y, ..., min_overlap = 1) concat(.data, sep = \",\") values_unique(.data, sep = \",\") values(.data, sep = \",\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate summaries from overlapping intervals. — bed_map","text":"x ivl_df y ivl_df ... name-value pairs specifying column names expressions apply min_overlap minimum overlap intervals. .data data sep separator character","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate summaries from overlapping intervals. — bed_map","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate summaries from overlapping intervals. — bed_map","text":"Book-ended intervals can included setting min_overlap = 0. Non-intersecting intervals x included result NA values. input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate summaries from overlapping intervals. — bed_map","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, 'chr1', 100, 250, 'chr2', 250, 500 ) y <- tibble::tribble( ~chrom, ~start, ~end, ~value, 'chr1', 100, 250, 10, 'chr1', 150, 250, 20, 'chr2', 250, 500, 500 ) bed_glyph(bed_map(x, y, value = sum(value)), label = 'value') # summary examples bed_map(x, y, .sum = sum(value)) #> # A tibble: 2 × 4 #> chrom start end .sum #> #> 1 chr1 100 250 30 #> 2 chr2 250 500 500 bed_map(x, y, .min = min(value), .max = max(value)) #> # A tibble: 2 × 5 #> chrom start end .min .max #> #> 1 chr1 100 250 10 20 #> 2 chr2 250 500 500 500 # identify non-intersecting intervals to include in the result res <- bed_map(x, y, .sum = sum(value)) x_not <- bed_intersect(x, y, invert = TRUE) dplyr::bind_rows(res, x_not) #> # A tibble: 2 × 4 #> chrom start end .sum #> #> 1 chr1 100 250 30 #> 2 chr2 250 500 500 # create a list-column bed_map(x, y, .values = list(value)) #> # A tibble: 2 × 4 #> chrom start end .values #> #> 1 chr1 100 250 #> 2 chr2 250 500 # use `nth` family from dplyr bed_map(x, y, .first = dplyr::first(value)) #> # A tibble: 2 × 4 #> chrom start end .first #> #> 1 chr1 100 250 10 #> 2 chr2 250 500 500 bed_map(x, y, .absmax = abs(max(value))) #> # A tibble: 2 × 4 #> chrom start end .absmax #> #> 1 chr1 100 250 20 #> 2 chr2 250 500 500 bed_map(x, y, .count = length(value)) #> # A tibble: 2 × 4 #> chrom start end .count #> #> 1 chr1 100 250 2 #> 2 chr2 250 500 1 bed_map(x, y, .vals = values(value)) #> # A tibble: 2 × 4 #> chrom start end .vals #> #> 1 chr1 100 250 10,20 #> 2 chr2 250 500 500 # count defaults are NA not 0; differs from bedtools2 ... bed_map(x, y, .counts = dplyr::n()) #> # A tibble: 2 × 4 #> chrom start end .counts #> #> 1 chr1 100 250 2 #> 2 chr2 250 500 1 # ... but NA counts can be coverted to 0's dplyr::mutate(bed_map(x, y, .counts = dplyr::n()), .counts = ifelse(is.na(.counts), 0, .counts)) #> # A tibble: 2 × 4 #> chrom start end .counts #> #> 1 chr1 100 250 2 #> 2 chr2 250 500 1"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge overlapping intervals. — bed_merge","title":"Merge overlapping intervals. — bed_merge","text":"Operations can performed merged intervals specifying name-value pairs. Default max_dist 0 means book-ended intervals merged.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge overlapping intervals. — bed_merge","text":"","code":"bed_merge(x, max_dist = 0, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge overlapping intervals. — bed_merge","text":"x ivl_df max_dist maximum distance intervals merge ... name-value pairs specify operations merged intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Merge overlapping intervals. — bed_merge","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Merge overlapping intervals. — bed_merge","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_merge.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Merge overlapping intervals. — bed_merge","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 50, \"chr1\", 10, 75, \"chr1\", 100, 120 ) bed_glyph(bed_merge(x)) x <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 1, 50, 1, \"+\", \"chr1\", 100, 200, 2, \"+\", \"chr1\", 150, 250, 3, \"-\", \"chr2\", 1, 25, 4, \"+\", \"chr2\", 200, 400, 5, \"-\", \"chr2\", 400, 500, 6, \"+\", \"chr2\", 450, 550, 7, \"+\" ) bed_merge(x) #> # A tibble: 4 × 3 #> chrom start end #> #> 1 chr1 1 50 #> 2 chr1 100 250 #> 3 chr2 1 25 #> 4 chr2 200 550 bed_merge(x, max_dist = 100) #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 1 250 #> 2 chr2 1 25 #> 3 chr2 200 550 # merge intervals on same strand bed_merge(dplyr::group_by(x, strand)) #> # A tibble: 6 × 4 #> # Groups: strand [2] #> chrom start end strand #> #> 1 chr1 1 50 + #> 2 chr1 100 200 + #> 3 chr1 150 250 - #> 4 chr2 1 25 + #> 5 chr2 400 550 + #> 6 chr2 200 400 - bed_merge(x, .value = sum(value)) #> # A tibble: 4 × 4 #> chrom start end .value #> #> 1 chr1 1 50 1 #> 2 chr1 100 250 5 #> 3 chr2 1 25 4 #> 4 chr2 200 550 18"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":null,"dir":"Reference","previous_headings":"","what":"Partition intervals into elemental intervals — bed_partition","title":"Partition intervals into elemental intervals — bed_partition","text":"Convert set intervals elemental intervals contain start end position set.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Partition intervals into elemental intervals — bed_partition","text":"","code":"bed_partition(x, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Partition intervals into elemental intervals — bed_partition","text":"x ivl_df ... name-value pairs specifying column names expressions apply","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Partition intervals into elemental intervals — bed_partition","text":"ivl_df()","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Partition intervals into elemental intervals — bed_partition","text":"Summary operations, min() max() can performed elemental intervals specifying name-value pairs. function useful calculating summaries across overlapping intervals without merging intervals. input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_partition.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Partition intervals into elemental intervals — bed_partition","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 100, 500, 10, \"+\", \"chr1\", 200, 400, 20, \"-\", \"chr1\", 300, 550, 30, \"+\", \"chr1\", 550, 575, 2, \"+\", \"chr1\", 800, 900, 5, \"+\" ) bed_glyph(bed_partition(x)) bed_glyph(bed_partition(x, value = sum(value)), label = \"value\") bed_partition(x) #> # A tibble: 7 × 3 #> chrom start end #> #> 1 chr1 100 200 #> 2 chr1 200 300 #> 3 chr1 300 400 #> 4 chr1 400 500 #> 5 chr1 500 550 #> 6 chr1 550 575 #> 7 chr1 800 900 # compute summary over each elemental interval bed_partition(x, value = sum(value)) #> # A tibble: 7 × 4 #> chrom start end value #> #> 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 × 5 #> chrom start end strand value #> #> 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 <- tibble::tribble( ~chrom, ~start, ~end, ~value, ~strand, \"chr1\", 10, 500, 100, \"+\", \"chr1\", 250, 420, 200, \"-\", \"chr1\", 350, 550, 300, \"+\", \"chr1\", 550, 555, 20, \"+\", \"chr1\", 800, 900, 50, \"+\" ) x <- dplyr::bind_rows(x, y) bed_partition(x, value = sum(value)) #> # A tibble: 11 × 5 #> chrom start end strand value #> #> 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"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":null,"dir":"Reference","previous_headings":"","what":"Projection test for query interval overlap. — bed_projection","title":"Projection test for query interval overlap. — bed_projection","text":"Projection test query interval overlap.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projection test for query interval overlap. — bed_projection","text":"","code":"bed_projection(x, y, genome, by_chrom = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Projection test for query interval overlap. — bed_projection","text":"x ivl_df y ivl_df genome genome_df by_chrom compute test per chromosome","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Projection test for query interval overlap. — bed_projection","text":"ivl_df following columns: chrom name chromosome tested by_chrom = TRUE, otherwise value whole_genome p.value p-value binomial test. p-values > 0.5 converted 1 - p-value lower_tail FALSE obs_exp_ratio ratio observed expected overlap frequency lower_tail TRUE indicates observed overlaps lower tail distribution (e.g., less overlap expected). FALSE indicates observed overlaps upper tail distribution (e.g., overlap expected)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Projection test for query interval overlap. — bed_projection","text":"Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_projection.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Projection test for query interval overlap. — bed_projection","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_projection(x, y, genome) #> # A tibble: 1 × 4 #> chrom p.value obs_exp_ratio lower_tail #> #> 1 whole_genome 0.000850 1.01 FALSE bed_projection(x, y, genome, by_chrom = TRUE) #> # A tibble: 25 × 4 #> chrom p.value obs_exp_ratio lower_tail #> #> 1 chr1 0.176 1.01 FALSE #> 2 chr10 0.0209 1.02 FALSE #> 3 chr11 0.118 1.01 FALSE #> 4 chr12 0.479 1.00 FALSE #> 5 chr13 0.245 1.01 FALSE #> 6 chr14 0.120 0.990 TRUE #> 7 chr15 0.333 1.00 FALSE #> 8 chr16 0.213 1.01 FALSE #> 9 chr17 0.181 0.991 TRUE #> 10 chr18 0.0306 1.02 FALSE #> # ℹ 15 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate randomly placed intervals on a genome. — bed_random","title":"Generate randomly placed intervals on a genome. — bed_random","text":"Generate randomly placed intervals genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate randomly placed intervals on a genome. — bed_random","text":"","code":"bed_random(genome, length = 1000, n = 1e+06, seed = 0, sorted = TRUE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate randomly placed intervals on a genome. — bed_random","text":"genome genome_df length length intervals n number intervals generate seed seed RNG reproducible intervals sorted return sorted output","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate randomly placed intervals on a genome. — bed_random","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate randomly placed intervals on a genome. — bed_random","text":"Sorting can suppressed sorted = FALSE.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_random.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate randomly placed intervals on a genome. — bed_random","text":"","code":"genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 10000000, \"chr2\", 50000000, \"chr3\", 60000000, \"chrX\", 5000000 ) bed_random(genome, seed = 10104) #> # A tibble: 1,000,000 × 3 #> chrom start end #> #> 1 chr1 265 1265 #> 2 chr1 315 1315 #> 3 chr1 335 1335 #> 4 chr1 513 1513 #> 5 chr1 625 1625 #> 6 chr1 635 1635 #> 7 chr1 653 1653 #> 8 chr1 731 1731 #> 9 chr1 859 1859 #> 10 chr1 1024 2024 #> # ℹ 999,990 more rows # sorting can be suppressed bed_random(genome, sorted = FALSE, seed = 10104) #> # A tibble: 1,000,000 × 3 #> chrom start end #> #> 1 chr3 2681468 2682468 #> 2 chr3 25364020 25365020 #> 3 chr2 43134407 43135407 #> 4 chr2 36344257 36345257 #> 5 chr3 39019690 39020690 #> 6 chr3 59869387 59870387 #> 7 chr3 56220373 56221373 #> 8 chr3 57965913 57966913 #> 9 chr2 25303342 25304342 #> 10 chr3 16018594 16019594 #> # ℹ 999,990 more rows # 500 random intervals of length 500 bed_random(genome, length = 500, n = 500, seed = 10104) #> # A tibble: 500 × 3 #> chrom start end #> #> 1 chr1 379360 379860 #> 2 chr1 394770 395270 #> 3 chr1 1215880 1216380 #> 4 chr1 1339287 1339787 #> 5 chr1 2046513 2047013 #> 6 chr1 2156755 2157255 #> 7 chr1 2189109 2189609 #> 8 chr1 2221665 2222165 #> 9 chr1 2223456 2223956 #> 10 chr1 2253135 2253635 #> # ℹ 490 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute relative distances between intervals. — bed_reldist","title":"Compute relative distances between intervals. — bed_reldist","text":"Compute relative distances intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute relative distances between intervals. — bed_reldist","text":"","code":"bed_reldist(x, y, detail = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute relative distances between intervals. — bed_reldist","text":"x ivl_df y ivl_df detail report relative distances x interval.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute relative distances between intervals. — bed_reldist","text":"detail = FALSE, ivl_df summarizes calculated .reldist values following columns: .reldist relative distance metric .counts number metric observations .total total observations .freq frequency observation detail = TRUE, .reldist column reports relative distance input x interval.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute relative distances between intervals. — bed_reldist","text":"Interval statistics can used combination dplyr::group_by() dplyr::() calculate statistics subsets data. See vignette('interval-stats') examples.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_reldist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute relative distances between intervals. — bed_reldist","text":"","code":"genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) x <- bed_random(genome, seed = 1010486) y <- bed_random(genome, seed = 9203911) bed_reldist(x, y) #> # A tibble: 51 × 4 #> .reldist .counts .total .freq #> #> 1 0 20202 999938 0.0202 #> 2 0.01 20031 999938 0.0200 #> 3 0.02 19977 999938 0.0200 #> 4 0.03 19871 999938 0.0199 #> 5 0.04 20129 999938 0.0201 #> 6 0.05 20197 999938 0.0202 #> 7 0.06 20020 999938 0.0200 #> 8 0.07 20063 999938 0.0201 #> 9 0.08 20053 999938 0.0201 #> 10 0.09 20021 999938 0.0200 #> # ℹ 41 more rows bed_reldist(x, y, detail = TRUE) #> # A tibble: 999,938 × 4 #> chrom start end .reldist #> #> 1 chr1 5184 6184 0.270 #> 2 chr1 7663 8663 0.226 #> 3 chr1 9858 10858 0.317 #> 4 chr1 13805 14805 0.361 #> 5 chr1 14081 15081 0.402 #> 6 chr1 16398 17398 0.253 #> 7 chr1 17486 18486 0.0912 #> 8 chr1 22063 23063 0.107 #> 9 chr1 22494 23494 0.207 #> 10 chr1 29351 30351 0.400 #> # ℹ 999,928 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Adjust intervals by a fixed size. — bed_shift","title":"Adjust intervals by a fixed size. — bed_shift","text":"--bounds intervals removed default.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adjust intervals by a fixed size. — bed_shift","text":"","code":"bed_shift(x, genome, size = 0, fraction = 0, trim = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adjust intervals by a fixed size. — bed_shift","text":"x ivl_df genome ivl_df size number bases shift. positive numbers shift right, negative shift left. fraction define size fraction interval trim adjust coordinates --bounds intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adjust intervals by a fixed size. — bed_shift","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Adjust intervals by a fixed size. — bed_shift","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 125 ) bed_glyph(bed_shift(x, genome, size = -20)) x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 100, 150, \"+\", \"chr1\", 200, 250, \"+\", \"chr2\", 300, 350, \"+\", \"chr2\", 400, 450, \"-\", \"chr3\", 500, 550, \"-\", \"chr3\", 600, 650, \"-\" ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 1000, \"chr2\", 2000, \"chr3\", 3000 ) bed_shift(x, genome, 100) #> # A tibble: 6 × 4 #> chrom start end strand #> #> 1 chr1 200 250 + #> 2 chr1 300 350 + #> 3 chr2 400 450 + #> 4 chr2 500 550 - #> 5 chr3 600 650 - #> 6 chr3 700 750 - bed_shift(x, genome, fraction = 0.5) #> # A tibble: 6 × 4 #> chrom start end strand #> #> 1 chr1 125 175 + #> 2 chr1 225 275 + #> 3 chr2 325 375 + #> 4 chr2 425 475 - #> 5 chr3 525 575 - #> 6 chr3 625 675 - # shift with respect to strand stranded <- dplyr::group_by(x, strand) bed_shift(stranded, genome, 100) #> # A tibble: 6 × 4 #> chrom start end strand #> #> 1 chr1 200 250 + #> 2 chr1 300 350 + #> 3 chr2 400 450 + #> 4 chr2 300 350 - #> 5 chr3 400 450 - #> 6 chr3 500 550 -"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":null,"dir":"Reference","previous_headings":"","what":"Shuffle input intervals. — bed_shuffle","title":"Shuffle input intervals. — bed_shuffle","text":"Shuffle input intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shuffle input intervals. — bed_shuffle","text":"","code":"bed_shuffle( x, genome, incl = NULL, excl = NULL, max_tries = 1000, within = FALSE, seed = 0 )"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shuffle input intervals. — bed_shuffle","text":"x ivl_df genome genome_df incl ivl_df included intervals excl ivl_df excluded intervals max_tries maximum tries identify bounded interval within shuffle within chromosomes seed seed reproducible intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Shuffle input intervals. — bed_shuffle","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_shuffle.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Shuffle input intervals. — bed_shuffle","text":"","code":"genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 1e6, \"chr2\", 2e6, \"chr3\", 4e6 ) x <- bed_random(genome, seed = 1010486) bed_shuffle(x, genome, seed = 9830491) #> # A tibble: 1,000,000 × 3 #> chrom start end #> #> 1 chr2 1463822 1464822 #> 2 chr2 619967 620967 #> 3 chr2 1769865 1770865 #> 4 chr2 203953 204953 #> 5 chr3 2119387 2120387 #> 6 chr2 1216667 1217667 #> 7 chr3 2109652 2110652 #> 8 chr2 213473 214473 #> 9 chr1 154156 155156 #> 10 chr3 2201278 2202278 #> # ℹ 999,990 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":null,"dir":"Reference","previous_headings":"","what":"Increase the size of input intervals. — bed_slop","title":"Increase the size of input intervals. — bed_slop","text":"Increase size input intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Increase the size of input intervals. — bed_slop","text":"","code":"bed_slop( x, genome, both = 0, left = 0, right = 0, fraction = FALSE, strand = FALSE, trim = FALSE, ... )"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Increase the size of input intervals. — bed_slop","text":"x ivl_df genome genome_df number bases sizes left number bases left side right number bases right side fraction define flanks based fraction interval length strand define left right based strand trim adjust coordinates --bounds intervals ... extra arguments (used)","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Increase the size of input intervals. — bed_slop","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_slop.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Increase the size of input intervals. — bed_slop","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 110, 120, \"chr1\", 225, 235 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 400 ) bed_glyph(bed_slop(x, genome, both = 20, trim = TRUE)) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 5000 ) x <- tibble::tribble( ~chrom, ~start, ~end, ~name, ~score, ~strand, \"chr1\", 500, 1000, \".\", \".\", \"+\", \"chr1\", 1000, 1500, \".\", \".\", \"-\" ) bed_slop(x, genome, left = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 400 1000 . . + #> 2 chr1 900 1500 . . - bed_slop(x, genome, right = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 500 1100 . . + #> 2 chr1 1000 1600 . . - bed_slop(x, genome, both = 100) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 400 1100 . . + #> 2 chr1 900 1600 . . - bed_slop(x, genome, both = 0.5, fraction = TRUE) #> # A tibble: 2 × 6 #> chrom start end name score strand #> #> 1 chr1 250 1250 . . + #> 2 chr1 750 1750 . . -"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":null,"dir":"Reference","previous_headings":"","what":"Sort a set of intervals. — bed_sort","title":"Sort a set of intervals. — bed_sort","text":"Sort set intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sort a set of intervals. — bed_sort","text":"","code":"bed_sort(x, by_size = FALSE, by_chrom = FALSE, reverse = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sort a set of intervals. — bed_sort","text":"x ivl_df by_size sort interval size by_chrom sort within chromosome reverse reverse sort order","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_sort.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sort a set of intervals. — bed_sort","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr8\", 500, 1000, \"chr8\", 1000, 5000, \"chr8\", 100, 200, \"chr1\", 100, 300, \"chr1\", 100, 200 ) # sort by chrom and start bed_sort(x) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr1 100 200 #> 2 chr1 100 300 #> 3 chr8 100 200 #> 4 chr8 500 1000 #> 5 chr8 1000 5000 # reverse sort order bed_sort(x, reverse = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr1 100 300 #> 2 chr1 100 200 #> 3 chr8 1000 5000 #> 4 chr8 500 1000 #> 5 chr8 100 200 # sort by interval size bed_sort(x, by_size = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr8 100 200 #> 2 chr1 100 200 #> 3 chr1 100 300 #> 4 chr8 500 1000 #> 5 chr8 1000 5000 # sort by decreasing interval size bed_sort(x, by_size = TRUE, reverse = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr8 1000 5000 #> 2 chr8 500 1000 #> 3 chr1 100 300 #> 4 chr8 100 200 #> 5 chr1 100 200 # sort by interval size within chrom bed_sort(x, by_size = TRUE, by_chrom = TRUE) #> # A tibble: 5 × 3 #> chrom start end #> #> 1 chr1 100 200 #> 2 chr1 100 300 #> 3 chr8 100 200 #> 4 chr8 500 1000 #> 5 chr8 1000 5000"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":null,"dir":"Reference","previous_headings":"","what":"Subtract two sets of intervals. — bed_subtract","title":"Subtract two sets of intervals. — bed_subtract","text":"Subtract y intervals x intervals.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subtract two sets of intervals. — bed_subtract","text":"","code":"bed_subtract(x, y, any = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subtract two sets of intervals. — bed_subtract","text":"x ivl_df y ivl_df remove x intervals overlap y","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subtract two sets of intervals. — bed_subtract","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_subtract.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subtract two sets of intervals. — bed_subtract","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 100 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 50, 75 ) bed_glyph(bed_subtract(x, y)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 100, 200, \"chr1\", 250, 400, \"chr1\", 500, 600, \"chr1\", 1000, 1200, \"chr1\", 1300, 1500 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 150, 175, \"chr1\", 510, 525, \"chr1\", 550, 575, \"chr1\", 900, 1050, \"chr1\", 1150, 1250, \"chr1\", 1299, 1501 ) bed_subtract(x, y) #> # A tibble: 7 × 3 #> chrom start end #> #> 1 chr1 100 150 #> 2 chr1 175 200 #> 3 chr1 250 400 #> 4 chr1 500 510 #> 5 chr1 525 550 #> 6 chr1 575 600 #> 7 chr1 1050 1150 bed_subtract(x, y, any = TRUE) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 250 400"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify intervals within a specified distance. — bed_window","title":"Identify intervals within a specified distance. — bed_window","text":"Identify intervals within specified distance.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify intervals within a specified distance. — bed_window","text":"","code":"bed_window(x, y, genome, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify intervals within a specified distance. — bed_window","text":"x ivl_df y ivl_df genome genome_df ... params bed_slop bed_intersect","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify intervals within a specified distance. — bed_window","text":"input tbls grouped chrom default, additional groups can added using dplyr::group_by(). example, grouping strand constrain analyses strand. compare opposing strands across two tbls, strands y tbl can first inverted using flip_strands().","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bed_window.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify intervals within a specified distance. — bed_window","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 25, 50, \"chr1\", 100, 125 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 60, 75 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 125 ) bed_glyph(bed_window(x, y, genome, both = 15)) x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 10, 100, \"chr2\", 200, 400, \"chr2\", 300, 500, \"chr2\", 800, 900 ) y <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 150, 400, \"chr2\", 230, 430, \"chr2\", 350, 430 ) genome <- tibble::tribble( ~chrom, ~size, \"chr1\", 500, \"chr2\", 1000 ) bed_window(x, y, genome, both = 100) #> # A tibble: 4 × 7 #> chrom start.x end.x start.y end.y .source .overlap #> #> 1 chr2 200 400 230 430 1 200 #> 2 chr2 200 400 350 430 1 80 #> 3 chr2 300 500 230 430 1 200 #> 4 chr2 300 500 350 430 1 80"},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":null,"dir":"Reference","previous_headings":"","what":"Select intervals bounded by a genome. — bound_intervals","title":"Select intervals bounded by a genome. — bound_intervals","text":"Used remove --bounds intervals, trim interval coordinates using genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select intervals bounded by a genome. — bound_intervals","text":"","code":"bound_intervals(x, genome, trim = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select intervals bounded by a genome. — bound_intervals","text":"x ivl_df genome genome_df trim adjust coordinates --bounds intervals","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select intervals bounded by a genome. — bound_intervals","text":"ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/bound_intervals.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select intervals bounded by a genome. — bound_intervals","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", -100, 500, \"chr1\", 100, 1e9, \"chr1\", 500, 1000 ) genome <- read_genome(valr_example(\"hg19.chrom.sizes.gz\")) # out-of-bounds are removed by default ... bound_intervals(x, genome) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 500 1000 # ... or can be trimmed within the bounds of a genome bound_intervals(x, genome, trim = TRUE) #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 0 500 #> 2 chr1 100 249250621 #> 3 chr1 500 1000"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":null,"dir":"Reference","previous_headings":"","what":"Create intron features. — create_introns","title":"Create intron features. — create_introns","text":"Numbers score column intron numbers 5' 3' independent strand. .e., first introns + - strand genes score values 1.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create intron features. — create_introns","text":"","code":"create_introns(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create intron features. — create_introns","text":"x ivl_df BED12 format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_introns.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create intron features. — create_introns","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_introns(x) #> # A tibble: 1,583 × 6 #> chrom start end name score strand #> #> 1 chr1 3207049 3411782 NM_001011874 2 - #> 2 chr1 3411982 3660632 NM_001011874 1 - #> 3 chr1 4283093 4341990 NM_001195662 3 - #> 4 chr1 4342162 4342282 NM_001195662 2 - #> 5 chr1 4342918 4399250 NM_001195662 1 - #> 6 chr1 4848057 4857550 NM_001159750 1 + #> 7 chr1 4848057 4857550 NM_011541 1 + #> 8 chr1 4848584 4857550 NM_001159751 1 + #> 9 chr1 4857613 4868107 NM_001159750 2 + #> 10 chr1 4857613 4868107 NM_011541 2 + #> # ℹ 1,573 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":null,"dir":"Reference","previous_headings":"","what":"Create transcription start site features. — create_tss","title":"Create transcription start site features. — create_tss","text":"Create transcription start site features.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create transcription start site features. — create_tss","text":"","code":"create_tss(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create transcription start site features. — create_tss","text":"x ivl_df BED format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_tss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create transcription start site features. — create_tss","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_tss(x) #> # A tibble: 100 × 6 #> chrom start end name score strand #> #> 1 chr1 3661578 3661579 NM_001011874 0 - #> 2 chr1 4399321 4399322 NM_001195662 0 - #> 3 chr1 4847774 4847775 NM_001159750 0 + #> 4 chr1 4847774 4847775 NM_011541 0 + #> 5 chr1 4848408 4848409 NM_001159751 0 + #> 6 chr1 5008814 5008815 NM_001290372 0 - #> 7 chr1 5009619 5009620 NM_021374 0 - #> 8 chr1 5060365 5060366 NM_001177795 0 - #> 9 chr1 5073166 5073167 NM_001310442 0 + #> 10 chr1 5073166 5073167 NM_133826 0 + #> # ℹ 90 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":null,"dir":"Reference","previous_headings":"","what":"Create 3' UTR features. — create_utrs3","title":"Create 3' UTR features. — create_utrs3","text":"Create 3' UTR features.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create 3' UTR features. — create_utrs3","text":"","code":"create_utrs3(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create 3' UTR features. — create_utrs3","text":"x ivl_df BED12 format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs3.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create 3' UTR features. — create_utrs3","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_utrs3(x) #> # A tibble: 99 × 6 #> chrom start end name score strand #> #> 1 chr1 3204562 3206102 NM_001011874 0 - #> 2 chr1 4280926 4283061 NM_001195662 0 - #> 3 chr1 4886445 4887990 NM_001159750 0 + #> 4 chr1 4886445 4887990 NM_011541 0 + #> 5 chr1 4886445 4887990 NM_001159751 0 + #> 6 chr1 4899656 4900554 NM_001290372 0 - #> 7 chr1 4899656 4900554 NM_021374 0 - #> 8 chr1 4899656 4900554 NM_001177795 0 - #> 9 chr1 5152246 5152630 NM_001310442 0 + #> 10 chr1 5152246 5152630 NM_133826 0 + #> # ℹ 89 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":null,"dir":"Reference","previous_headings":"","what":"Create 5' UTR features. — create_utrs5","title":"Create 5' UTR features. — create_utrs5","text":"Create 5' UTR features.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create 5' UTR features. — create_utrs5","text":"","code":"create_utrs5(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create 5' UTR features. — create_utrs5","text":"x ivl_df BED12 format","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/create_utrs5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create 5' UTR features. — create_utrs5","text":"","code":"x <- read_bed12(valr_example(\"mm9.refGene.bed.gz\")) create_utrs5(x) #> # A tibble: 97 × 6 #> chrom start end name score strand #> #> 1 chr1 3661429 3661579 NM_001011874 0 - #> 2 chr1 4399268 4399322 NM_001195662 0 - #> 3 chr1 4847774 4847994 NM_001159750 0 + #> 4 chr1 4847774 4847994 NM_011541 0 + #> 5 chr1 4848408 4848488 NM_001159751 0 + #> 6 chr1 4914046 5008815 NM_001290372 0 - #> 7 chr1 5009460 5009620 NM_021374 0 - #> 8 chr1 5060258 5060366 NM_001177795 0 - #> 9 chr1 5073166 5074531 NM_001310442 0 + #> 10 chr1 5073166 5074531 NM_133826 0 + #> # ℹ 87 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch data from remote databases. — db","title":"Fetch data from remote databases. — db","text":"Currently db_ucsc db_ensembl available connections.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch data from remote databases. — db","text":"","code":"db_ucsc( dbname, host = \"genome-mysql.cse.ucsc.edu\", user = \"genomep\", password = \"password\", port = 3306, ... ) db_ensembl( dbname, host = \"ensembldb.ensembl.org\", user = \"anonymous\", password = \"\", port = 3306, ... )"},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch data from remote databases. — db","text":"dbname name database host hostname user username password password port MySQL connection port ... params connection","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/db.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch data from remote databases. — db","text":"","code":"if (FALSE) { # \\dontrun{ if (require(RMariaDB)) { library(dplyr) ucsc <- db_ucsc(\"hg38\") # fetch the `refGene` tbl tbl(ucsc, \"refGene\") # the `chromInfo` tbls have size information tbl(ucsc, \"chromInfo\") } } # } if (FALSE) { # \\dontrun{ if (require(RMariaDB)) { library(dplyr) # squirrel genome ensembl <- db_ensembl(\"spermophilus_tridecemlineatus_core_67_2\") tbl(ensembl, \"gene\") } } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":null,"dir":"Reference","previous_headings":"","what":"Flip strands in intervals. — flip_strands","title":"Flip strands in intervals. — flip_strands","text":"Flips positive (+) stranded intervals negative (-) strands, vice-versa. Facilitates comparisons among intervals opposing strands.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flip strands in intervals. — flip_strands","text":"","code":"flip_strands(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flip strands in intervals. — flip_strands","text":"x ivl_df","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/flip_strands.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Flip strands in intervals. — flip_strands","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, ~strand, \"chr1\", 1, 100, \"+\", \"chr2\", 1, 100, \"-\" ) flip_strands(x) #> # A tibble: 2 × 4 #> chrom start end strand #> #> 1 chr1 1 100 - #> 2 chr2 1 100 +"},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Granges to bed tibble — gr_to_bed","title":"Convert Granges to bed tibble — gr_to_bed","text":"Convert Granges bed tibble","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Granges to bed tibble — gr_to_bed","text":"","code":"gr_to_bed(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Granges to bed tibble — gr_to_bed","text":"x GRanges object convert bed tibble.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Granges to bed tibble — gr_to_bed","text":"tibble::tibble()","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/gr_to_bed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Granges to bed tibble — gr_to_bed","text":"","code":"if (FALSE) { # \\dontrun{ gr <- GenomicRanges::GRanges( seqnames = S4Vectors::Rle( c(\"chr1\", \"chr2\", \"chr1\", \"chr3\"), c(1, 1, 1, 1) ), ranges = IRanges::IRanges( start = c(1, 10, 50, 100), end = c(100, 500, 1000, 2000), names = head(letters, 4) ), strand = S4Vectors::Rle( c(\"-\", \"+\"), c(2, 2) ) ) gr_to_bed(gr) # There are two ways to convert a bed-like data.frame to GRanges: gr <- GenomicRanges::GRanges( seqnames = S4Vectors::Rle(x$chrom), ranges = IRanges::IRanges( start = x$start + 1, end = x$end, names = x$name ), strand = S4Vectors::Rle(x$strand) ) # or: gr <- GenomicRanges::makeGRangesFromDataFrame(dplyr::mutate(x, start = start + 1)) } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":null,"dir":"Reference","previous_headings":"","what":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":"Properties: order(id) equivalent .call(order, df) rows containing data value drop = FALSE room possibilites","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":"","code":"id(.variables, drop = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":".variables list variables drop drop unusued factor levels?","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plyr function id packaged due to plyr being retired Compute a unique numeric id for each unique row in a data frame. — id","text":"numeric vector attribute n, giving total number possibilities","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/id_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Plyr function id_var packaged due to plyr being retired Numeric id for a vector. — id_var","title":"Plyr function id_var packaged due to plyr being retired Numeric id for a vector. — id_var","text":"Plyr function id_var packaged due plyr retired Numeric id vector.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/id_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plyr function id_var packaged due to plyr being retired Numeric id for a vector. — id_var","text":"","code":"id_var(x, drop = FALSE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate interval spacing. — interval_spacing","title":"Calculate interval spacing. — interval_spacing","text":"Spacing first interval chromosome undefined (NA). leading interval overlapping interval pair negative value.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate interval spacing. — interval_spacing","text":"","code":"interval_spacing(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate interval spacing. — interval_spacing","text":"x ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate interval spacing. — interval_spacing","text":"ivl_df .spacing column.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/interval_spacing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate interval spacing. — interval_spacing","text":"","code":"x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 100, \"chr1\", 150, 200, \"chr2\", 200, 300 ) interval_spacing(x) #> # A tibble: 3 × 4 #> chrom start end .spacing #> #> 1 chr1 1 100 NA #> 2 chr1 150 200 50 #> 3 chr2 200 300 NA"},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Bed-like data.frame requirements for valr functions — ivl_df","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"Required column names interval dataframes chrom, start end. Internally interval dataframes validated using check_interval() Required column names genome dataframes chrom size. Internally genome dataframes validated using check_genome().","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"","code":"check_interval(x) check_genome(x)"},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"x data.frame tibble::tibble","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/ivl_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bed-like data.frame requirements for valr functions — ivl_df","text":"","code":"# using tibble x <- tibble::tribble( ~chrom, ~start, ~end, \"chr1\", 1, 50, \"chr1\", 10, 75, \"chr1\", 100, 120 ) check_interval(x) #> # A tibble: 3 × 3 #> chrom start end #> #> 1 chr1 1 50 #> 2 chr1 10 75 #> 3 chr1 100 120 # using base R data.frame x <- data.frame( chrom = \"chr1\", start = 0, end = 100, stringsAsFactors = FALSE ) check_interval(x) #> # A tibble: 1 × 3 #> chrom start end #> #> 1 chr1 0 100 # example genome input x <- tibble::tribble( ~chrom, ~size, \"chr1\", 1e6 ) check_genome(x) #> # A tibble: 1 × 2 #> chrom size #> #> 1 chr1 1000000"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":null,"dir":"Reference","previous_headings":"","what":"Read BED and related files. — read_bed","title":"Read BED and related files. — read_bed","text":"read functions BED related formats. Filenames can local file URLs. read functions load data tbls consistent chrom, start end colnames.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read BED and related files. — read_bed","text":"","code":"read_bed( filename, col_types = bed12_coltypes, sort = TRUE, ..., n_fields = NULL ) read_bed12(filename, ...) read_bedgraph(filename, ...) read_narrowpeak(filename, ...) read_broadpeak(filename, ...)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read BED and related files. — read_bed","text":"filename file URL col_types column type spec readr::read_tsv() sort sort tbl chrom start ... options pass readr::read_tsv() n_fields","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read BED and related files. — read_bed","text":"ivl_df","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read BED and related files. — read_bed","text":"https://genome.ucsc.edu/FAQ/FAQformat.html#format1 https://genome.ucsc.edu/FAQ/FAQformat.html#format1 https://genome.ucsc.edu/goldenPath/help/bedgraph.html https://genome.ucsc.edu/FAQ/FAQformat.html#format12 https://genome.ucsc.edu/FAQ/FAQformat.html#format13","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read BED and related files. — read_bed","text":"","code":"# read_bed assumes 3 field BED format. read_bed(valr_example(\"3fields.bed.gz\")) #> # A tibble: 10 × 3 #> chrom start end #> #> 1 chr1 11873 14409 #> 2 chr1 14361 19759 #> 3 chr1 14406 29370 #> 4 chr1 34610 36081 #> 5 chr1 69090 70008 #> 6 chr1 134772 140566 #> 7 chr1 321083 321115 #> 8 chr1 321145 321207 #> 9 chr1 322036 326938 #> 10 chr1 327545 328439 # result is sorted by chrom and start unless `sort = FALSE` read_bed(valr_example(\"3fields.bed.gz\"), sort = FALSE) #> # A tibble: 10 × 3 #> chrom start end #> #> 1 chr1 11873 14409 #> 2 chr1 14361 19759 #> 3 chr1 14406 29370 #> 4 chr1 34610 36081 #> 5 chr1 69090 70008 #> 6 chr1 134772 140566 #> 7 chr1 321083 321115 #> 8 chr1 321145 321207 #> 9 chr1 322036 326938 #> 10 chr1 327545 328439 read_bed12(valr_example(\"mm9.refGene.bed.gz\")) #> # A tibble: 100 × 12 #> chrom start end name score strand cds_start cds_end item_rgb exon_count #> #> 1 chr1 3204562 3.66e6 NM_0… 0 - 3206102 3661429 0 3 #> 2 chr1 4280926 4.40e6 NM_0… 0 - 4283061 4399268 0 4 #> 3 chr1 4847774 4.89e6 NM_0… 0 + 4847994 4886445 0 10 #> 4 chr1 4847774 4.89e6 NM_0… 0 + 4847994 4886445 0 10 #> 5 chr1 4848408 4.89e6 NM_0… 0 + 4848488 4886445 0 10 #> 6 chr1 4899656 5.01e6 NM_0… 0 - 4900554 4914046 0 5 #> 7 chr1 4899656 5.01e6 NM_0… 0 - 4900554 5009460 0 5 #> 8 chr1 4899656 5.06e6 NM_0… 0 - 4900554 5060258 0 6 #> 9 chr1 5073166 5.15e6 NM_0… 0 + 5074531 5152246 0 13 #> 10 chr1 5073166 5.15e6 NM_1… 0 + 5074531 5152246 0 14 #> # ℹ 90 more rows #> # ℹ 2 more variables: exon_sizes , exon_starts read_bedgraph(valr_example(\"test.bg.gz\")) #> # A tibble: 4 × 4 #> chrom start end value #> #> 1 chr19 49302000 49302300 -1 #> 2 chr19 49302300 49302600 -0.75 #> 3 chr19 49302600 49302900 -0.5 #> 4 chr19 49302900 49303200 -0.25 read_narrowpeak(valr_example(\"sample.narrowPeak.gz\")) #> # A tibble: 570 × 10 #> chrom start end name score strand signal pvalue qvalue peak #> #> 1 chr22 17372940 17373090 . 0 . 4 4.63 -1 -1 #> 2 chr22 17392200 17392350 . 0 . 5 4.67 -1 -1 #> 3 chr22 17398400 17398550 . 0 . 10 11.6 -1 -1 #> 4 chr22 17539180 17539330 . 0 . 21 30.9 -1 -1 #> 5 chr22 17652440 17652590 . 0 . 6 5.35 -1 -1 #> 6 chr22 17652780 17652930 . 0 . 12 12.5 -1 -1 #> 7 chr22 17980800 17980950 . 0 . 12 12.6 -1 -1 #> 8 chr22 18038260 18038410 . 0 . 29 36.0 -1 -1 #> 9 chr22 18225280 18225430 . 0 . 21 25.0 -1 -1 #> 10 chr22 18268020 18268170 . 0 . 14 13.0 -1 -1 #> # ℹ 560 more rows read_broadpeak(valr_example(\"sample.broadPeak.gz\")) #> # A tibble: 1,181 × 9 #> chrom start end name score strand signal pvalue qvalue #> #> 1 chr22 16847903 16848440 . 503 . 10.5 2.5 -1 #> 2 chr22 16849452 16851326 . 483 . 9.81 15.7 -1 #> 3 chr22 16849955 16850086 . 1000 . 32.4 4.2 -1 #> 4 chr22 16850694 16850924 . 831 . 22.5 4.9 -1 #> 5 chr22 16852964 16853782 . 499 . 10.4 6.2 -1 #> 6 chr22 16855065 16855803 . 477 . 9.58 3.9 -1 #> 7 chr22 16855944 16856974 . 491 . 10.1 8.5 -1 #> 8 chr22 16857425 16857958 . 505 . 10.6 2.5 -1 #> 9 chr22 16858284 16858824 . 549 . 12.2 4.5 -1 #> 10 chr22 16859972 16862024 . 404 . 6.89 9.3 -1 #> # ℹ 1,171 more rows"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":null,"dir":"Reference","previous_headings":"","what":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"function output 5 column tibble zero-based chrom, start, end, score, strand columns.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"","code":"read_bigwig(path, set_strand = \"+\")"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"path path bigWig file set_strand strand add output (defaults \"+\")","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"functions uses rtracklayer import bigwigs unstable support windows platform therefore may error windows users (particularly 32 bit window users).","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_bigwig.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import and convert a bigwig file into a valr compatible tbl — read_bigwig","text":"","code":"if (FALSE) { # \\dontrun{ bw <- read_bigwig(valr_example(\"hg19.dnase1.bw\")) head(bw) } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":null,"dir":"Reference","previous_headings":"","what":"Read genome files. — read_genome","title":"Read genome files. — read_genome","text":"Genome files (UCSC \"chromSize\" files) contain chromosome name size information. sizes used downstream functions identify computed intervals coordinates outside genome bounds.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read genome files. — read_genome","text":"","code":"read_genome(path)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read genome files. — read_genome","text":"path containing chrom/contig names sizes, one-pair-per-line, tab-delimited","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read genome files. — read_genome","text":"genome_df, sorted size","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Read genome files. — read_genome","text":"URLs genome files can also used.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/read_genome.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read genome files. — read_genome","text":"","code":"read_genome(valr_example(\"hg19.chrom.sizes.gz\")) #> # A tibble: 25 × 2 #> chrom size #> #> 1 chr1 249250621 #> 2 chr2 243199373 #> 3 chr3 198022430 #> 4 chr4 191154276 #> 5 chr5 180915260 #> 6 chr6 171115067 #> 7 chr7 159138663 #> 8 chrX 155270560 #> 9 chr8 146364022 #> 10 chr9 141213431 #> # ℹ 15 more rows if (FALSE) { # \\dontrun{ # `read_genome` accepts a URL read_genome(\"https://genome.ucsc.edu/goldenpath/help/hg19.chrom.sizes\") } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":null,"dir":"Reference","previous_headings":"","what":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"function output tibble required chrom, start, end columns, well columns depending content GTF/GFF file.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"","code":"read_gtf(path, zero_based = TRUE)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"path path gtf gff file zero_based TRUE, convert zero based","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_gtf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import and convert a GTF/GFF file into a valr compatible bed tbl format — read_gtf","text":"","code":"if (FALSE) { # \\dontrun{ gtf <- read_gtf(valr_example(\"hg19.gencode.gtf.gz\")) head(gtf) } # }"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a VCF file. — read_vcf","title":"Read a VCF file. — read_vcf","text":"Read VCF file.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a VCF file. — read_vcf","text":"","code":"read_vcf(vcf)"},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a VCF file. — read_vcf","text":"vcf vcf filename","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a VCF file. — read_vcf","text":"data_frame","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Read a VCF file. — read_vcf","text":"return value chrom, start end columns. Interval lengths size 'REF' field.","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/read_vcf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a VCF file. — read_vcf","text":"","code":"vcf_file <- valr_example(\"test.vcf.gz\") read_vcf(vcf_file) #> # A tibble: 11 × 18 #> CHROM POS ID REF ALT QUAL FILTER INFO FORMAT X1 X2 X3 #> #> 1 1 10 1:10 A T 100 PASS NS=5;A… GT 0/0 ./. 0/0 #> 2 1 20 1:20 G C 100 PASS NS=0;A… GT ./. ./. ./. #> 3 1 30 1:30 C A 100 PASS NS=6;A… GT 0/0 0/0 0/0 #> 4 1 40 1:40 A C 100 PASS NS=6;A… GT 0/0 0/0 0/0 #> 5 1 10000 1:10000 G C 100 PASS NS=6;A… GT 0/0 0/0 0/0 #> 6 1 20000 1:20000 T A 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 7 4 5000 4:5000 A T 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 8 4 6000 4:6000 C T 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 9 X 800 X:800 A C 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 10 X 900 X:900 A T 100 PASS NS=6;A… GT 1/1 1/1 1/1 #> 11 X 1000 X:1000 T G 100 PASS NS=5;A… GT 1/1 1/1 1/1 #> # ℹ 6 more variables: X4 , X5 , X6 , chrom , start , #> # end "},{"path":"https://rnabioco.github.io/valr/dev/reference/valr.html","id":null,"dir":"Reference","previous_headings":"","what":"valr: genome interval arithmetic in R — valr","title":"valr: genome interval arithmetic in R — valr","text":"valr provides tools read manipulate intervals signals genome reference. valr developed facilitate interactive analysis genome-scale data sets, leveraging power dplyr piping.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"valr: genome interval arithmetic in R — valr","text":"learn valr, start vignette: browseVignettes(package = \"valr\")","code":""},{"path":[]},{"path":"https://rnabioco.github.io/valr/dev/reference/valr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"valr: genome interval arithmetic in R — valr","text":"Jay Hesselberth jay.hesselberth@gmail.com Kent Riemondy kent.riemondy@gmail.com","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide working directory for valr example files. — valr_example","title":"Provide working directory for valr example files. — valr_example","text":"Provide working directory valr example files.","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide working directory for valr example files. — valr_example","text":"","code":"valr_example(path)"},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide working directory for valr example files. — valr_example","text":"path path file","code":""},{"path":"https://rnabioco.github.io/valr/dev/reference/valr_example.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Provide working directory for valr example files. — valr_example","text":"","code":"valr_example(\"hg19.chrom.sizes.gz\") #> [1] \"/home/runner/work/_temp/Library/valr/extdata/hg19.chrom.sizes.gz\""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-development-version","dir":"Changelog","previous_headings":"","what":"valr (development version)","title":"valr (development version)","text":"read_bigwig() read_gtf() deprecated rtracklayer longer avilable CRAN. valr now depends R >= 4.0.0.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-082","dir":"Changelog","previous_headings":"","what":"valr 0.8.2","title":"valr 0.8.2","text":"CRAN release: 2024-08-30 Address NOTE CRAN Rd link targets. Change maintainer email address.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-081","dir":"Changelog","previous_headings":"","what":"valr 0.8.1","title":"valr 0.8.1","text":"CRAN release: 2024-04-22 Make vdiffr dependency optional package testing.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-080","dir":"Changelog","previous_headings":"","what":"valr 0.8.0","title":"valr 0.8.0","text":"CRAN release: 2024-04-04 Added bed_genomecov() compute interval coverage across genome.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-070","dir":"Changelog","previous_headings":"","what":"valr 0.7.0","title":"valr 0.7.0","text":"CRAN release: 2023-09-18 read_bed related functions now automatically calculate fields. Use n_fields deprecated.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-068","dir":"Changelog","previous_headings":"","what":"valr 0.6.8","title":"valr 0.6.8","text":"CRAN release: 2023-05-16 bed_closest() now reports x intervals, even closest y intervals (e.g. matching chromosome y intervals). intervals returned populated NA .overlap, .dist y interval locations. Reimplemented bed_closest() use binary search rather interval tree search. closest y interval can missed previous search strategy high depth interval trees. Fix one error using max_dist argument bed_cluster() (#401).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-067","dir":"Changelog","previous_headings":"","what":"valr 0.6.7","title":"valr 0.6.7","text":"CRAN release: 2023-02-18 Removed SystemRequirements DESCRIPTION eliminate NOTE CRAN. bed_coverage() now reports intervals x matching group y (#395).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-066","dir":"Changelog","previous_headings":"","what":"valr 0.6.6","title":"valr 0.6.6","text":"CRAN release: 2022-10-11 Updated intervalTree header commit f0c4046 valr now uses cli consistent errors messages interactive use. deprecated genome argument bed_makewindows() removed.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-065","dir":"Changelog","previous_headings":"","what":"valr 0.6.5","title":"valr 0.6.5","text":"CRAN release: 2022-08-19 Handle max_dist first intervals bed_cluster() (#388)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-064","dir":"Changelog","previous_headings":"","what":"valr 0.6.4","title":"valr 0.6.4","text":"CRAN release: 2021-12-08 Fixed intron score numbering error create_introns (#377 @sheridar) Fixed bug handling list inputs bed_intersect()(#380 @sheridar) Added read_bigwig read_gtf functions import data valr compatible tibbles (#379) Kent Riemondy now maintainer.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-063","dir":"Changelog","previous_headings":"","what":"valr 0.6.3","title":"valr 0.6.3","text":"CRAN release: 2021-05-15 Update prepare readr 2.0.0","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-062","dir":"Changelog","previous_headings":"","what":"valr 0.6.2","title":"valr 0.6.2","text":"CRAN release: 2020-10-07","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-6-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.6.2","text":"RMariaDB replaced deprecated RMySQL package database backend. valr now imports Rcpp, always case, masked Import readr, recently dropped use Rcpp.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-061","dir":"Changelog","previous_headings":"","what":"valr 0.6.1","title":"valr 0.6.1","text":"CRAN release: 2020-05-08","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-6-1","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"valr 0.6.1","text":"Fixed rchk unprotect error (#365)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-060","dir":"Changelog","previous_headings":"","what":"valr 0.6.0","title":"valr 0.6.0","text":"CRAN release: 2020-05-04","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.6.0","text":"trbl_interval() trbl_genome() custom tibble subclasses deemed unnecessary removed package. coercing GRanges valr compatible data.frame now uses gr_to_bed() function rather .trbl_interal() methods.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.6.0","text":"dplyr version < 0.8.0 longer supported due unnecessary code bloat challenges handling multiple grouping structures (#359). sort_by argument bed_random() changed sorted, now default use bed_sort() sort output, rather rely naming sorting columns. Sorting can suppressed using sorted = FALSE. bed_sort() now uses base R sorting radix method increased speed. (#353) tbls processed bed_merge()bed_sort() longer store either merged sorted attributes, due attributes rarely checked codebase potential sources unexpected behavior.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-6-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.6.0","text":"Fixed bed_closest() prevent erroneous intervals reported adjacent closest intervals present y table. (#348) Factor columns used grouping returned factors rather inappropriately coerced integer vectors (#360)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-050","dir":"Changelog","previous_headings":"","what":"valr 0.5.0","title":"valr 0.5.0","text":"CRAN release: 2019-01-03","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.5.0","text":"Internal Rcpp functions reorganized remove dependencies dplyr C++ functions.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.5.0","text":"Due internal refactoring Rcpp functions, data.frames containing Numeric, Logical, Integer, Character, List column types supported. Columns containing Raw, Complex, R classes supported issue error. Factors now disallowed grouping variables multiset operations avoid sort order discrepancies, compatibility factor handling dplyr v.0.8.0. Factors now internally type-converted character warning issued.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-042","dir":"Changelog","previous_headings":"","what":"valr 0.4.2","title":"valr 0.4.2","text":"CRAN release: 2018-11-17","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-4-2","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.4.2","text":"Changed behavior .tbl_interval() call as_tibble() non-tibble input, prevents groups stripped tibble() input (#338).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-041","dir":"Changelog","previous_headings":"","what":"valr 0.4.1","title":"valr 0.4.1","text":"CRAN release: 2018-06-08 Added new function, bed_partition(), similar bed_merge() collapses intervals elemental intervals rather maximal overlapping region. bed_partition() also can compute summaries data overlapping intervals. See examples bed_partition() timings vignette('benchmarks') @kriemo. Several explicit comparisons Bioconductor GenomicRanges library included users considering using valr. See examples .tbl_interval() timings vignette('benchmarks').","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-040","dir":"Changelog","previous_headings":"","what":"valr 0.4.0","title":"valr 0.4.0","text":"CRAN release: 2018-01-25","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.4.0","text":"relevant tests bedtool2 ported valr. Bugs identified corner cases new tests fixed (#328 @raysinesis) bed_jaccard() now works grouped inputs (#216) Update dplyr header files v0.7 bed_intersect() internal intersect_impl refactored enable return non-intersecting intervals. genome argument bed_makewindows() deprecated produce warning used. Also error handling added check warn intervals smaller requested window size makewindows_impl() (#312 @kriemo)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-4-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.4.0","text":"Fixed one error reported distances bed_closest(). Distances reported now bedtools closest behavior (#311). bed_glyph() accepts trbl_intervals named x y (#318). bed_makewindows() now returns number windows specified num_win input intervals evenly divisble num_win, consistent bedtools behavior. output findOverlaps() now sorted subtract_impl() prevent reporting intervals dropped calling bed_subtract() (#316 @kriemo)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-031","dir":"Changelog","previous_headings":"","what":"valr 0.3.1","title":"valr 0.3.1","text":"CRAN release: 2017-07-22","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"enhancements-0-3-1","dir":"Changelog","previous_headings":"","what":"Enhancements","title":"valr 0.3.1","text":"manuscript describing valr published F1000Research. New S3 generic .tbl_interval() converts GenomicRanges::GRanges objects tbl_interval. New create_tss() creating transcription start sites. Improve documentation interval statistics complex examples.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-3-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.3.1","text":"bed_sort() de-deprecated reduce arrange calls library code.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-3-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.3.1","text":"bed_merge() now reports start/end columns spec provided (#288)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-030","dir":"Changelog","previous_headings":"","what":"valr 0.3.0","title":"valr 0.3.0","text":"CRAN release: 2017-06-15","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"enhancements-0-3-0","dir":"Changelog","previous_headings":"","what":"Enhancements","title":"valr 0.3.0","text":"New create_introns(), create_utrs5() create_utrs3() functions generating features BED12 files. Speed-ups bed_makewindows() (~50x), bed_merge() (~4x), bed_flank() (~4x) (thanks @kriemo @sheridar). Thanks sponsors Biofrontiers Hackathon caffeine underlying improvements.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-3-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.3.0","text":"intervals bed_random() now sorted properly.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-020","dir":"Changelog","previous_headings":"","what":"valr 0.2.0","title":"valr 0.2.0","text":"CRAN release: 2017-05-05","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.2.0","text":"Package dplyr v0.5.0 headers valr remove dplyr LinkingTo dependency. bed_intersect() now accepts multiple tbls intersection (#220 @kriemo). new tbl_interval() tbl_genome() wrap tibbles enforce strict column naming. trbl_interval() trbl_genome() constructors take tibble::tribble() formatting .tbl_interval() .tbl_genome() used check valid classes.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.2.0","text":"intervals returned bed_random() sorted chrom start default.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-2-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.2.0","text":"Merge intervals bed_jaccard() use numeric values calculation (fixes #204).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-012","dir":"Changelog","previous_headings":"","what":"valr 0.1.2","title":"valr 0.1.2","text":"CRAN release: 2017-03-16","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.1.2","text":"Deprecate bed_sort() favor using dplyr::arrange() explicitly (fixes #134).","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.1.2","text":"add src/init.c calls R_registerRoutines R_useDynamicSymbols address NOTE r-devel Deprecate dist parameter bed_closest() favor using user supplied functions (#182 @kriemo) Make .id values sequential across chroms bed_cluster() output (#171) Transfer repository http://github.com/rnabioco/valr, update links docs. Move shiny app new repo (http://github.com/rnabioco/valrdata). Add Kent Riemondy LICENSE file.","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"bug-fixes-0-1-2","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"valr 0.1.2","text":"bed_merge() now merges contained intervals (#177)","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-011","dir":"Changelog","previous_headings":"","what":"valr 0.1.1","title":"valr 0.1.1","text":"CRAN release: 2016-12-01","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"minor-changes-0-1-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"valr 0.1.1","text":"test / vignette guards Suggested RMySQL fixed memory leak absdist.cpp fixed vignette entry names","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"valr-010","dir":"Changelog","previous_headings":"","what":"valr 0.1.0","title":"valr 0.1.0","text":"CRAN release: 2016-11-21","code":""},{"path":"https://rnabioco.github.io/valr/dev/news/index.html","id":"major-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"valr 0.1.0","text":"initial release CRAN","code":""}]