Entering edit mode
I am unable to run the learn.bn function from Pigengene on my local windows system. I am reproducing the process outline in the PDF guide of pigengene.
The problem seem to be the sub-function which.cluster() which uses system("echo $HOSTNAME", intern = TRUE) which will not work on a windows os. using the r based sys.info() function instead might work, but I do not know how to make this change or find a github repository to submit a pull request. Is there a way to fix this?
See code and environment below.
learnt <- learn.bn(
pigengene = pigengene,
bnPath = file.path(saveDir, "bn"),
bnNum = 10,
seed = 1,
verbose = 4,
onCluster = FALSE
)
learn.bn() with bnNum= 10 started at:
2024-12-13 14:24:37.574856
Start learning 10 BNs for module E using hc
moduleFile:
steps/bn/modE/moduleEH1.RData
Tracing system("echo $HOSTNAME", intern = TRUE) on entry
[[1]]
learn.bn(pigengene = pigengene, bnPath = file.path(saveDir, "bn"),
bnNum = 10, seed = 1, verbose = 4, onCluster = FALSE)
[[2]]
bn.module(resultPath = bnPath, saveToPath = indvPath, moduleNum = moduleNum,
use.Hartemink = use.Hartemink, bnNum = bnNum, perJob = perJob,
use.Effect = use.Effect, use.Disease = use.Disease, dummies = dummies,
pertFrac = pertFrac, scoring = scoring, Data = Data, Labels = Labels,
bnStartFile = bnStartFile, selectedFeatures = selectedFeatures,
bnCalculationJob = bnCalculationJob, timeJob = timeJob, algo = algo,
seed = seed, verbose = verbose - 1, partition = NULL, maxSeconds = maxSeconds,
moduleFile = moduleFile, doShuffle = doShuffle, naTolerance = naTolerance)
[[3]]
which.cluster()
[[4]]
grep(x = system("echo $HOSTNAME", intern = TRUE), pattern = "stampede")
[[5]]
is.factor(x)
[[6]]
system("echo $HOSTNAME", intern = TRUE)
[[7]]
.doTrace(print(sys.calls()), "on entry")
[[8]]
eval.parent(exprObj)
[[9]]
eval(expr, p)
[[10]]
eval(expr, p)
Error in system("echo $HOSTNAME", intern = TRUE) : 'echo' not found
sessionInfo()
R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22621)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C LC_TIME=English_United States.utf8
time zone: America/Indianapolis
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bnlearn_5.0.1 Pigengene_1.30.0 BiocStyle_2.32.1 graph_1.82.0 BiocGenerics_0.50.0
loaded via a namespace (and not attached):
[1] libcoin_1.0-10 RColorBrewer_1.1-3 rstudioapi_0.17.1 jsonlite_1.8.9 magrittr_2.0.3
[6] farver_2.1.2 rmarkdown_2.29 fs_1.6.5 zlibbioc_1.50.0 vctrs_0.6.5
[11] memoise_2.0.1 base64enc_0.1-3 ggtree_3.12.0 htmltools_0.5.8.1 dynamicTreeCut_1.63-1
[16] gridGraphics_0.5-1 Formula_1.2-5 htmlwidgets_1.6.4 plyr_1.8.9 httr2_1.0.7
[21] impute_1.78.0 cachem_1.1.0 igraph_2.1.2 iterators_1.0.14 lifecycle_1.0.4
[26] pkgconfig_2.0.3 gson_0.1.0 Matrix_1.7-1 R6_2.5.1 fastmap_1.2.0
[31] GenomeInfoDbData_1.2.12 digest_0.6.37 aplot_0.2.3 enrichplot_1.24.4 colorspace_2.1-1
[36] patchwork_1.3.0 AnnotationDbi_1.66.0 S4Vectors_0.42.1 Hmisc_5.2-1 RSQLite_2.3.9
[41] fansi_1.0.6 gdata_3.0.1 httr_1.4.7 polyclip_1.10-7 compiler_4.4.2
[46] doParallel_1.0.17 bit64_4.5.2 withr_3.0.2 backports_1.5.0 htmlTable_2.4.3
[51] graphite_1.50.0 BiocParallel_1.38.0 viridis_0.6.5 DBI_1.2.3 ggforce_0.4.2
[56] R.utils_2.12.3 MASS_7.3-61 rappdirs_0.3.3 gtools_3.9.5 tools_4.4.2
[61] foreign_0.8-87 scatterpie_0.2.4 ape_5.8 zip_2.3.1 nnet_7.3-19
[66] R.oo_1.27.0 glue_1.8.0 nlme_3.1-166 GOSemSim_2.30.2 inum_1.0-5
[71] shadowtext_0.1.4 grid_4.4.2 checkmate_2.3.2 cluster_2.1.6 Cubist_0.4.4
[76] reshape2_1.4.4 fgsea_1.30.0 generics_0.1.3 gtable_0.3.6 preprocessCore_1.66.0
[81] R.methodsS3_1.8.2 tidyr_1.3.1 WGCNA_1.73 data.table_1.16.4 tidygraph_1.3.1
[86] utf8_1.2.4 XVector_0.44.0 foreach_1.5.2 ggrepel_0.9.6 pillar_1.9.0
[91] stringr_1.5.1 yulab.utils_0.1.8 partykit_1.2-23 splines_4.4.2 dplyr_1.1.4
[96] tweenr_2.0.3 treeio_1.28.0 lattice_0.22-6 survival_3.7-0 bit_4.5.0.1
[101] tidyselect_1.2.1 GO.db_3.19.1 Biostrings_2.72.1 reactome.db_1.88.0 knitr_1.49
[106] gridExtra_2.3 C50_0.1.8 IRanges_2.38.1 stats4_4.4.2 xfun_0.49
[111] graphlayouts_1.2.1 Biobase_2.64.0 matrixStats_1.4.1 pheatmap_1.0.12 stringi_1.8.4
[116] UCSC.utils_1.0.0 lazyeval_0.2.2 ggfun_0.1.8 yaml_2.3.10 ReactomePA_1.48.0
[121] evaluate_1.0.1 codetools_0.2-20 ggraph_2.2.1 tibble_3.2.1 qvalue_2.36.0
[126] Rgraphviz_2.48.0 BiocManager_1.30.25 ggplotify_0.1.2 cli_3.6.3 rpart_4.1.23
[131] munsell_0.5.1 Rcpp_1.0.13-1 GenomeInfoDb_1.40.1 png_0.1-8 fastcluster_1.2.6
[136] parallel_4.4.2 ggplot2_3.5.1 blob_1.2.4 clusterProfiler_4.12.6 DOSE_3.30.5
[141] tidytree_0.4.6 viridisLite_0.4.2 mvtnorm_1.3-2 scales_1.3.0 openxlsx_4.2.7.1
[146] purrr_1.0.2 crayon_1.5.3 rlang_1.1.4 cowplot_1.1.3 fastmatch_1.1-4
[151] KEGGREST_1.44.1
Any help will be greatly appreciated!