set.seed(42)
toy_data <- simulateToyData()
net <-
generateNetworkObjects(
toy_data,
"CloneSeq"
)
net <-
addPlots(
net,
color_nodes_by =
c("SampleID", "CloneCount"),
print_plots = TRUE
)
saveNetworkPlots(
net$plots,
outfile =
file.path(tempdir(), "network.pdf"),
outfile_layout =
file.path(tempdir(), "graph_layout.txt")
)
# Load saved graph layout
graph_layout <- matrix(
scan(file.path(tempdir(), "graph_layout.txt"), quiet = TRUE),
ncol = 2
)
all.equal(graph_layout, net$plots$graph_layout)
# \dontshow{
# clean up temporary directory
file.remove(
file.path(tempdir(), c("network.pdf", "graph_layout.txt"))
)
# }
Run the code above in your browser using DataLab