Skip to content

Commit

Permalink
Merge pull request #160 from jr-leary7/dev
Browse files Browse the repository at this point in the history
still trying to resolve CI/CD issues ugh
  • Loading branch information
jr-leary7 authored Nov 13, 2023
2 parents 6d90040 + 72f63c5 commit 9b95c33
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 25 deletions.
50 changes: 42 additions & 8 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Additional formatting taken from: https://github.com/r-lib/actions/blob/v2-branch/check-r-package/action.yaml

on:
push:
Expand All @@ -25,23 +26,56 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
- name: Checkout repo
uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
- name: Setup Pandoc
uses: r-lib/actions/setup-pandoc@v2

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
- name: Setup dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
- name: Check
id: rcmdcheck
run: |
## --------------------------------------------------------------------
options(crayon.enabled = TRUE)
cat("check-dir-path=", file.path(getwd(), "check"), "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
check_results <- rcmdcheck::rcmdcheck(args = c("--no-vignettes", "--no-manual", "--as-cran"), build_args = c("--no-build-vignettes", "--no-manual"), check_dir = "check", error_on = "error")
shell: Rscript {0}
working-directory: '.'

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
echo ::group::Show testthat output
find check -name 'testthat.Rout*' -exec cat '{}' \; || true
echo ::endgroup::
shell: bash
working-directory: '.'

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: ${{ steps.rcmdcheck.outputs.check-dir-path }}

- name: Upload snapshots
uses: actions/upload-artifact@v3
with:
upload-snapshots: true
args: 'c("--ignore-vignettes", "--no-manual")'
build_args: 'c("--no-build-vignettes")'
name: ${{ runner.os }}-r${{ matrix.config.r }}-testthat-snapshots
path: ${{ steps.rcmdcheck.outputs.check-dir-path }}/**/tests*/testthat/_snaps
if-no-files-found: ignore
4 changes: 2 additions & 2 deletions .github/workflows/bioc-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
push:
branches: main

name: bioc-check
name: Bioc-check

jobs:
bioc-check:
runs-on: macos-latest
name: BiocCheck
name: Bioc-check
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
runs-on: macos-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

Expand Down
10 changes: 5 additions & 5 deletions R/GetResultsDE.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#'
#' @name getResultsDE
#' @author Jack Leary
#' @description This function turns the nested list differential expression results of \code{\link{testDynamic}} and turns them into a tidy \code{data.frame}.
#' @description This function turns the nested list differential expression results of \code{\link{testDynamic}} and turns them into a tidy data.frame.
#' @import magrittr
#' @importFrom purrr map_dfr
#' @importFrom dplyr arrange desc mutate across if_else with_groups relocate
#' @importFrom tidyselect everything
#' @importFrom stats p.adjust p.adjust.methods
#' @param test.dyn.res The nested list returned by \code{\link{testDynamic}}. Defaults to NULL.
#' @param p.adj.method (Optional) The method used to adjust \emph{p}-values for multiple hypothesis testing. Defaults to "holm".
#' @param fdr.cutoff (Optional) The FDR threshold for determining statistical significance. Defaults to 0.01.
#' @return A data.frame containing differential expression results & modeling statistics for each gene.
#' @param p.adj.method The method used to adjust \emph{p}-values for multiple hypothesis testing. Defaults to "holm".
#' @param fdr.cutoff The FDR threshold for determining statistical significance. Defaults to 0.01.
#' @return A data.frame containing differential expression results & test statistics for each gene.
#' @export
#' @seealso \code{\link{testDynamic}}
#' @seealso \code{\link[stats]{p.adjust}}
Expand All @@ -34,7 +34,7 @@ getResultsDE <- function(test.dyn.res = NULL,
dplyr::mutate(dplyr::across(tidyselect::everything(), \(z) unname(unlist(z))))
})
}) %>%
dplyr::arrange(P_Val, dplyr::desc(Test_Stat)) %>%
dplyr::arrange(dplyr::desc(Test_Stat)) %>%
dplyr::mutate(P_Val_Adj = stats::p.adjust(P_Val, method = p.adj.method),
Gene_Dynamic_Lineage = dplyr::if_else(P_Val_Adj < fdr.cutoff, 1, 0, missing = 0)) %>%
dplyr::with_groups(Gene,
Expand Down
6 changes: 3 additions & 3 deletions R/testSlope.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#' @importFrom dplyr arrange desc mutate if_else with_groups
#' @importFrom stats p.adjust
#' @param test.dyn.res The list returned by \code{\link{testDynamic}} - no extra processing required. Defaults to NULL.
#' @param p.adj.method The method used to adjust the \emph{p}-values for each slope. Defaults to "holm".
#' @param p.adj.method The method used to adjust the \emph{p}-values for each coefficient. Defaults to "holm".
#' @param fdr.cutoff The FDR threshold for determining statistical significance. Defaults to 0.01.
#' @return A dataframe containing the genes, breakpoints, and slope \emph{p}-values from each model.
#' @return A dataframe containing the genes, breakpoints, and coefficient \emph{p}-values from each model.
#' @seealso \code{\link{testDynamic}}
#' @seealso \code{\link[stats]{p.adjust}}
#' @export
Expand All @@ -25,7 +25,7 @@ testSlope <- function(test.dyn.res = NULL,
if (is.null(test.dyn.res)) { stop("You forgot to provide results from testDynamic() to testSlope().") }
# create table of results
slope_df <- purrr::map_dfr(test.dyn.res, \(x) purrr::map_dfr(x, \(y) data.frame(y["MARGE_Slope_Data"][[1]]))) %>%
dplyr::arrange(P_Val, dplyr::desc(abs(Test_Stat))) %>%
dplyr::arrange(dplyr::desc(abs(Test_Stat))) %>%
dplyr::mutate(P_Val_Adj = stats::p.adjust(P_Val, method = p.adj.method)) %>%
dplyr::arrange(Gene, Breakpoint) %>%
dplyr::mutate(Gene_Dynamic_Lineage_Slope = dplyr::if_else(P_Val_Adj < fdr.cutoff, 1, 0, missing = 0)) %>%
Expand Down
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ knitr::opts_chunk$set(warning = FALSE,

<!-- badges: start -->
[![R-CMD-check](https://github.com/jr-leary7/scLANE/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jr-leary7/scLANE/actions/workflows/R-CMD-check.yaml)
[![Bioc-check](https://github.com/jr-leary7/scLANE/actions/workflows/bioc-check.yaml/badge.svg)](https://github.com/jr-leary7/scLANE/actions/workflows/bioc-check.yaml)
![release](https://img.shields.io/github/v/release/jr-leary7/scLANE?color=purple)
![last commit](https://img.shields.io/github/last-commit/jr-leary7/scLANE/main?color=darkgreen)
[![codecov](https://codecov.io/gh/jr-leary7/scLANE/branch/main/graph/badge.svg?token=U2U5RTF2VW)](https://codecov.io/gh/jr-leary7/scLANE)
Expand Down
8 changes: 4 additions & 4 deletions man/getResultsDE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/testSlope.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b95c33

Please sign in to comment.