R/saveCytoscapeSession.R

Defines functions saveCytoscapeSession

Documented in saveCytoscapeSession

saveCytoscapeSession <-
function (filepath="stringgaussnet_networks",overwrite=F,absolute=F,port.number=1234)
{
	check<-checkCytoscapeRunning(port.number)
	filepath<-paste(gsub("\\.cys$","",filepath),"cys",sep=".")
	if (file.exists(filepath) & !overwrite){stop(paste(filepath,"already exists."))}
	if(!absolute){filepath<-paste(getwd(),filepath,sep="/")}
	filepath<-URLencode(filepath)
	base.url = paste("http://localhost:", toString(port.number), "/v1", sep="")
	save.url<-paste(base.url,paste("session?file=",filepath,sep=""),sep="/")
	if (requireNamespace("httr",quietly=TRUE)) {res <- httr::POST(save.url)} else {stop("httr package must be installed to use this function")}
}

Try the stringgaussnet package in your browser

Any scripts or data that you put into this service are public.

stringgaussnet documentation built on May 29, 2017, 10:50 a.m.