-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ee2e1e
commit 38b0171
Showing
18 changed files
with
186 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
^\.Rproj\.user$ | ||
^\.travis\.yml$ | ||
^check\.R$ | ||
^\.github$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. | ||
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
name: R-CMD-check-plus | ||
|
||
jobs: | ||
R-CMD-check-plus: | ||
runs-on: macOS-latest | ||
|
||
name: ${{ matrix.config.check }} ${{ matrix.config.file }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {check: "checkRawFiles", file: "gene_expression_files"} | ||
- {check: "checkRawFiles", file: "gene_expression_matrices"} | ||
- {check: "checkRawFiles", file: "fcs_control_files"} | ||
- {check: "checkRawFiles", file: "fcs_sample_files"} | ||
- {check: "checkRawFiles", file: "protocols"} | ||
- {check: "checkStudyCompliance"} | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
ISR_login: ${{ secrets.ISR_login }} | ||
ISR_pwd: ${{ secrets.ISR_pwd }} | ||
|
||
steps: | ||
- name: Set environment for branch | ||
run: | | ||
if [[ $GITHUB_REF == "refs/heads/master" ]]; then | ||
echo "ISR_machine=www.immunespace.org" >> "$GITHUB_ENV" | ||
else | ||
echo "ISR_machine=test.immunespace.org" >> "$GITHUB_ENV" | ||
fi | ||
shell: bash | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
|
||
- uses: r-lib/actions/setup-pandoc@v1 | ||
|
||
- name: Query dependencies | ||
run: | | ||
install.packages('remotes') | ||
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} | ||
|
||
- name: Cache R packages | ||
if: runner.os != 'Windows' | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- | ||
|
||
- name: Install dependencies | ||
run: | | ||
remotes::install_deps(dependencies = TRUE) | ||
remotes::install_cran("rcmdcheck") | ||
shell: Rscript {0} | ||
|
||
- name: R CMD check | ||
env: | ||
_R_CHECK_CRAN_INCOMING_REMOTE_: false | ||
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") | ||
shell: Rscript {0} | ||
|
||
- name: Check | ||
run: | | ||
labkey.netrc.file <- ImmuneSpaceR:::.get_env_netrc() | ||
labkey.url.base <- ImmuneSpaceR:::.get_env_url() | ||
ImmuneSpaceMaintenance::check("{{ matrix.config.check }}", "{{ matrix.config.file }}") | ||
shell: Rscript {0} | ||
|
||
- name: Upload check results | ||
if: failure() | ||
uses: actions/upload-artifact@main | ||
with: | ||
name: ${{ matrix.config.check }}-r${{ matrix.config.file }}-results | ||
path: check |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: ImmuneSpaceMaintenance | ||
Title: Utility Package for ImmuneSpace Maintenance | ||
Version: 0.0.0.9000 | ||
Version: 0.0.1 | ||
Authors@R: | ||
person("ImmuneSpace Maintainer", | ||
email = "[email protected]", | ||
|
@@ -15,11 +15,14 @@ Imports: | |
Rlabkey, | ||
rjson, | ||
parallel, | ||
httr | ||
httr, | ||
testthat | ||
Remotes: | ||
RGLab/ImmuneSpaceR | ||
License: GPL-2 | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.1.1 | ||
RoxygenNote: 7.1.1 | ||
Collate: | ||
'ISM.R' | ||
'ISM-checkExpressionSet.R' | ||
|
@@ -29,3 +32,4 @@ Collate: | |
'ISM-checkStudyCompliance.R' | ||
'ISM-removeOrphanGEMs.R' | ||
'ISM-utils.R' | ||
'check.R' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#' @import ImmuneSpaceR data.table | ||
#' @importFrom testthat capture_messages | ||
#' @export | ||
check <- function(check_type, file_type, batch = "") { | ||
con <- ISM$new("") | ||
|
||
if (check_type == "checkStudyCompliance") { | ||
msg <- testthat::capture_messages( | ||
res <- con$checkStudyCompliance() | ||
) | ||
|
||
# Remove studies with known GEM issues that are not fixable at the moment | ||
badGE <- c( | ||
"SDY74", | ||
"SDY314", | ||
"SDY789", | ||
"SDY820", | ||
"SDY903", | ||
"SDY1092", | ||
"SDY1361" | ||
) | ||
res <- res[ !names(res) %in% badGE ] | ||
|
||
if (length(res) > 0) { | ||
dt <- as.data.table(do.call(rbind, res)) | ||
dt[, study := names(res)] | ||
setcolorder(dt, c("study", "modules")) | ||
print(dt[]) | ||
|
||
stop( | ||
"\n", | ||
length(res), " studies are not compliant: ", | ||
paste(names(res), collapse = ", "), | ||
"\n", | ||
msg | ||
) | ||
} | ||
|
||
} else if (check_type == "checkRawFiles" & file_type != "") { | ||
msg <- testthat::capture_messages( | ||
res <- con$checkRawFiles(file_type = file_type, | ||
mc.cores = 1, # > 1 cores generates errors | ||
batch = batch) | ||
) | ||
|
||
if (sum(!res$file_exists) > 0) { | ||
res <- res[!res$file_exists, c("study_accession", "file_info_name")] | ||
res <- res[ , list(files_missing = .N), by = study_accession] | ||
print(res) | ||
stop("Please download studies above!") | ||
} | ||
print(msg[1]) | ||
|
||
} else if (check_type == "checkPublicVsStudySchema"){ | ||
msg <- testthat::capture_messages( | ||
res <- con$checkPublicVsStudySchema() | ||
) | ||
if (any(lengths(res)) > 0){ | ||
res <- res[ lengths(res) > 0 ] | ||
print(res) | ||
stop(msg) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
# Initialize an ISM connection | ||
# ImmuneSpace Maintenance Tasks | ||
|
||
```R | ||
<!-- badges: start --> | ||
[](https://github.com/RGLab/ImmuneSpaceMaintenance/actions) | ||
<!-- badges: end --> | ||
|
||
## Installation | ||
|
||
``` r | ||
# install.packages("remotes") | ||
remotes::install_github("ImmuneSpaceMaintenance") | ||
``` | ||
|
||
## Initialize an `ISM` connection | ||
|
||
``` r | ||
library(ImmuneSpaceMaintenance) | ||
con <- ISM$new(study = "", onTest = TRUE) | ||
``` |
Oops, something went wrong.