Connection can hold a lot of data in cache. If a lot of work has been done (e.g: lots of downloaded datasets and gene-expression matrices), it can be useful to save the connection for later work or even offline use.

loadConnection(file)

saveConnection(con, file)

Arguments

file

The file name to be saved to or loaded from

con

An ImmuneSpaceConnection. The connection to save to file. To be loaded later using loadConnection.

Value

An ImmuneSpaceConnection object

Examples

# Sample saved connection with pre-downloaded expression matrices and datasets
saved <- system.file("extdata/saved_con.rds", package = "ImmuneSpaceR")
new_con <- loadConnection(saved)
new_con
#> An object of class "ImmuneSpaceConnection"
#> <S4 Type Object>
#> attr(,".xData")
#> <environment: 0x7fc115ae4f60>
names(new_con$cache)
#> NULL
if (FALSE) {
saveConnection(new_con, tempfile())
}