@@ -25,6 +25,18 @@ for mod in mods:
2525 __import__(mod)
2626PY
2727
28+ test -x " ${DNMB_PROMOTECH_PYTHON} "
29+ " ${DNMB_PROMOTECH_PYTHON} " - << 'PY '
30+ import joblib
31+ import numpy
32+ import pandas
33+ import progressbar
34+ import sklearn
35+ from Bio import SeqIO
36+
37+ assert sklearn.__version__.startswith("0.23"), sklearn.__version__
38+ PY
39+
2840Rscript - << 'RS '
2941required <- c(
3042 "DNMB", "dplyr", "ggplot2", "ggtext", "openxlsx",
@@ -47,6 +59,22 @@ if (any(promotech_bad)) {
4759 )
4860}
4961
62+ promotech_python <- DNMB:::.dnmb_promotech_resolve_python("python3")
63+ promotech_model <- file.path(
64+ Sys.getenv("DNMB_CACHE_ROOT"),
65+ "db_modules", "promotech", "current", "Promotech", "models", "RF-HOT.model"
66+ )
67+ if (file.exists(promotech_model)) {
68+ model_load <- DNMB:::dnmb_run_external(
69+ promotech_python,
70+ args = c("-c", "import joblib, sys; joblib.load(sys.argv[1])", promotech_model),
71+ required = FALSE
72+ )
73+ if (!isTRUE(model_load$ok)) {
74+ stop("Promotech model load check failed: ", model_load$error, call. = FALSE)
75+ }
76+ }
77+
5078acr_module <- DNMB:::dnmb_acrfinder_get_module(cache_root = Sys.getenv("DNMB_CACHE_ROOT"), required = TRUE)
5179inherited <- strsplit(Sys.getenv("PATH"), .Platform$path.sep, fixed = TRUE)[[1]]
5280acr_env_python <- if (!is.null(acr_module$files$env_python)) acr_module$files$env_python else ""
0 commit comments