A number of bioinformatic R packages allow us to specify the no. of threads (k) in the server. I am using the wTO package https://cran.r-project.org/web/packages/wTO/index.html
used for construction of correlation networks which uses the library(parallel) for using multiple threads. I am running the following function:
x= wTO.Complete(k = 32, n = 100, Data, Overlap, method = "p", method_resampling = "Bootstrap", pvalmethod = "BH", savecor = F, expected.diff = 0.2, lag = NULL, normalize = F, plot = T)
Here, k=32 for a CentOS server. While using the package, I am getting the error:
Error in unserialize(node$con) : error reading from connection
The developer of the package told me its due to an open connection with the cluster and was not properly closed, and asked me to run the following piece of code.
require(parallel) cl <- makeCluster(32) stopCluster(cl)
I ran the above and again ran the command for network construction. I still got the error. I will be very grateful if anyone can help me with this.
> sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: CentOS release 6.8 (Final) Matrix products: default BLAS: /usr/lib64/R/lib/libRblas.so LAPACK: /usr/lib64/R/lib/libRlapack.so locale:  LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C  LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8  LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8  LC_PAPER=en_US.UTF-8 LC_NAME=C  LC_ADDRESS=C LC_TELEPHONE=C  LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages:  parallel stats graphics grDevices utils datasets methods  base other attached packages:  wTO_1.6 loaded via a namespace (and not attached):  Rcpp_0.12.12 visNetwork_2.0.3 digest_0.6.12 plyr_1.8.4  jsonlite_1.5 magrittr_1.5 stringi_1.1.5 som_0.3-5.1  reshape2_1.4.2 data.table_1.10.4 tools_3.4.1 stringr_1.2.0  htmlwidgets_0.9 igraph_1.2.1 compiler_3.4.1 pkgconfig_2.0.1  htmltools_0.3.6