From 7653d6f4f80b99df7a0ac0a7e9a07accd9ca2301 Mon Sep 17 00:00:00 2001 From: HDash <16350928+HDash@users.noreply.github.com> Date: Tue, 25 Jun 2024 19:27:23 +0100 Subject: [PATCH] Fix examples and import conflicts --- DESCRIPTION | 4 ---- NAMESPACE | 6 ++++++ R/MotifPeeker.R | 5 +++++ R/calc_frip.R | 2 +- R/check_ENCODE.R | 2 +- R/link_JASPAR.R | 4 ---- R/print_DT.R | 2 ++ man/calc_frip.Rd | 2 +- man/check_ENCODE.Rd | 2 +- man/link_JASPAR.Rd | 5 ----- man/print_DT.Rd | 3 +++ 11 files changed, 20 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3d78593..52a9528 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -39,9 +39,7 @@ Imports: BiocParallel, DT, ggplot2, - patchwork, plotly, - scales, tidyverse, universalmotif, GenomicRanges, @@ -52,7 +50,6 @@ Imports: rmarkdown, curl, jsonlite, - htmltools, viridis, emoji, SummarizedExperiment, @@ -68,7 +65,6 @@ Suggests: markdown, methods, remotes, - rmarkdown, rworkflows, testthat (>= 3.0.0), utils diff --git a/NAMESPACE b/NAMESPACE index 8c66a57..5395bd2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -11,6 +11,10 @@ export(read_motif_file) export(read_peak_file) export(report_command) export(report_header) +import(ggplot2) +import(plotly, except = last_plot) + +import(tidyverse) importFrom(BiocFileCache,BiocFileCache) importFrom(BiocFileCache,bfcinfo) importFrom(DT,datatable) @@ -18,6 +22,7 @@ importFrom(GenomicAlignments,summarizeOverlaps) importFrom(Rsamtools,countBam) importFrom(SummarizedExperiment,assay) importFrom(curl,curl_fetch_memory) +importFrom(emoji,emoji) importFrom(htmltools,tagList) importFrom(htmlwidgets,JS) importFrom(jsonlite,fromJSON) @@ -30,3 +35,4 @@ importFrom(universalmotif,read_meme) importFrom(universalmotif,read_transfac) importFrom(universalmotif,read_uniprobe) importFrom(utils,browseURL) +importFrom(viridis,scale_fill_viridis) diff --git a/R/MotifPeeker.R b/R/MotifPeeker.R index b1ee3d8..472bab0 100644 --- a/R/MotifPeeker.R +++ b/R/MotifPeeker.R @@ -89,9 +89,14 @@ #' @inheritParams read_motif_file #' @inheritParams check_genome_build #' +#' @import ggplot2 +#' @import tidyverse +#' @importFrom emoji emoji +#' @importFrom viridis scale_fill_viridis #' @importFrom tools file_path_sans_ext #' @importFrom rmarkdown render #' @importFrom utils browseURL +#' @rawNamespace import(plotly, except = last_plot) #' #' @return Path to the output directory. #' diff --git a/R/calc_frip.R b/R/calc_frip.R index 812b083..2b221ba 100644 --- a/R/calc_frip.R +++ b/R/calc_frip.R @@ -25,7 +25,7 @@ #' read_file <- Rsamtools::BamFile(read_file) #' data("CTCF_ChIP_peaks", package = "MotifPeeker") #' -#' frip(read_file, CTCF_ChIP_peaks) +#' calc_frip(read_file, CTCF_ChIP_peaks) #' #' @export calc_frip <- function( diff --git a/R/check_ENCODE.R b/R/check_ENCODE.R index a934142..8db9eef 100644 --- a/R/check_ENCODE.R +++ b/R/check_ENCODE.R @@ -16,7 +16,7 @@ #' @importFrom jsonlite fromJSON #' #' @examples -#' check_ENCODE("ENCFF109VAD") +#' check_ENCODE("ENCFF109VAD", expect_format = "bam") #' #' @export check_ENCODE <- function(encode_id, expect_format, verbose = FALSE) { diff --git a/R/link_JASPAR.R b/R/link_JASPAR.R index abb8996..159a768 100644 --- a/R/link_JASPAR.R +++ b/R/link_JASPAR.R @@ -7,10 +7,6 @@ #' @returns A character string containing the JASPAR motif link. If #' \code{motif_id} is not a valid JASPAR motif ID, it is returned as is. #' -#' @examples -#' link_JASPAR("MA1930.2") -#' link_JASPAR("MA1930.2", download = TRUE) -#' #' @keywords internal link_JASPAR <- function(motif_id, download = FALSE) { if (is.na(motif_id) || !startsWith(motif_id, "MA")) { diff --git a/R/print_DT.R b/R/print_DT.R index 838a6e2..94cdb9f 100644 --- a/R/print_DT.R +++ b/R/print_DT.R @@ -9,6 +9,8 @@ #' @importFrom htmlwidgets JS #' @importFrom htmltools tagList #' +#' @returns A DT object suitable to be used with \code{print()}. +#' #' @keywords internal print_DT <- function(df, html_tags = FALSE, extra = FALSE) { ## Handle empty values diff --git a/man/calc_frip.Rd b/man/calc_frip.Rd index fa9a127..20d0389 100644 --- a/man/calc_frip.Rd +++ b/man/calc_frip.Rd @@ -34,6 +34,6 @@ read_file <- system.file("extdata", "CTCF_ChIP_alignment.bam", read_file <- Rsamtools::BamFile(read_file) data("CTCF_ChIP_peaks", package = "MotifPeeker") -frip(read_file, CTCF_ChIP_peaks) +calc_frip(read_file, CTCF_ChIP_peaks) } diff --git a/man/check_ENCODE.Rd b/man/check_ENCODE.Rd index d3df7c9..50d3edb 100644 --- a/man/check_ENCODE.Rd +++ b/man/check_ENCODE.Rd @@ -25,6 +25,6 @@ Check and get files from ENCODE project. Requires the input to be in ENCODE ID format. Uses BiocFileCache to cache downloads. Only works for files. } \examples{ -check_ENCODE("ENCFF109VAD") +check_ENCODE("ENCFF109VAD", expect_format = "bam") } diff --git a/man/link_JASPAR.Rd b/man/link_JASPAR.Rd index 901d847..c7e3396 100644 --- a/man/link_JASPAR.Rd +++ b/man/link_JASPAR.Rd @@ -18,10 +18,5 @@ A character string containing the JASPAR motif link. If } \description{ Get JASPAR link for motifs -} -\examples{ -link_JASPAR("MA1930.2") -link_JASPAR("MA1930.2", download = TRUE) - } \keyword{internal} diff --git a/man/print_DT.Rd b/man/print_DT.Rd index 88f9df0..0edd29b 100644 --- a/man/print_DT.Rd +++ b/man/print_DT.Rd @@ -14,6 +14,9 @@ print_DT(df, html_tags = FALSE, extra = FALSE) \item{extra}{Logical. If TRUE, adds extra options like search to the datatable.} } +\value{ +A DT object suitable to be used with \code{print()}. +} \description{ Print DT table }