Created
October 1, 2023 00:08
-
-
Save vjcitn/bb1770a715344f2200e65e24aa114da9 to your computer and use it in GitHub Desktop.
code in this gist attempts to prepare R to identify causes of CHECK_SUGGESTS_ONLY errors
This file contains hidden or 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
stopifnot(Sys.getenv("_R_CHECK_SUGGESTS_ONLY_") == "true") | |
# these error in check on nebbiolo2 but not lconway | |
suggposs = c("AffyRNADegradation", "alabaster.spatial", "ANF", "animalcules", | |
"BDMMAcorrect", "bnbc", "CancerSubtypes", "ccrepe", "CDI", "cellscape", | |
"ClassifyR", "CNVgears", "CoGAPS", "compartmap", "CoRegNet", | |
"crisprseekplus", "DEWSeq", "DEXSeq", "DMCFB", "dpeak", "DSS", | |
"EasyCellType", "eegc", "EGSEA", "EpiCompare", "exomePeak2", | |
"farms", "FCBF", "flowMap", "FoldGO", "FScanR", "GCSscore", "GenomicFeatures", | |
"GEOmetadb", "GEOquery", "gscreend", "HelloRanges", "ILoReg", | |
"Informeasure", "IRISFGM", "Linnorm", "logitT", "maigesPack", | |
"MEAL", "MetaVolcanoR", "methrix", "miRBaseConverter", "miRmine", | |
"mixOmics", "MSstatsSampleSize", "multiOmicsViz", "NeighborNet", | |
"netDx", "NeuCA", "oneSENSE", "ontoProc", "orthos", "pathVar", | |
"PERFect", "proteasy", "pwrEWAS", "RCAS", "RcisTarget", "Rcollectl", | |
"RCSL", "ReactomeGSA", "RefPlus", "RegEnrich", "rexposome", "RIPAT", | |
"rtracklayer", "SCATE", "SEPIRA", "SISPA", "sparseDOSSA", "sscore", | |
"STROMA4", "trena") | |
ii = rownames(installed.packages()) | |
getsrc = function(x) { | |
z = tryCatch( | |
BiocManager::install(x, dependencies=TRUE, ask=FALSE, update=TRUE), | |
warning = function(cond) cond) # purpose is to get dependencies before check | |
if (inherits(z, "simpleWarning")) { | |
chk = grep("is not available", z$message) | |
if (length(chk)==0) stop(sprintf("atypical condition for BiocManager::install for %s")) | |
message("trying a download.packages from BiocManager::repositories") | |
download.packages(x, dest=".", repos=BiocManager::repositories()) | |
if (!file.exists(x)) { # didn't work, use git | |
message("trying git") | |
system(sprintf("git clone https://git.bioconductor.org/packages/%s", x)) | |
} | |
} | |
if (file.exists(x)) system(sprintf("R CMD build %s", x)) | |
else stop("could not get a source folder to build") | |
} | |
ind = 22 | |
# prepare R | |
library(BiocPkgTools) | |
bb = buildPkgDependencyDataFrame() | |
library(dplyr) | |
ndf = bb |> filter(Package == suggposs[ind]) |> select(dependency) |> as.data.frame() | |
toget = setdiff(ndf$dependency, ii) | |
BiocManager::install(toget) | |
getsrc(suggposs[ind]) | |
system(paste0("R CMD check ", dir(patt=paste0(suggposs[ind], "_")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment