Hello,
I am trying to figure out if it is possible to use STRINGdb
offline, assuming that all the necessary files have been downloaded locally. I am running
library(STRINGdb)
strdb <- STRINGdb$new(version = "11.5", species = 10090,
score_threshold = 400, input_directory = "~/Desktop/stringdb")
print(strdb) ## this triggers the download of files from STRING to the local directory
strdb$map(data.frame(x = "Sox2"), "x", removeUnmappedRows = FALSE) ## this downloads the alias file and maps the ID
which will download the necessary files. If I then re-execute the mapping or the initialization of the strdb
object, the files will not be re-downloaded. So far, so good.
Now, if I disconnect from the internet and try to re-initialize the object, I get an error as R is not able to open the connection to https://string-db.org/api/tsv-no-header/version:
Error in open.connection(file, "rt") :
cannot open the connection to 'https://string-db.org/api/tsv-no-header/version'
In addition: Warning message:
In open.connection(file, "rt") :
URL 'https://string-db.org/api/tsv-no-header/version': Timeout of 60 seconds was reached
Is there any way that I can force STRINGdb
to use the local files, without checking in with the remote server?
Thanks!
Session info:
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.2.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] STRINGdb_2.10.1
loaded via a namespace (and not attached):
[1] igraph_1.4.1 hash_2.2.6.2 Rcpp_1.0.10 rstudioapi_0.14 magrittr_2.0.3
[6] bit_4.0.5 rlang_1.0.6 fastmap_1.1.1 blob_1.2.3 plyr_1.8.8
[11] caTools_1.18.2 tools_4.2.2 png_0.1-8 plotrix_3.8-2 KernSmooth_2.23-20
[16] cli_3.6.0 DBI_1.1.3 gtools_3.9.4 bit64_4.0.5 RColorBrewer_1.1-3
[21] vctrs_0.5.2 bitops_1.0-7 RCurl_1.98-1.10 cachem_1.0.7 memoise_2.0.1
[26] RSQLite_2.3.0 gsubfn_0.7 compiler_4.2.2 gplots_3.1.3 chron_2.3-59
[31] sqldf_0.4-11 proto_1.0.0 pkgconfig_2.0.3
Yes, makes total sense. In fact what I ultimately want to do is to generate the images, so I'd need the access to the API then anyway. Thanks a lot for the quick and clear reply!