Skip to content

Commit 676a244

Browse files
covert docs to markdown. (#231)
1 parent a585cdd commit 676a244

File tree

109 files changed

+561
-566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+561
-566
lines changed

DESCRIPTION

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ VignetteBuilder: knitr
3939
RoxygenNote: 6.0.1
4040
URL: http://github.com/rnabioco/valr/
4141
BugReports: https://github.com/rnabioco/valr/issues
42+
Roxygen: list(markdown = TRUE)

R/bed12_to_exons.r

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#' Convert BED12 to individual exons in BED6.
22
#'
3-
#' After conversion to BED6 format, the \code{score} column contains the exon
4-
#' number, with respect to strand (i.e., the first exon for \code{-} strand
3+
#' After conversion to BED6 format, the `score` column contains the exon
4+
#' number, with respect to strand (i.e., the first exon for `-` strand
55
#' genes will have larger start and end coordinates).
66
#'
7-
#' @param x \code{\link{tbl_interval}}
7+
#' @param x [tbl_interval()]
88
#' @family utilities
99
#'
1010
#' @examples

R/bed_absdist.r

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
#' Compute absolute distances between intervals.
22
#'
3-
#' Computes the absolute distance between the midpoints of \code{x} intervals and
4-
#' the closest midpoints of \code{y} intervals.
3+
#' Computes the absolute distance between the midpoints of `x` intervals and
4+
#' the closest midpoints of `y` intervals.
55
#'
66
#' @details Absolute distances are scaled by the inter-reference gap for the
7-
#' chromosome as follows. For \code{Q} query points and \code{R} reference
8-
#' points on a chromosome, scale the distance for each query point \code{i} to
7+
#' chromosome as follows. For `Q` query points and `R` reference
8+
#' points on a chromosome, scale the distance for each query point `i` to
99
#' the closest reference point by the inter-reference gap for each chromosome.
10-
#' If an \code{x} interval has no matching \code{y} chromosome,
11-
#' \code{.absdist} is \code{NA}.
10+
#' If an `x` interval has no matching `y` chromosome,
11+
#' `.absdist` is `NA`.
1212
#'
1313
#' \deqn{d_i(x,y) = min_k(|q_i - r_k|)\frac{R}{Length\ of\ chromosome}}
1414
#'
15-
#' Both absolute and scaled distances are reported as \code{.absdist} and
16-
#' \code{.absdist_scaled}.
15+
#' Both absolute and scaled distances are reported as `.absdist` and
16+
#' `.absdist_scaled`.
1717
#'
18-
#' @param x \code{\link{tbl_interval}}
19-
#' @param y \code{\link{tbl_interval}}
20-
#' @param genome \code{\link{tbl_genome}}
18+
#' @param x [tbl_interval()]
19+
#' @param y [tbl_interval()]
20+
#' @param genome [tbl_genome()]
2121
#'
22-
#' @return \code{\link{tbl_interval}} with \code{.absdist} and \code{.absdist_scaled}
22+
#' @return [tbl_interval()] with `.absdist` and `.absdist_scaled`
2323
#' columns.
2424
#'
2525
#' @template stats

R/bed_closest.r

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
#' Identify closest intervals.
22
#'
3-
#' @param x \code{\link{tbl_interval}}
4-
#' @param y \code{\link{tbl_interval}}
3+
#' @param x [tbl_interval()]
4+
#' @param y [tbl_interval()]
55
#' @param overlap report overlapping intervals
66
#' @param suffix colname suffixes in output
77
#'
88
#' @template groups
99
#'
10-
#' @return \code{\link{tbl_interval}} with additional columns:
11-
#' \itemize{
12-
#' \item{\code{.dist}}{ distance to closest interval, negative distances denote upstream intervals}
13-
#' \item{\code{.overlap}}{ overlap with closest interval}
14-
#' }
10+
#' @return [tbl_interval()] with additional columns:
11+
#' - `.dist` distance to closest interval, negative distances denote upstream intervals
12+
#' - `.overlap` overlap with closest interval
1513
#'
1614
#' @family multiple set operations
1715
#' @seealso \url{http://bedtools.readthedocs.io/en/latest/content/tools/closest.html}
@@ -50,14 +48,14 @@
5048
#'
5149
#' # Report distance based on strand
5250
#' x <- trbl_interval(
53-
#' ~chrom, ~start, ~end, ~name, ~score, ~strand,
54-
#' "chr1", 10, 20, "a", 1, "-"
51+
#' ~chrom, ~start, ~end, ~name, ~score, ~strand,
52+
#' "chr1", 10, 20, "a", 1, "-"
5553
#' )
5654
#'
5755
#' y <- trbl_interval(
58-
#' ~chrom, ~start, ~end, ~name, ~score, ~strand,
59-
#' "chr1", 8, 9, "b", 1, "+",
60-
#' "chr1", 21, 22, "b", 1, "-"
56+
#' ~chrom, ~start, ~end, ~name, ~score, ~strand,
57+
#' "chr1", 8, 9, "b", 1, "+",
58+
#' "chr1", 21, 22, "b", 1, "-"
6159
#' )
6260
#'
6361
#' res <- bed_closest(x, y)

R/bed_cluster.r

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#' Cluster neighboring intervals.
22
#'
3-
#' Output contains an \code{.id} column that can be used in downstream grouping
4-
#' operations. Default \code{max_dist = 0} means that both overlapping and
3+
#' Output contains an `.id` column that can be used in downstream grouping
4+
#' operations. Default `max_dist = 0` means that both overlapping and
55
#' book-ended intervals will be clustered.
66
#'
7-
#' @param x \code{\link{tbl_interval}}
7+
#' @param x [tbl_interval()]
88
#' @param max_dist maximum distance between clustered intervals.
99
#'
1010
#' @template groups
1111
#'
12-
#' @return \code{\link{tbl_interval}} with \code{.id} column for clustered intervals.
12+
#' @return [tbl_interval()] with `.id` column for clustered intervals.
1313
#'
1414
#' @family single set operations
1515
#' @seealso

R/bed_complement.r

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#' Identify intervals in a genome not covered by a query.
22
#'
3-
#' @param x \code{\link{tbl_interval}}
4-
#' @param genome \code{\link{tbl_genome}}
3+
#' @param x [tbl_interval()]
4+
#' @param genome [tbl_genome()]
55
#'
66
#' @family single set operations
77
#'
8-
#' @return \code{\link{tbl_interval}}
8+
#' @return [tbl_interval()]
99
#'
1010
#' @examples
1111
#' x <- trbl_interval(

R/bed_coverage.R

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Compute coverage of intervals.
22
#'
3-
#' @param x \code{\link{tbl_interval}}
4-
#' @param y \code{\link{tbl_interval}}
3+
#' @param x [tbl_interval()]
4+
#' @param y [tbl_interval()]
55
#' @param ... extra arguments (not used)
66
#'
77
#' @note Book-ended intervals are counted as overlapping.
@@ -10,14 +10,12 @@
1010
#'
1111
#' @family multiple set operations
1212
#'
13-
#' @return \code{x} \code{\link{tbl_interval}} with the following additional
13+
#' @return `x` [tbl_interval()] with the following additional
1414
#' columns:
15-
#' \itemize{
16-
#' \item{\code{.ints}}{ number of x intersections}
17-
#' \item{\code{.cov}}{ per-base coverage of x intervals}
18-
#' \item{\code{.len}}{ total length of y intervals covered by x intervals}
19-
#' \item{\code{.frac}}{ .len scaled by total of y intervals}
20-
#' }
15+
#' - `.ints` number of x intersections
16+
#' - `.cov` per-base coverage of x intervals
17+
#' - `.len` total length of y intervals covered by x intervals
18+
#' - `.frac` `.len` scaled by total of y intervals
2119
#
2220
#' @examples
2321
#' x <- trbl_interval(

R/bed_fisher.r

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#' Fisher's test on number of shared and unique intervals.
22
#'
3-
#' Borrows from the \code{BEDtools} implementation.
3+
#' Borrows from the `BEDtools` implementation.
44
#'
5-
#' @param x \code{\link{tbl_interval}}
6-
#' @param y \code{\link{tbl_interval}}
7-
#' @param genome \code{\link{tbl_genome}}
5+
#' @param x [tbl_interval()]
6+
#' @param y [tbl_interval()]
7+
#' @param genome [tbl_genome()]
88
#'
99
#' @template stats
1010
#'
1111
#' @family interval statistics
1212
#' @seealso
1313
#' \url{http://bedtools.readthedocs.org/en/latest/content/tools/fisher.html}
1414
#'
15-
#' @return \code{tbl_interval}
15+
#' @return `tbl_interval`
1616
#'
1717
#' @examples
1818
#' x <- trbl_interval(

R/bed_flank.r

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#' Create flanking intervals from input intervals.
22
#'
3-
#' @param x \code{\link{tbl_interval}}
4-
#' @param genome \code{\link{tbl_genome}}
3+
#' @param x [tbl_interval()]
4+
#' @param genome [tbl_genome()]
55
#' @param both number of bases on both sizes
66
#' @param left number of bases on left side
77
#' @param right number of bases on right side
88
#' @param fraction define flanks based on fraction of interval length
9-
#' @param strand define \code{left} and \code{right} based on strand
9+
#' @param strand define `left` and `right` based on strand
1010
#' @param trim adjust coordinates for out-of-bounds intervals
1111
#' @param ... extra arguments (not used)
1212
#'
13-
#' @return \code{\link{tbl_interval}}
13+
#' @return [tbl_interval()]
1414
#'
1515
#' @family single set operations
1616
#' @seealso

R/bed_glyph.r

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' @param label column name to use for label values. should be present in the
77
#' result of the call.
88
#'
9-
#' @return \code{\link[ggplot2]{ggplot}}
9+
#' @return [ggplot2::ggplot()]
1010
#'
1111
#' @examples
1212
#' x <- trbl_interval(

R/bed_intersect.r

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
#' Identify intersecting intervals.
22
#'
3-
#' Report intersecting intervals from \code{x} and \code{y} tbls. Book-ended
4-
#' intervals (or "touching" intervals) have \code{.overlap} values of \code{0})
3+
#' Report intersecting intervals from `x` and `y` tbls. Book-ended
4+
#' intervals (or "touching" intervals) have `.overlap` values of `0`)
55
#' in the output.
66
#'
7-
#' @param x \code{\link{tbl_interval}}
8-
#' @param ... single y \code{\link{tbl_interval}}, multiple y \code{\link{tbl_interval}s}
9-
#' or a list of y \code{tbl_intervals}
10-
#' @param invert report \code{x} intervals not in \code{y}
7+
#' @param x [tbl_interval()]
8+
#' @param ... single y [tbl_interval()], multiple y \code{\link{tbl_interval}s}
9+
#' or a list of y `tbl_intervals`
10+
#' @param invert report `x` intervals not in `y`
1111
#' @param suffix colname suffixes in output
1212
#'
13-
#' @return \code{\link{tbl_interval}} with original columns from \code{x} and \code{y},
14-
#' suffixed with \code{.x} and \code{.y}, and a new \code{.overlap} column
13+
#' @return [tbl_interval()] with original columns from `x` and `y`,
14+
#' suffixed with `.x` and `.y`, and a new `.overlap` column
1515
#' with the extent of overlap for the intersecting intervals.
1616
#'
17-
#' If multiple \code{y} tbls are supplied, then an additional column \code{.source} will
17+
#' If multiple `y` tbls are supplied, then an additional column `.source` will
1818
#' be reported that contains the variable names associated with each interval. All original
19-
#' columns from the y tbls will be suffixed with \code{.y} in the output.
20-
#' If named tbls are supplied to \code{...} (i.e \code{a = y, b = z} or
21-
#' \code{list(a = y, b = z)}), then the supplied names will be reported instead
19+
#' columns from the y tbls will be suffixed with `.y` in the output.
20+
#' If named tbls are supplied to `...` (i.e `a = y, b = z` or
21+
#' `list(a = y, b = z)`), then the supplied names will be reported instead
2222
#' of the variable names (see examples).
2323
#'
2424
#'

R/bed_jaccard.r

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
#' Calculate jaccard statistics on two sets of intervals.
22
#'
3-
#' @details \code{bed_jaccard()} quantifies the extent of overlap between to sets of
4-
#' intervals. The Jaccard statistic takes values of \code{[0,1]} and is measured as:
3+
#' @details `bed_jaccard()` quantifies the extent of overlap between to sets of
4+
#' intervals. The Jaccard statistic takes values of `[0,1]` and is measured as:
55
#'
66
#' \deqn{ J(x,y) = \frac{\mid x \bigcap y \mid}
77
#' {\mid x \bigcup y \mid} =
88
#' \frac{\mid x \bigcap y \mid}
99
#' {\mid x \mid + \mid y \mid - \mid x \bigcap y \mid} }
1010
#'
11-
#' @param x \code{\link{tbl_interval}}
12-
#' @param y \code{\link{tbl_interval}}
11+
#' @param x [tbl_interval()]
12+
#' @param y [tbl_interval()]
1313
#'
1414
#' @template stats
1515
#'
1616
#' @family interval statistics
17-
#' @return \code{\link{tbl_interval}} with the following columns:
18-
#' \itemize{
19-
#' \item{\code{len_i}}{ length of the intersection}
20-
#' \item{\code{len_u}}{ length of the union}
21-
#' \item{\code{jaccard}}{ jaccard statistic}
22-
#' \item{\code{n_int}}{ number of intersecting intervals between x and y}
23-
#' }
17+
#' @return [tbl_interval()] with the following columns:
18+
#' - `len_i` length of the intersection
19+
#' - `len_u` length of the union
20+
#' - `jaccard` jaccard statistic
21+
#' - `n_int` number of intersecting intervals between x and y
2422
#'
2523
#' @seealso
2624
#' \url{http://bedtools.readthedocs.org/en/latest/content/tools/jaccard.html}

R/bed_makewindows.r

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#' Divide intervals into new sub-intervals ("windows").
22
#'
3-
#' @param x \code{\link{tbl_interval}}
4-
#' @param genome \code{\link{tbl_genome}}
3+
#' @param x [tbl_interval()]
4+
#' @param genome [tbl_genome()]
55
#' @param win_size divide intervals into fixed-size windows
66
#' @param step_size size to step before next window
77
#' @param num_win divide intervals to fixed number of windows
88
#' @param reverse reverse window numbers
99
#'
10-
#' @note The \code{name} and \code{.win_id} columns can be used to create new
10+
#' @note The `name` and `.win_id` columns can be used to create new
1111
#' interval names (see 'namenum' example below) or in subsequent
12-
#' \code{group_by} operations (see vignette).
12+
#' `group_by` operations (see vignette).
1313
#'
1414
#' @family utilities
15-
#' @return \code{\link{tbl_interval}} with \code{.win_id} column that contains a numeric
15+
#' @return [tbl_interval()] with `.win_id` column that contains a numeric
1616
#' identifier for the window.
1717
#'
1818
#' @examples

R/bed_map.r

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#' Calculate summaries and statistics from overlapping intervals.
22
#'
3-
#' Used to apply functions like \code{\link{min}()}, \code{\link{count}()},
4-
#' \code{\link{concat}()} to intersecting intervals. Book-ended intervals are
3+
#' Used to apply functions like [min()], [count()],
4+
#' [concat()] to intersecting intervals. Book-ended intervals are
55
#' not reported by default, but can be included by setting \code{min_overlap =
66
#' 0}.
77
#'
8-
#' @param x \code{\link{tbl_interval}}
9-
#' @param y \code{\link{tbl_interval}}
10-
#' @param invert report \code{x} intervals not in \code{y}
8+
#' @param x [tbl_interval()]
9+
#' @param y [tbl_interval()]
10+
#' @param invert report `x` intervals not in `y`
1111
#' @param suffix colname suffixes in output
1212
#' @param min_overlap minimum overlap for intervals.
1313
#' @param ... name-value pairs specifying colnames and expressions to apply
1414
#'
1515
#' @template groups
1616
#'
17-
#' @return \code{\link{tbl_interval}}
17+
#' @return [tbl_interval()]
1818
#'
1919
#' @family multiple set operations
2020
#' @seealso

R/bed_merge.r

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#' Merge overlapping intervals.
22
#'
33
#' Operations can be performed on merged intervals by specifying name-value
4-
#' pairs. Default \code{max_dist} of \code{0} means book-ended intervals are
4+
#' pairs. Default `max_dist` of `0` means book-ended intervals are
55
#' merged.
66
#'
7-
#' @param x \code{\link{tbl_interval}}
7+
#' @param x [tbl_interval()]
88
#' @param max_dist maximum distance between intervals to merge
99
#' @param ... name-value pairs that specify operations on merged intervals
1010
#'
1111
#' @template groups
1212
#'
13-
#' @return \code{\link{tbl_interval}}
13+
#' @return [tbl_interval()]
1414
#' @family single set operations
1515
#' @seealso
1616
#' \url{http://bedtools.readthedocs.org/en/latest/content/tools/merge.html}

0 commit comments

Comments
 (0)