Skip to content

Commit

Permalink
Merge pull request #5 from neurogenomics/remove_donttest
Browse files Browse the repository at this point in the history
Remove donttest
  • Loading branch information
HDash authored Nov 6, 2024
2 parents 66d666f + bfa2514 commit 8758def
Show file tree
Hide file tree
Showing 24 changed files with 145 additions and 253 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/rworkflows_nomeme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: rworkflows_nomeme
'on':
push:
branches:
- master
- main
- devel
- RELEASE_**
- '*'
- '!gh-pages'
pull_request:
branches:
- master
- main
- devel
- RELEASE_**
- '*'
- '!gh-pages'
jobs:
rworkflows:
permissions: write-all
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
container: ${{ matrix.config.cont }}
strategy:
fail-fast: ${{ false }}
matrix:
config:
- os: ubuntu-latest
bioc: devel
r: auto
cont: bioconductor/bioconductor_docker:devel # No MEME Suite install
rspm: https://packagemanager.rstudio.com/cran/__linux__/focal/release
- os: macOS-latest
r: latest
bioc: release
steps:
- uses: HDash/rworkflows@master
with:
run_bioccheck: ${{ true }}
run_rcmdcheck: ${{ true }}
as_cran: ${{ true }}
run_vignettes: ${{ true }}
has_testthat: ${{ true }}
run_covr: ${{ false }}
run_pkgdown: ${{ false }}
has_runit: ${{ false }}
has_latex: ${{ false }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run_docker: ${{ false }}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: MotifPeeker
Title: Benchmarking Epigenomic Profiling Methods Using Motif Enrichment
Version: 0.99.7
Version: 0.99.8
Authors@R: c(
person(given = "Hiranyamaya",
family = "Dash",
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export(get_df_distances)
export(get_df_enrichment)
export(motif_enrichment)
export(motif_similarity)
export(plot_enrichment_overall)
export(read_motif_file)
export(read_peak_file)
export(save_peak_file)
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# MotifPeeker 0.99.8

## Miscellaneous

* Optimise examples and remove `\donttest{}` blocks.
* Add GitHub Actions for rworkflows without MEME Suite.


# MotifPeeker 0.99.7

## New Features
Expand Down
5 changes: 1 addition & 4 deletions R/MotifPeeker.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@
#' package = "MotifPeeker")
#' )
#'
#' \donttest{
#' if (memes::meme_is_installed()) {
#' # MotifPeeker takes time to run
#' if (memes::meme_is_installed()) {
#' MotifPeeker(
#' peak_files = peaks,
#' reference_index = 1,
Expand All @@ -173,7 +171,6 @@
#' quiet = TRUE,
#' verbose = FALSE
#' )
#' }
#' }
#'
#' @export
Expand Down
6 changes: 4 additions & 2 deletions R/denovo_motifs.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
#' genome_build <- BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
#'
#' res <- denovo_motifs(list(CTCF_TIP_peaks),
#' trim_seq_width = 100,
#' trim_seq_width = 50,
#' genome_build = genome_build,
#' denovo_motifs = 2,
#' denovo_motifs = 1,
#' filter_n = 6,
#' minw = 8,
#' maxw = 8,
#' out_dir = tempdir())
#' print(res[[1]]$consensus)
#' }
Expand Down
12 changes: 5 additions & 7 deletions R/find_motifs.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,23 @@
#' @inherit memes::runTomTom return
#'
#' @examples
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' if (memes::meme_is_installed()) {
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#'
#' \donttest{
#' if (memes::meme_is_installed()) {
#' if (requireNamespace("BSgenome.Hsapiens.UCSC.hg38", quietly = TRUE)) {
#' genome_build <-
#' BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
#'
#' res <- denovo_motifs(list(CTCF_TIP_peaks),
#' trim_seq_width = 100,
#' trim_seq_width = 50,
#' genome_build = genome_build,
#' denovo_motifs = 2,
#' filter_n = 6,
#' denovo_motifs = 1,
#' filter_n = 10,
#' out_dir = tempdir())
#' res2 <- find_motifs(res, motif_db = get_JASPARCORE(),
#' out_dir = tempdir())
#' print(res2)
#' }
#' }
#' }
#'
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/get_df_distances.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ get_df_distances <- function(result,
exp_label = exp_label_combinations[i],
exp_type = exp_type_combinations[i],
motif_indice = rep(seq_len(motif_len), result_len)[i],
distance = MotifPeeker::summit_to_motif(
distance = summit_to_motif(
peak, motif,
genome_build = genome_build,
out_dir = file.path(out_dir, "fimo", i),
Expand Down
38 changes: 18 additions & 20 deletions R/get_df_enrichment.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,24 @@
#'
#' @examples
#' if (memes::meme_is_installed()) {
#' data("CTCF_ChIP_peaks", package = "MotifPeeker")
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("motif_MA1102.3", package = "MotifPeeker")
#' data("motif_MA1930.2", package = "MotifPeeker")
#' input <- list(
#' peaks = list(CTCF_ChIP_peaks, CTCF_TIP_peaks),
#' exp_type = c("ChIP", "TIP"),
#' exp_labels = c("CTCF_ChIP", "CTCF_TIP"),
#' read_count = c(150, 200),
#' peak_count = c(100, 120)
#' )
#' segregated_input <- segregate_seqs(input$peaks[[1]], input$peaks[[2]])
#' motifs <- list(
#' motifs = list(motif_MA1930.2, motif_MA1102.3),
#' motif_labels = list("MA1930.2", "MA1102.3")
#' )
#' reference_index <- 1
#' data("CTCF_ChIP_peaks", package = "MotifPeeker")
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("motif_MA1102.3", package = "MotifPeeker")
#' data("motif_MA1930.2", package = "MotifPeeker")
#' input <- list(
#' peaks = list(CTCF_ChIP_peaks, CTCF_TIP_peaks),
#' exp_type = c("ChIP", "TIP"),
#' exp_labels = c("CTCF_ChIP", "CTCF_TIP"),
#' read_count = c(150, 200),
#' peak_count = c(100, 120)
#' )
#' segregated_input <- segregate_seqs(input$peaks[[1]], input$peaks[[2]])
#' motifs <- list(
#' motifs = list(motif_MA1930.2, motif_MA1102.3),
#' motif_labels = list("MA1930.2", "MA1102.3")
#' )
#' reference_index <- 1
#'
#' \donttest{
#' if (requireNamespace("BSgenome.Hsapiens.UCSC.hg38")) {
#' genome_build <-
#' BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
Expand All @@ -56,7 +55,6 @@
#' )
#' }
#' }
#' }
#'
#' @family generate data.frames
#'
Expand Down Expand Up @@ -89,7 +87,7 @@ get_df_enrichment <- function(result,
function(i) {
peak <- peak_combinations[[i]]
motif <- motif_combinations[[i]]
res <- MotifPeeker::motif_enrichment(
res <- motif_enrichment(
peak, motif,
genome_build = genome_build,
out_dir = file.path(out_dir, "ame_all", i),
Expand Down
15 changes: 7 additions & 8 deletions R/motif_enrichment.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,23 @@
#' @importFrom memes runAme
#' @importFrom utils read.table
#'
#' @returns A list containing a FIMO results data frame and a numeric referring
#' @returns A list containing a AME results data frame and a numeric referring
#' to the proportion of peaks with a motif.
#'
#' @examples
#' if (memes::meme_is_installed()) {
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("motif_MA1102.3", package = "MotifPeeker")
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("motif_MA1102.3", package = "MotifPeeker")
#'
#' \donttest{
#' res <- motif_enrichment(
#' peak_input = CTCF_TIP_peaks,
#' motif = motif_MA1102.3,
#' genome_build =
#' BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
#' BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38,
#'
#' )
#' print(res)
#' }
#' }
#'
#' @seealso \code{\link[memes]{runAme}}
#'
Expand Down Expand Up @@ -66,8 +65,8 @@ motif_enrichment <- function(peak_input,
peak_sequences <- BSgenome::getSeq(genome_build, peak_input)

## Generate 0-order background model from the input sequences
bfile <- markov_background_model(sequences = peak_sequences,
out_dir = out_dir)
# bfile <- markov_background_model(sequences = peak_sequences,
# out_dir = out_dir)
ame_out <- memes::runAme(peak_sequences,
database = list(motif),
outdir = out_dir,
Expand Down
12 changes: 6 additions & 6 deletions R/motif_similarity.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@
#'
#' @examples
#' if (memes::meme_is_installed()) {
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("CTCF_ChIP_peaks", package = "MotifPeeker")
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("CTCF_ChIP_peaks", package = "MotifPeeker")
#'
#' \donttest{
#' if (requireNamespace("BSgenome.Hsapiens.UCSC.hg38")) {
#' genome_build <-
#' BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
#' segregated_peaks <- segregate_seqs(CTCF_TIP_peaks, CTCF_ChIP_peaks)
#' denovo_motifs <- denovo_motifs(unlist(segregated_peaks),
#' trim_seq_width = 100,
#' trim_seq_width = 50,
#' genome_build = genome_build,
#' denovo_motifs = 2,
#' denovo_motifs = 1,
#' filter_n = 6,
#' maxw = 8,
#' minw = 8,
#' out_dir = tempdir())
#' similarity_matrices <- motif_similarity(denovo_motifs)
#' print(similarity_matrices)
#' }
#' }
#' }
#'
#' @export
motif_similarity <- function(streme_out,
Expand Down
38 changes: 0 additions & 38 deletions R/plot_enrichment_individual.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,6 @@
#' \code{html_tags} is \code{TRUE}, the function returns a \code{tagList} object
#' instead.
#'
#' @examples
#' data("CTCF_ChIP_peaks", package = "MotifPeeker")
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("motif_MA1102.3", package = "MotifPeeker")
#' data("motif_MA1930.2", package = "MotifPeeker")
#' input <- list(
#' peaks = list(CTCF_ChIP_peaks, CTCF_TIP_peaks),
#' exp_type = c("ChIP", "TIP"),
#' exp_labels = c("CTCF_ChIP", "CTCF_TIP"),
#' read_count = c(150, 200),
#' peak_count = c(100, 120)
#' )
#' segregated_input <- segregate_seqs(input$peaks[[1]], input$peaks[[2]])
#' motifs <- list(
#' motifs = list(motif_MA1930.2, motif_MA1102.3),
#' motif_labels = list("MA1930.2", "MA1102.3")
#' )
#'
#' \donttest{
#' if (requireNamespace("BSgenome.Hsapiens.UCSC.hg38") &&
#' memes::meme_is_installed()) {
#' genome_build <-
#' BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
#' enrichment_df <- get_df_enrichment(
#' input, segregated_input, motifs, genome_build,
#' reference_index = 1
#' )
#' label_colours <- c("red", "cyan")
#'
#' plt <- MotifPeeker:::plot_enrichment_individual(
#' input, enrichment_df, comparison_i = 2, motif_i = 1,
#' label_colours = label_colours, reference_index = 1,
#' html_tags = FALSE
#' )
#' print(plt)
#' }
#' }
#'
#' @family plot functions
#'
#' @keywords internal
Expand Down
40 changes: 1 addition & 39 deletions R/plot_enrichment_overall.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,9 @@
#' \item{\code{$perc_plt}}{y-axis represents the percentage of peaks.}
#' }
#'
#' @examples
#' data("CTCF_ChIP_peaks", package = "MotifPeeker")
#' data("CTCF_TIP_peaks", package = "MotifPeeker")
#' data("motif_MA1102.3", package = "MotifPeeker")
#' data("motif_MA1930.2", package = "MotifPeeker")
#' input <- list(
#' peaks = list(CTCF_ChIP_peaks, CTCF_TIP_peaks),
#' exp_type = c("ChIP", "TIP"),
#' exp_labels = c("CTCF_ChIP", "CTCF_TIP"),
#' read_count = c(150, 200),
#' peak_count = c(100, 120)
#' )
#' segregated_input <- segregate_seqs(input$peaks[[1]], input$peaks[[2]])
#' motifs <- list(
#' motifs = list(motif_MA1930.2, motif_MA1102.3),
#' motif_labels = list("MA1930.2", "MA1102.3")
#' )
#'
#' \donttest{
#' if (requireNamespace("BSgenome.Hsapiens.UCSC.hg38") &&
#' memes::meme_is_installed()) {
#' genome_build <-
#' BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
#' enrichment_df <- get_df_enrichment(
#' input, segregated_input, motifs, genome_build,
#' reference_index = 1
#' )
#' label_colours <- c("red", "cyan")
#'
#' plt <- plot_enrichment_overall(
#' enrichment_df, motif_i = 1, label_colours = label_colours,
#' reference_label = "CTCF_ChIP", html_tags = FALSE
#' )
#' print(plt$count_plot)
#' print(plt$perc_plot)
#' }
#' }
#'
#' @family plot functions
#'
#' @export
#' @keywords internal
plot_enrichment_overall <- function(enrichment_df,
motif_i,
label_colours,
Expand Down
2 changes: 1 addition & 1 deletion R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ use_cache <- function(url, verbose = FALSE) {
#' @keywords internal
check_duplicates <- function(x) {
stp_msg <- paste("Duplicated items found in the label list. Please input",
"unique experiment and motif labels.")
"unique experiment and motif labels.")
if (any(duplicated(x))) {
stop(stp_msg)
}
Expand Down
Loading

0 comments on commit 8758def

Please sign in to comment.