diff --git a/.github/workflows/check-bioc-devel.yml b/.github/workflows/check-bioc-devel.yml index 7922ae6fb..94ef180b3 100644 --- a/.github/workflows/check-bioc-devel.yml +++ b/.github/workflows/check-bioc-devel.yml @@ -265,7 +265,8 @@ jobs: dir('check', 'tar.gz$', full.names = TRUE), `quit-with-status` = TRUE, `no-check-R-ver` = TRUE, - `no-check-bioc-help` = TRUE + `no-check-bioc-help` = TRUE, + `no-check-version-num` = TRUE ) shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 1b47699f2..68017d517 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,17 +2,28 @@ Package: plotgardener Title: Coordinate-Based Genomic Visualization Package for R Version: 1.15.1 Date: 2024-06-28 -Author: Nicole Kramer [aut, cre], Eric S. Davis [aut], Craig Wenger [aut], - Sarah Parker [ctb], JP Flores [ctb], Erika Deoudes [art], Michael Love [ctb], - Douglas H. Phanstiel [aut, cre, cph] -Maintainer: Nicole Kramer , - Douglas Phanstiel +Authors@R: c( + person("Nicole", "Kramer", email = "nekramer27@gmail.com", + role = c("aut", "cre"), + comment = c(ORCID = "0000-0001-9617-9671")), + person("Eric S.", "Davis", email = "esdavis@live.unc.edu", + role = "aut", + comment = c(ORCID = "0000-0003-4051-3217")), + person("Craig", "Wenger", email = "craig.wenger@gmail.com", + role = "aut", + comment = c(ORCID = "0000-0002-7361-8456")), + person("Sarah", "Parker", email = "sarmae@live.unc.edu", role = "ctb"), + person("JP", "Flores", email = "jflores@unc.edu", role = "ctb"), + person("Erika", "Deoudes", email = "ed@erikadudes.com", role = "art"), + person("Michael", "Love", email = "milove@email.unc.edu", role = "ctb"), + person("Douglas H.", "Phanstiel", email = "douglas_phanstiel@med.unc.edu", + role = c("aut", "cph"))) Description: Coordinate-based genomic visualization package for R. It grants users the ability to programmatically produce complex, multi-paneled figures. Tailored for genomics, plotgardener allows users to visualize large complex genomic datasets and provides exquisite control over how plots are placed and arranged on a page. -Depends: R (>= 4.1.0) +Depends: R (>= 4.2.0) License: MIT + file LICENSE URL: https://phanstiellab.github.io/plotgardener, https://github.com/PhanstielLab/plotgardener Encoding: UTF-8 diff --git a/R/annoDomains.R b/R/annoDomains.R index fcba1d152..a64b1e98f 100644 --- a/R/annoDomains.R +++ b/R/annoDomains.R @@ -17,7 +17,7 @@ #' @param half Character value specifying which half of hic plots #' to annotate. Triangle Hi-C plots will always default to the entirety of #' the triangular plot. Default value is \code{half = "inherit"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"inherit"}: }{Domains will be annotated on the \code{half} #' inherited by the input Hi-C plot.} #' \item{\code{"both"}: }{Domains will be annotated on both halves of the diff --git a/R/annoGenomeLabel.R b/R/annoGenomeLabel.R index 0abcacb8b..3c6cf5b81 100644 --- a/R/annoGenomeLabel.R +++ b/R/annoGenomeLabel.R @@ -33,7 +33,7 @@ #' and coordinate labels. Default value is \code{margin = unit(1, "mm")}. #' @param scale A character value indicating the scale of the coordinates #' along the genome label. Default value is \code{scale = "bp"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"bp"}: }{base pairs.} #' \item{\code{"Kb"}: }{kilobase pairs. 1 kilobase pair is equal to #' 1000 base pairs.} @@ -51,7 +51,7 @@ #' add genome label. Sequence information will not be displayed along a y-axis. #' Default value is \code{axis = "x"}. #' Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"x"}: }{Genome label will be plotted along the x-axis.} #' \item{\code{"y"}: }{Genome label will be plotted along the y-axis. #' This is typically used for a square Hi-C plot made with diff --git a/R/annoHeatmapLegend.R b/R/annoHeatmapLegend.R index ca39bd9f9..257a03c9f 100644 --- a/R/annoHeatmapLegend.R +++ b/R/annoHeatmapLegend.R @@ -23,7 +23,7 @@ #' @param plot Heatmap-style plot object to add heatmap legend for. #' @param orientation A string specifying legend orientation. #' Default value is \code{orientation = "v"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"v"}: }{Vertical legend orientation.} #' \item{\code{"h"}: }{Horizontal legend orientation.} #' } diff --git a/R/annoPixels.R b/R/annoPixels.R index 6f755b428..b3acdf72a 100644 --- a/R/annoPixels.R +++ b/R/annoPixels.R @@ -19,7 +19,7 @@ #' positions. #' @param type Character value specifying type of annotation. #' Default value is \code{type = "box"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"box"}: }{Boxes are drawn around each pixel.} #' \item{\code{"circle"}: }{Circles are drawn around each pixel.} #' \item{\code{"arrow"}: }{Arrows are drawn pointing to each pixel.} @@ -27,7 +27,7 @@ #' @param half Character value specifying which half of hic plots #' to annotate. Triangle Hi-C plots will always default to the entirety of #' the triangular plot. Default value is \code{half = "inherit"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"inherit"}: }{Pixels will be annotated on the \code{half} #' inherited by the input Hi-C plot.} #' \item{\code{"both"}: }{Pixels will be annotated on both halves of the diff --git a/R/annoSegments.R b/R/annoSegments.R index 4d548aa02..38cd708e2 100644 --- a/R/annoSegments.R +++ b/R/annoSegments.R @@ -38,14 +38,14 @@ #' Default value is \code{lty = 1}. #' @param lineend A character value specifying line end style. #' Default value is \code{lineend = "butt"}. Options are: -#' \itemize{ -#' \item{\code{"round"}: Segment ends are rounded.} -#' \item{\code{"butt"}: Segment ends end exactly where ended.} -#' \item{\code{"square"}: Segment ends are squared.} +#' \describe{ +#' \item{\code{"round"}: }{Segment ends are rounded.} +#' \item{\code{"butt"}: }{Segment ends end exactly where ended.} +#' \item{\code{"square"}: }{Segment ends are squared.} #' } #' @param linejoin A character value specifying line join style. #' Default value is \code{linejoin = "mitre"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"round"}: }{Line joins are rounded.} #' \item{\code{"mitre"}: }{Line joins are sharp corners.} #' \item{\code{"bevel"}: }{Line joins are flattened corners.} diff --git a/R/annoXaxis.R b/R/annoXaxis.R index 9c065301b..d15a70f07 100644 --- a/R/annoXaxis.R +++ b/R/annoXaxis.R @@ -19,7 +19,7 @@ #' If not logical, must be the same length as the \code{at} argument. #' @param main A logical value indicating whether to draw the x-axis at the #' bottom of the plot. Default value is \code{main = TRUE}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{TRUE}: }{x-axis is drawn at the bottom of the plot.} #' \item{\code{FALSE}: }{x-axis is drawn at the top of the plot.} #' } diff --git a/R/annoYaxis.R b/R/annoYaxis.R index 962964235..79388b27e 100644 --- a/R/annoYaxis.R +++ b/R/annoYaxis.R @@ -19,7 +19,7 @@ #' If not logical, must be the same length as the \code{at} argument. #' @param main A logical value indicating whether to draw the y-axis at #' the left of the plot. Default value is \code{main = TRUE}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{TRUE}: }{y-axis is drawn at the left of the plot.} #' \item{\code{FALSE}: }{y-axis is drawn at the right of the plot.} #' } diff --git a/R/plotGenomeLabel.R b/R/plotGenomeLabel.R index 92c60ae64..cd51f38f0 100644 --- a/R/plotGenomeLabel.R +++ b/R/plotGenomeLabel.R @@ -41,7 +41,7 @@ #' and coordinate labels. Default value is \code{margin = unit(1, "mm")}, #' @param scale A character value indicating the scale of the coordinates #' along the genome label. Default value is \code{scale = "bp"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"bp"}: }{base pairs.} #' \item{\code{"Kb"}: }{kilobase pairs. 1 kilobase pair is equal to #' 1000 base pairs.} @@ -59,7 +59,7 @@ #' add genome label. Sequence information will not be displayed along a y-axis. #' Default value is \code{axis = "x"}. #' Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"x"}: }{Genome label will be plotted along the x-axis.} #' \item{\code{"y"}: }{Genome label will be plotted along the y-axis. #' This is typically used for a square Hi-C plot made with diff --git a/R/plotHicRectangle.R b/R/plotHicRectangle.R index 0db967bf8..1f49b0fb3 100644 --- a/R/plotHicRectangle.R +++ b/R/plotHicRectangle.R @@ -42,7 +42,7 @@ #' @param matrix Character value indicating the type of matrix to output for #' .hic files. #' Default value is \code{matrix = "observed"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"observed"}: }{Observed counts.} #' \item{\code{"oe"}: }{Observed/expected counts.} #' \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} diff --git a/R/plotHicSquare.R b/R/plotHicSquare.R index ad61979de..e2c787854 100644 --- a/R/plotHicSquare.R +++ b/R/plotHicSquare.R @@ -45,7 +45,7 @@ #' @param matrix Character value indicating the type of matrix to output for #' .hic files. #' Default value is \code{matrix = "observed"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"observed"}: }{Observed counts.} #' \item{\code{"oe"}: }{Observed/expected counts.} #' \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} @@ -74,7 +74,7 @@ #' or \code{"bottom"}. For off-diagonal or interchromosomal plotting, #' options are \code{"top"} or \code{"bottom"}. #' Default value is \code{half = "both"}. -#' \itemize{ +#' \describe{ #' \item{\code{"both"}: }{Both diagonal halves.} #' \item{\code{"top"}: }{Half above the diagonal.} #' \item{\code{"bottom"}: }{Half below the diagonal.} diff --git a/R/plotHicTriangle.R b/R/plotHicTriangle.R index 8f0ea03f4..0da764167 100644 --- a/R/plotHicTriangle.R +++ b/R/plotHicTriangle.R @@ -41,7 +41,7 @@ #' @param matrix Character value indicating the type of matrix to output for #' .hic files. #' Default value is \code{matrix = "observed"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"observed"}: }{Observed counts.} #' \item{\code{"oe"}: }{Observed/expected counts.} #' \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} diff --git a/R/plotIdeogram.R b/R/plotIdeogram.R index 93ea3a12d..f2ccb8e86 100644 --- a/R/plotIdeogram.R +++ b/R/plotIdeogram.R @@ -28,7 +28,7 @@ #' @param orientation Character value indicating the orientation #' of the ideogram. Default value is \code{orientation = "h"}. #' Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"v"}: }{Vertical ideogram orientation.} #' \item{\code{"h"}: }{Horizontal ideogram orientation.} #' } diff --git a/R/plotLegend.R b/R/plotLegend.R index 51cc5f9df..a01de2c4b 100644 --- a/R/plotLegend.R +++ b/R/plotLegend.R @@ -29,7 +29,7 @@ #' @param lty The line types for lines appearing in the legend. #' @param orientation A string specifying legend orientation. #' Default value is \code{orientation = "v"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"v"}: }{Vertical legend orientation.} #' \item{\code{"h"}: }{Horizontal legend orientation.} #' } diff --git a/R/plotManhattan.R b/R/plotManhattan.R index 0b09a1529..1cd948db0 100644 --- a/R/plotManhattan.R +++ b/R/plotManhattan.R @@ -36,7 +36,7 @@ #' @param data Data to be plotted, as a character value specifying a #' file path of GWAS data, a dataframe, or a \link[GenomicRanges]{GRanges} #' object. Each of these data types must have the following columns: -#' \itemize{ +#' \describe{ #' \item{\code{"chrom"}: }{Chromosome names. This column must be a character.} #' \item{\code{"pos"}: }{Chromosomal position. This column must be #' an integer or numeric.} diff --git a/R/plotMultiSignal.R b/R/plotMultiSignal.R index d155540fa..80321e4f3 100644 --- a/R/plotMultiSignal.R +++ b/R/plotMultiSignal.R @@ -76,7 +76,7 @@ #' Default value is \code{baseline.lwd = 1}. #' @param orientation A string specifying signal track orientations. #' Default value is \code{orientation = "h"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"v"}: }{Vertical signal track orientations, where signal tracks #' will be stacked from left to right.} #' \item{\code{"h"}: }{Horizontal signal track orientations, where signal tracks diff --git a/R/plotPairs.R b/R/plotPairs.R index 540fcec5a..baa5d96af 100644 --- a/R/plotPairs.R +++ b/R/plotPairs.R @@ -43,7 +43,7 @@ #' \link[plotgardener]{colorby} object specifying the color of the lines #' outlining paired range elements. Default value is \code{linecolor = NA}. #' Special options include: -#' \itemize{ +#' \describe{ #' \item{\code{NA}: }{No line color.} #' \item{\code{"fill"}: }{Same color as \code{fill}.} #' } diff --git a/R/plotPairsArches.R b/R/plotPairsArches.R index bb629f932..0e9edb033 100644 --- a/R/plotPairsArches.R +++ b/R/plotPairsArches.R @@ -42,7 +42,7 @@ #' Default value is \code{assembly = "hg38"}. #' @param style Character value describing the style of arches. #' Default value is \code{style = "2D"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"2D"}: }{Arches will be drawn in a 2-dimensional style.} #' \item{\code{"3D"}: }{Arches will be drawn in a 3-dimensional style.} #' } @@ -60,7 +60,7 @@ #' \link[plotgardener]{colorby} object specifying the color of the lines #' outlining arches. Default value is \code{linecolor = NA}. #' Special options include: -#' \itemize{ +#' \describe{ #' \item{\code{NA}: }{No line color.} #' \item{\code{"fill"}: }{Same color as \code{fill}.} #' } diff --git a/R/plotRanges.R b/R/plotRanges.R index 592bf77e7..730870317 100644 --- a/R/plotRanges.R +++ b/R/plotRanges.R @@ -47,14 +47,14 @@ #' \link[plotgardener]{colorby} object specifying the color of the lines #' outlining range elements. Default value is \code{linecolor = NA}. #' Special options include: -#' \itemize{ +#' \describe{ #' \item{\code{NA}: }{No line color.} #' \item{\code{"fill"}: }{Same color as \code{fill}.} #' } . #' @param order A character value specifying how to order pileup data #' before assigning rows. Default value is \code{order = "width"}. Options #' include: -#' \itemize{ +#' \describe{ #' \item{\code{"width"}: }{Ordered by decreasing width of elements.} #' \item{\code{"random"}: }{Ordered randomly in each function call.} #' } . diff --git a/R/plotSegments.R b/R/plotSegments.R index c9f087bd0..c39c6d2e9 100644 --- a/R/plotSegments.R +++ b/R/plotSegments.R @@ -43,14 +43,14 @@ #' Default value is \code{lty = 1}. #' @param lineend A character value specifying line end style. #' Default value is \code{lineend = "butt"}. Options are: -#' \itemize{ -#' \item{\code{"round"}: Segment ends are rounded.} -#' \item{\code{"butt"}: Segment ends end exactly where ended.} -#' \item{\code{"square"}: Segment ends are squared.} +#' \describe{ +#' \item{\code{"round"}: }{Segment ends are rounded.} +#' \item{\code{"butt"}: }{Segment ends end exactly where ended.} +#' \item{\code{"square"}: }{Segment ends are squared.} #' } #' @param linejoin A character value specifying line join style. #' Default value is \code{linejoin = "mitre"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"round"}: }{Line joins are rounded.} #' \item{\code{"mitre"}: }{Line joins are sharp corners.} #' \item{\code{"bevel"}: }{Line joins are flattened corners.} diff --git a/R/plotSignal.R b/R/plotSignal.R index d1931cab9..1e9cadd7c 100644 --- a/R/plotSignal.R +++ b/R/plotSignal.R @@ -77,7 +77,7 @@ #' Default value is \code{baseline.lwd = 1}. #' @param orientation A string specifying signal track orientation. #' Default value is \code{orientation = "h"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"v"}: }{Vertical signal track orientation.} #' \item{\code{"h"}: }{Horizontal signal track orientation.} #' } diff --git a/R/plotTranscripts.R b/R/plotTranscripts.R index 7d4936e43..2337dbcf7 100644 --- a/R/plotTranscripts.R +++ b/R/plotTranscripts.R @@ -69,7 +69,7 @@ #' @param labels A character value describing the format of #' transcript text labels. Default value is \code{labels = "trancript"}. #' Options are: -#' \itemize{ +#' \describe{ #' \item{\code{NULL}: }{No labels.} #' \item{\code{"transcript"}: }{Transcript name labels.} #' \item{\code{"gene"}: }{Gene name labels.} diff --git a/R/plotgardener.R b/R/plotgardener.R index d5d644fa8..948c3aefd 100644 --- a/R/plotgardener.R +++ b/R/plotgardener.R @@ -68,3 +68,5 @@ #' @importFrom GenomeInfoDb keepStandardChromosomes #' @importFrom GenomicRanges makeGRangesFromDataFrame "_PACKAGE" + +utils::globalVariables(c("name", "width", "strand")) diff --git a/R/readBigwig.R b/R/readBigwig.R index 452f279e5..817ff10d0 100644 --- a/R/readBigwig.R +++ b/R/readBigwig.R @@ -16,7 +16,7 @@ #' @param chromend Integer end position on chromosome. #' @param strand A character value specifying strand. #' Default value is \code{strand = "*"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"+"}: }{Plus strand.} #' \item{\code{"-"}: }{Minus strand.} #' \item{\code{"*"}: }{Plus and minus strands.} diff --git a/R/readCool.R b/R/readCool.R index b5ed590f8..b76884ce3 100755 --- a/R/readCool.R +++ b/R/readCool.R @@ -1,8 +1,12 @@ #' Check for .(m)cool file and contents #' @author Sarah Parker -#' +#' #' @param file Path to .(m)cool file -#' +#' +#' @return A character string, either \code{".cool"} or \code{".mcool"}, +#' indicating the file type. Aborts with an error if the file is not a +#' valid .(m)cool file. +#' #' @importFrom glue glue glue_collapse #' @importFrom rlang abort #' @importFrom rhdf5 H5Fis_hdf5 h5ls @@ -236,6 +240,9 @@ readCoolChroms <- function(file, resolution = NULL){ #' @param file Path to .(m)cool file #' @param chromstart Chromstart of region #' @param chromend Chromend of region +#' +#' @return A numeric value specifying the automatically determined resolution +#' in base pairs. .coolAutoResolution <- function(file, chromstart, chromend){ fileResolutions <- readCoolBpResolutions(file) @@ -300,6 +307,9 @@ readCoolChroms <- function(file, resolution = NULL){ #' @param file Path to .(m)cool file #' @param chrom Chromosome of region; can also be altchromosome #' @param resolution Resolution to read chromsome info from +#' +#' @return A list of length two containing the chromosome start position (1) +#' and the chromosome length. .coolRegion <- function(file, chrom, resolution){ chromInfo <- readCoolChroms(file, resolution = resolution) @@ -319,7 +329,10 @@ readCoolChroms <- function(file, resolution = NULL){ #' @param end1bin Bin where end1 starts #' @param start2bin Bin for chr2 starts #' @param end2bin Bin for end2 starts -#' +#' +#' @return An integer vector of pixel indices corresponding to interactions +#' within the specified bin chunk, or \code{NA} if none are found. +#' #' @importFrom rhdf5 h5read .pullBinChunks <- function(binChunk, file, bin_offsets, binChunkSize, datasetPath, end1bin, @@ -357,7 +370,10 @@ readCoolChroms <- function(file, resolution = NULL){ #' @param altchromend User-inputted alt chromend. #' @param norm User-inputted normalization. #' @param resolution Resolution, either user-inputted or determined by 'auto'. -#' +#' +#' @return Called for side effects (input validation). Aborts with an +#' informative error if any inputs are invalid. +#' #' @importFrom glue glue #' @importFrom rlang abort .checkCoolErrors <- function(file, chrom, chromstart, chromend, zrange, diff --git a/R/readHic.R b/R/readHic.R index 4107d8a38..67798356a 100644 --- a/R/readHic.R +++ b/R/readHic.R @@ -36,7 +36,7 @@ #' the size of the region. #' @param res_scale A character value specifying the resolution scale. #' Default value is \code{res_scale = "BP"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"BP"}: }{Base pairs.} #' \item{\code{"FRAG"}: }{Fragments.} #' } @@ -47,7 +47,7 @@ #' Default value is \code{norm = "KR"}. #' @param matrix Character value indicating the type of matrix to output. #' Default value is \code{matrix = "observed"}. Options are: -#' \itemize{ +#' \describe{ #' \item{\code{"observed"}: }{Observed counts.} #' \item{\code{"oe"}: }{Observed/expected counts.} #' \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} diff --git a/man/annoDomains.Rd b/man/annoDomains.Rd index 2affc143e..35f10f68c 100644 --- a/man/annoDomains.Rd +++ b/man/annoDomains.Rd @@ -24,7 +24,7 @@ domain ranges.} \item{half}{Character value specifying which half of hic plots to annotate. Triangle Hi-C plots will always default to the entirety of the triangular plot. Default value is \code{half = "inherit"}. Options are: -\itemize{ +\describe{ \item{\code{"inherit"}: }{Domains will be annotated on the \code{half} inherited by the input Hi-C plot.} \item{\code{"both"}: }{Domains will be annotated on both halves of the diff --git a/man/annoGenomeLabel.Rd b/man/annoGenomeLabel.Rd index e21de24b2..68b973a2b 100644 --- a/man/annoGenomeLabel.Rd +++ b/man/annoGenomeLabel.Rd @@ -43,7 +43,7 @@ and coordinate labels. Default value is \code{margin = unit(1, "mm")}.} \item{scale}{A character value indicating the scale of the coordinates along the genome label. Default value is \code{scale = "bp"}. Options are: -\itemize{ +\describe{ \item{\code{"bp"}: }{base pairs.} \item{\code{"Kb"}: }{kilobase pairs. 1 kilobase pair is equal to 1000 base pairs.} @@ -65,7 +65,7 @@ Default value is \code{boxWidth = 0.5}.} add genome label. Sequence information will not be displayed along a y-axis. Default value is \code{axis = "x"}. Options are: -\itemize{ +\describe{ \item{\code{"x"}: }{Genome label will be plotted along the x-axis.} \item{\code{"y"}: }{Genome label will be plotted along the y-axis. This is typically used for a square Hi-C plot made with diff --git a/man/annoHeatmapLegend.Rd b/man/annoHeatmapLegend.Rd index 838a43c32..89a1c2d24 100644 --- a/man/annoHeatmapLegend.Rd +++ b/man/annoHeatmapLegend.Rd @@ -29,7 +29,7 @@ annoHeatmapLegend( \item{orientation}{A string specifying legend orientation. Default value is \code{orientation = "v"}. Options are: -\itemize{ +\describe{ \item{\code{"v"}: }{Vertical legend orientation.} \item{\code{"h"}: }{Horizontal legend orientation.} }} diff --git a/man/annoPixels.Rd b/man/annoPixels.Rd index 6e12a6ac0..c900a1240 100644 --- a/man/annoPixels.Rd +++ b/man/annoPixels.Rd @@ -26,7 +26,7 @@ positions.} \item{type}{Character value specifying type of annotation. Default value is \code{type = "box"}. Options are: -\itemize{ +\describe{ \item{\code{"box"}: }{Boxes are drawn around each pixel.} \item{\code{"circle"}: }{Circles are drawn around each pixel.} \item{\code{"arrow"}: }{Arrows are drawn pointing to each pixel.} @@ -35,7 +35,7 @@ Default value is \code{type = "box"}. Options are: \item{half}{Character value specifying which half of hic plots to annotate. Triangle Hi-C plots will always default to the entirety of the triangular plot. Default value is \code{half = "inherit"}. Options are: -\itemize{ +\describe{ \item{\code{"inherit"}: }{Pixels will be annotated on the \code{half} inherited by the input Hi-C plot.} \item{\code{"both"}: }{Pixels will be annotated on both halves of the diff --git a/man/annoSegments.Rd b/man/annoSegments.Rd index 479335f25..13aa9a3fc 100644 --- a/man/annoSegments.Rd +++ b/man/annoSegments.Rd @@ -52,15 +52,15 @@ Default value is \code{lty = 1}.} \item{lineend}{A character value specifying line end style. Default value is \code{lineend = "butt"}. Options are: -\itemize{ -\item{\code{"round"}: Segment ends are rounded.} -\item{\code{"butt"}: Segment ends end exactly where ended.} -\item{\code{"square"}: Segment ends are squared.} +\describe{ +\item{\code{"round"}: }{Segment ends are rounded.} +\item{\code{"butt"}: }{Segment ends end exactly where ended.} +\item{\code{"square"}: }{Segment ends are squared.} }} \item{linejoin}{A character value specifying line join style. Default value is \code{linejoin = "mitre"}. Options are: -\itemize{ +\describe{ \item{\code{"round"}: }{Line joins are rounded.} \item{\code{"mitre"}: }{Line joins are sharp corners.} \item{\code{"bevel"}: }{Line joins are flattened corners.} diff --git a/man/annoXaxis.Rd b/man/annoXaxis.Rd index dbdb9ef35..129ddfc23 100644 --- a/man/annoXaxis.Rd +++ b/man/annoXaxis.Rd @@ -27,7 +27,7 @@ If not logical, must be the same length as the \code{at} argument.} \item{main}{A logical value indicating whether to draw the x-axis at the bottom of the plot. Default value is \code{main = TRUE}. Options are: -\itemize{ +\describe{ \item{\code{TRUE}: }{x-axis is drawn at the bottom of the plot.} \item{\code{FALSE}: }{x-axis is drawn at the top of the plot.} }} diff --git a/man/annoYaxis.Rd b/man/annoYaxis.Rd index 84d65f5f4..d6d84b4d3 100644 --- a/man/annoYaxis.Rd +++ b/man/annoYaxis.Rd @@ -27,7 +27,7 @@ If not logical, must be the same length as the \code{at} argument.} \item{main}{A logical value indicating whether to draw the y-axis at the left of the plot. Default value is \code{main = TRUE}. Options are: -\itemize{ +\describe{ \item{\code{TRUE}: }{y-axis is drawn at the left of the plot.} \item{\code{FALSE}: }{y-axis is drawn at the right of the plot.} }} diff --git a/man/dot-checkCool.Rd b/man/dot-checkCool.Rd index 6b9cb6a47..227c146af 100644 --- a/man/dot-checkCool.Rd +++ b/man/dot-checkCool.Rd @@ -15,3 +15,7 @@ Check for .(m)cool file and contents \author{ Sarah Parker } + +\value{ +A character string, either \code{".cool"} or \code{".mcool"}, indicating the file type. Aborts with an error if the file is not a valid .(m)cool file. +} diff --git a/man/dot-checkCoolErrors.Rd b/man/dot-checkCoolErrors.Rd index 8db3b023b..7579ca621 100644 --- a/man/dot-checkCoolErrors.Rd +++ b/man/dot-checkCoolErrors.Rd @@ -41,3 +41,7 @@ \description{ Error checking function for .(m)cool files } + +\value{ +Called for side effects (input validation). Aborts with an informative error if any inputs are invalid. +} diff --git a/man/dot-coolAutoResolution.Rd b/man/dot-coolAutoResolution.Rd index bad5fbd62..ac9d4fa49 100644 --- a/man/dot-coolAutoResolution.Rd +++ b/man/dot-coolAutoResolution.Rd @@ -16,3 +16,7 @@ \description{ Determine best resolution for size of region for .(m)cool files } + +\value{ +A numeric value specifying the automatically determined resolution in base pairs. +} diff --git a/man/dot-coolRegion.Rd b/man/dot-coolRegion.Rd index 7c54f66b9..e4a0efb07 100644 --- a/man/dot-coolRegion.Rd +++ b/man/dot-coolRegion.Rd @@ -18,3 +18,7 @@ Add (alt)chromstart and (alt)chromend for NULL (alt)chrom region of .(m)cool files } + +\value{ +A list of length two containing the chromosome start position (1) and the chromosome length. +} diff --git a/man/dot-pullBinChunks.Rd b/man/dot-pullBinChunks.Rd index 7d6e99561..530812d33 100644 --- a/man/dot-pullBinChunks.Rd +++ b/man/dot-pullBinChunks.Rd @@ -36,3 +36,7 @@ the bin chunk} \description{ Read in data for a bin chunk } + +\value{ +An integer vector of pixel indices corresponding to interactions within the specified bin chunk, or \code{NA} if none are found. +} diff --git a/man/figures/plotgardenerApp-Figure.png b/man/figures/plotgardenerApp-Figure.png new file mode 100644 index 000000000..36d1f5283 Binary files /dev/null and b/man/figures/plotgardenerApp-Figure.png differ diff --git a/man/plotGenomeLabel.Rd b/man/plotGenomeLabel.Rd index cd72bb324..dc54f53d0 100644 --- a/man/plotGenomeLabel.Rd +++ b/man/plotGenomeLabel.Rd @@ -54,7 +54,7 @@ and coordinate labels. Default value is \code{margin = unit(1, "mm")},} \item{scale}{A character value indicating the scale of the coordinates along the genome label. Default value is \code{scale = "bp"}. Options are: -\itemize{ +\describe{ \item{\code{"bp"}: }{base pairs.} \item{\code{"Kb"}: }{kilobase pairs. 1 kilobase pair is equal to 1000 base pairs.} @@ -76,7 +76,7 @@ Default value is \code{boxWidth = 0.5}.} add genome label. Sequence information will not be displayed along a y-axis. Default value is \code{axis = "x"}. Options are: -\itemize{ +\describe{ \item{\code{"x"}: }{Genome label will be plotted along the x-axis.} \item{\code{"y"}: }{Genome label will be plotted along the y-axis. This is typically used for a square Hi-C plot made with diff --git a/man/plotHicRectangle.Rd b/man/plotHicRectangle.Rd index cf6226025..94402a1c6 100644 --- a/man/plotHicRectangle.Rd +++ b/man/plotHicRectangle.Rd @@ -51,7 +51,7 @@ Default value is \code{norm = "KR"}.} \item{matrix}{Character value indicating the type of matrix to output for .hic files. Default value is \code{matrix = "observed"}. Options are: -\itemize{ +\describe{ \item{\code{"observed"}: }{Observed counts.} \item{\code{"oe"}: }{Observed/expected counts.} \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} diff --git a/man/plotHicSquare.Rd b/man/plotHicSquare.Rd index 66ebdff24..498c5f17d 100644 --- a/man/plotHicSquare.Rd +++ b/man/plotHicSquare.Rd @@ -54,7 +54,7 @@ if giving .hic or .(m)cool file. This value must be found in the .hic or \item{matrix}{Character value indicating the type of matrix to output for .hic files. Default value is \code{matrix = "observed"}. Options are: -\itemize{ +\describe{ \item{\code{"observed"}: }{Observed counts.} \item{\code{"oe"}: }{Observed/expected counts.} \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} @@ -93,7 +93,7 @@ For intrachromosomal plotting, options are \code{"both"}, \code{"top"}, or \code{"bottom"}. For off-diagonal or interchromosomal plotting, options are \code{"top"} or \code{"bottom"}. Default value is \code{half = "both"}. -\itemize{ +\describe{ \item{\code{"both"}: }{Both diagonal halves.} \item{\code{"top"}: }{Half above the diagonal.} \item{\code{"bottom"}: }{Half below the diagonal.} diff --git a/man/plotHicTriangle.Rd b/man/plotHicTriangle.Rd index 7e2210bfa..b2183aa0f 100644 --- a/man/plotHicTriangle.Rd +++ b/man/plotHicTriangle.Rd @@ -50,7 +50,7 @@ if giving .hic or .(m)cool file. This value must be found in the .hic or \item{matrix}{Character value indicating the type of matrix to output for .hic files. Default value is \code{matrix = "observed"}. Options are: -\itemize{ +\describe{ \item{\code{"observed"}: }{Observed counts.} \item{\code{"oe"}: }{Observed/expected counts.} \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} diff --git a/man/plotIdeogram.Rd b/man/plotIdeogram.Rd index 491312ba6..3497bf11d 100644 --- a/man/plotIdeogram.Rd +++ b/man/plotIdeogram.Rd @@ -36,7 +36,7 @@ columns: "seqnames", "start", "end", "width", "strand", \item{orientation}{Character value indicating the orientation of the ideogram. Default value is \code{orientation = "h"}. Options are: -\itemize{ +\describe{ \item{\code{"v"}: }{Vertical ideogram orientation.} \item{\code{"h"}: }{Horizontal ideogram orientation.} }} diff --git a/man/plotLegend.Rd b/man/plotLegend.Rd index 74790919f..2a697b157 100644 --- a/man/plotLegend.Rd +++ b/man/plotLegend.Rd @@ -38,7 +38,7 @@ numeric vector.} \item{orientation}{A string specifying legend orientation. Default value is \code{orientation = "v"}. Options are: -\itemize{ +\describe{ \item{\code{"v"}: }{Vertical legend orientation.} \item{\code{"h"}: }{Horizontal legend orientation.} }} diff --git a/man/plotManhattan.Rd b/man/plotManhattan.Rd index bedf82c5e..1cf2e5110 100644 --- a/man/plotManhattan.Rd +++ b/man/plotManhattan.Rd @@ -41,7 +41,7 @@ plotManhattan( \item{data}{Data to be plotted, as a character value specifying a file path of GWAS data, a dataframe, or a \link[GenomicRanges]{GRanges} object. Each of these data types must have the following columns: -\itemize{ +\describe{ \item{\code{"chrom"}: }{Chromosome names. This column must be a character.} \item{\code{"pos"}: }{Chromosomal position. This column must be an integer or numeric.} diff --git a/man/plotMultiSignal.Rd b/man/plotMultiSignal.Rd index 239597c89..d636f6d0b 100644 --- a/man/plotMultiSignal.Rd +++ b/man/plotMultiSignal.Rd @@ -99,7 +99,7 @@ Default value is \code{baseline.lwd = 1}.} \item{orientation}{A string specifying signal track orientations. Default value is \code{orientation = "h"}. Options are: -\itemize{ +\describe{ \item{\code{"v"}: }{Vertical signal track orientations, where signal tracks will be stacked from left to right.} \item{\code{"h"}: }{Horizontal signal track orientations, where signal tracks diff --git a/man/plotPairs.Rd b/man/plotPairs.Rd index f23c73f3c..d91b6217a 100644 --- a/man/plotPairs.Rd +++ b/man/plotPairs.Rd @@ -54,7 +54,7 @@ paired range elements. Default value is \code{fill = "#1f4297"}.} \link[plotgardener]{colorby} object specifying the color of the lines outlining paired range elements. Default value is \code{linecolor = NA}. Special options include: -\itemize{ +\describe{ \item{\code{NA}: }{No line color.} \item{\code{"fill"}: }{Same color as \code{fill}.} }} diff --git a/man/plotPairsArches.Rd b/man/plotPairsArches.Rd index 3ebc90f52..348a6a237 100644 --- a/man/plotPairsArches.Rd +++ b/man/plotPairsArches.Rd @@ -52,7 +52,7 @@ Default value is \code{assembly = "hg38"}.} \item{style}{Character value describing the style of arches. Default value is \code{style = "2D"}. Options are: -\itemize{ +\describe{ \item{\code{"2D"}: }{Arches will be drawn in a 2-dimensional style.} \item{\code{"3D"}: }{Arches will be drawn in a 3-dimensional style.} }} @@ -75,7 +75,7 @@ Default value is \code{fill = #1f4297"}.} \link[plotgardener]{colorby} object specifying the color of the lines outlining arches. Default value is \code{linecolor = NA}. Special options include: -\itemize{ +\describe{ \item{\code{NA}: }{No line color.} \item{\code{"fill"}: }{Same color as \code{fill}.} }} diff --git a/man/plotRanges.Rd b/man/plotRanges.Rd index 23527ae1c..3710c02e2 100644 --- a/man/plotRanges.Rd +++ b/man/plotRanges.Rd @@ -58,7 +58,7 @@ Default value is \code{fill = "#7ecdbb"}.} \link[plotgardener]{colorby} object specifying the color of the lines outlining range elements. Default value is \code{linecolor = NA}. Special options include: -\itemize{ +\describe{ \item{\code{NA}: }{No line color.} \item{\code{"fill"}: }{Same color as \code{fill}.} } .} @@ -66,7 +66,7 @@ Special options include: \item{order}{A character value specifying how to order pileup data before assigning rows. Default value is \code{order = "width"}. Options include: -\itemize{ +\describe{ \item{\code{"width"}: }{Ordered by decreasing width of elements.} \item{\code{"random"}: }{Ordered randomly in each function call.} } .} diff --git a/man/plotSegments.Rd b/man/plotSegments.Rd index cf4dc7c63..9ba8a7a7b 100644 --- a/man/plotSegments.Rd +++ b/man/plotSegments.Rd @@ -56,15 +56,15 @@ Default value is \code{lty = 1}.} \item{lineend}{A character value specifying line end style. Default value is \code{lineend = "butt"}. Options are: -\itemize{ -\item{\code{"round"}: Segment ends are rounded.} -\item{\code{"butt"}: Segment ends end exactly where ended.} -\item{\code{"square"}: Segment ends are squared.} +\describe{ +\item{\code{"round"}: }{Segment ends are rounded.} +\item{\code{"butt"}: }{Segment ends end exactly where ended.} +\item{\code{"square"}: }{Segment ends are squared.} }} \item{linejoin}{A character value specifying line join style. Default value is \code{linejoin = "mitre"}. Options are: -\itemize{ +\describe{ \item{\code{"round"}: }{Line joins are rounded.} \item{\code{"mitre"}: }{Line joins are sharp corners.} \item{\code{"bevel"}: }{Line joins are flattened corners.} diff --git a/man/plotSignal.Rd b/man/plotSignal.Rd index 2bf5f71a1..abd7f7ff1 100644 --- a/man/plotSignal.Rd +++ b/man/plotSignal.Rd @@ -100,7 +100,7 @@ Default value is \code{baseline.lwd = 1}.} \item{orientation}{A string specifying signal track orientation. Default value is \code{orientation = "h"}. Options are: -\itemize{ +\describe{ \item{\code{"v"}: }{Vertical signal track orientation.} \item{\code{"h"}: }{Horizontal signal track orientation.} }} diff --git a/man/plotTranscripts.Rd b/man/plotTranscripts.Rd index 7402a4fbb..d56f297f5 100644 --- a/man/plotTranscripts.Rd +++ b/man/plotTranscripts.Rd @@ -88,7 +88,7 @@ Default value is \code{fontsize = 8}.} \item{labels}{A character value describing the format of transcript text labels. Default value is \code{labels = "trancript"}. Options are: -\itemize{ +\describe{ \item{\code{NULL}: }{No labels.} \item{\code{"transcript"}: }{Transcript name labels.} \item{\code{"gene"}: }{Gene name labels.} diff --git a/man/readBigwig.Rd b/man/readBigwig.Rd index a84aca1a1..211b52fb5 100644 --- a/man/readBigwig.Rd +++ b/man/readBigwig.Rd @@ -25,7 +25,7 @@ chromosome is desired.} \item{strand}{A character value specifying strand. Default value is \code{strand = "*"}. Options are: -\itemize{ +\describe{ \item{\code{"+"}: }{Plus strand.} \item{\code{"-"}: }{Minus strand.} \item{\code{"*"}: }{Plus and minus strands.} diff --git a/man/readHic.Rd b/man/readHic.Rd index 4c60fe0b7..6f229781d 100644 --- a/man/readHic.Rd +++ b/man/readHic.Rd @@ -50,7 +50,7 @@ the size of the region.} \item{res_scale}{A character value specifying the resolution scale. Default value is \code{res_scale = "BP"}. Options are: -\itemize{ +\describe{ \item{\code{"BP"}: }{Base pairs.} \item{\code{"FRAG"}: }{Fragments.} }} @@ -64,7 +64,7 @@ Default value is \code{norm = "KR"}.} \item{matrix}{Character value indicating the type of matrix to output. Default value is \code{matrix = "observed"}. Options are: -\itemize{ +\describe{ \item{\code{"observed"}: }{Observed counts.} \item{\code{"oe"}: }{Observed/expected counts.} \item{\code{"log2oe"}: }{Log2 transformed observed/expected counts.} diff --git a/src/checkRow.cpp b/src/checkRow.cpp index 16372256a..927f901ee 100644 --- a/src/checkRow.cpp +++ b/src/checkRow.cpp @@ -16,10 +16,10 @@ int rowNum(NumericVector v, NumericMatrix x, int maxRows, int rowCol, double wig for (int row = 0; row < dfRows; row++){ NumericVector v = x(row,_); - if (((v[rowCol] == j) & - (((start >= v[0]) & (start <= v[1])) | - ((stop >= v[0]) & (stop <= v[1])) | - ((start <= v[0]) & (stop >= v[1]))))){ + if (((v[rowCol] == j) && + (((start >= v[0]) && (start <= v[1])) || + ((stop >= v[0]) && (stop <= v[1])) || + ((start <= v[0]) && (stop >= v[1]))))){ rowCounter++; } diff --git a/tests/testthat/test-readingFunctions.R b/tests/testthat/test-readingFunctions.R index 3e9dc013c..dc53c42c1 100644 --- a/tests/testthat/test-readingFunctions.R +++ b/tests/testthat/test-readingFunctions.R @@ -81,7 +81,8 @@ test_that("readHic", { }) test_that("readCool", { - + skip_on_ci() + ## .cool file coolFile <- file.path(tempdir(), "Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool") download.file(url = "https://usgs2.osn.mghpcc.org/cooler01/examples/hg19/Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool",