diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 1de52d3..30c9469 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -41,7 +41,8 @@ jobs: - name: Query dependencies run: | - install.packages('remotes') + install.packages('remotes', repos='http://cran.us.r-project.org') + install.packages('rcmdcheck', repos='http://cran.us.r-project.org') saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} @@ -68,26 +69,13 @@ jobs: remotes::install_cran("rcmdcheck") shell: Rscript {0} - - name: Check - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), check_dir = "check") - shell: Rscript {0} - - - name: Check testthat - if: runner.os != 'Windows' - id: check_check - run: | - error_num=$(Rscript --vanilla '.github/workflows/check_testthat.R') - echo "error_num=$error_num" >> $GITHUB_OUTPUT - - - name: Stop if there are errors! - if: ${{ steps.check_check.outputs.error_num != '0' }} - run: exit 1 + - name: Check package + uses: r-lib/actions/check-r-package@v2 + with: + args: 'c("--no-manual")' - name: Upload check results if: failure() uses: actions/upload-artifact@main with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check diff --git a/DESCRIPTION b/DESCRIPTION index 1a81004..94a9aca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,7 +17,7 @@ Authors@R: c( ) ) Description: This package allows a pipeline to be built for analyzing genetic interactions of paired guide CRISPR screens. It is based off of original research from the Alice Berger lab at Fred Hutchinson Cancer Center. -License: GPL-3 +License: GPL-3 + file LICENSE URL: https://github.com/FredHutch/gimap BugReports: https://github.com/FredHutch/gimap/issues Imports: diff --git a/R/06-calculate_gi.R b/R/06-calculate_gi.R index 6fa07b2..477062f 100644 --- a/R/06-calculate_gi.R +++ b/R/06-calculate_gi.R @@ -26,7 +26,7 @@ #' @param .data Data can be piped in with tidyverse pipes from function to function. But the data must still be a gimap_dataset #' @param gimap_dataset A special dataset structure that is setup using the `setup_data()` function. #' @export -#' @examples { +#' @examples \dontrun{ #' gimap_dataset <- get_example_data("gimap") #' #' # Highly recommended but not required diff --git a/R/utils.R b/R/utils.R index 51141e6..9df1ef5 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,5 +1,5 @@ utils::globalVariables(c( - "timepoints", "value", "timepoint_avg", "target_type", + "mean_observed_cs", "timepoints", "value", "timepoint_avg", "target_type", "unexpressed_ctrl_flag", "median", "lfc_adj", "median", "gRNA1_seq", "gRNA2_seq", "control_gRNA_seq", "crispr_score", "pgRNA_target", "mean_double_control_crispr", "pgRNA_target", "targeting_gRNA_seq", "mean_single_crispr", "double_crispr_score", @@ -92,33 +92,6 @@ get_example_data <- function(which_data) { } } -#' @import ggplot2 - -## ggplot themes -## see: https://www.rdocumentation.org/packages/ggplot2/versions/2.1.0/topics/theme_update -## and https://stackoverflow.com/questions/23173915/can-ggplot-theme-formatting-be-saved-as-an-object -plot_theme <- function() { - theme( - axis.text = element_text(colour = "black"), - axis.ticks = element_line(color = "black") - ) -} - -#' @import ggplot2 -plot_options <- function() { - list(theme_bw(base_size = 12)) -} - -#' @import kableExtra -print_kbl <- function(tbl) { - kbl(tbl) %>% - kable_styling( - full_width = FALSE, - position = "left", - bootstrap_options = c("striped", "hover", "responsive") - ) -} - #' Get file path to an default credentials RDS #' @export diff --git a/README.md b/README.md index 237f1bd..aa62317 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ Now you can [go to our quick start tutorial to get started!](https://fredhutch.g We also have tutorial examples that show how to run timepoint or treatment experimental set ups with gimap: - [Timepoint example](https://fredhutch.github.io/gimap/articles/timepoint-example.html) -- [Treatment example](https://fredhutch.github.io/gimap/articles/treatment-example.html) +- [Treatment example](https://fredhutch.github.io/gimap/articles/treatment_example.html) Follow the steps there that will walk you through the example data. Then you can tailor that tutorial to use your own data. diff --git a/man/save_tbl.Rd b/man/save_tbl.Rd deleted file mode 100644 index 4fb78d7..0000000 --- a/man/save_tbl.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{save_tbl} -\alias{save_tbl} -\title{Save tbl} -\usage{ -save_tbl(tbl, out_dir = NULL, params = NULL) -} -\arguments{ -\item{tbl}{a table you want to save} - -\item{out_dir}{the file path you want to save it to} - -\item{params}{any additional parameters needed} -} -\description{ -This function saves table -} diff --git a/tests/testthat/test-gi-calc.R b/tests/testthat/test-gi-calc.R index 0156687..d7ace9b 100644 --- a/tests/testthat/test-gi-calc.R +++ b/tests/testthat/test-gi-calc.R @@ -20,7 +20,7 @@ test_that("Test Genetic Interaction score calculations", { testthat::expect_true(all.equal(gimap_dataset$overall_results$rep, results$rep)) testthat::expect_identical(round(gimap_dataset$overall_results$intercept[1], 3), round(results$intercept[1], 3)) - testthat::expect_identical(round(gimap_dataset$overall_results$rep[1], 3), round(results$rep[1], 3)) + testthat::expect_identical(gimap_dataset$overall_results$rep[1], results$rep[1]) testthat::expect_identical(round(gimap_dataset$gi_scores$mean_expected_cs[1], 3), round(3.691114, 3)) testthat::expect_identical(round(gimap_dataset$gi_scores$mean_observed_cs[1], 3), round(-2.321601, 3))