R/export.ShortPathSTRINGNet.R

Defines functions export.ShortPathSTRINGNet

Documented in export.ShortPathSTRINGNet

export.ShortPathSTRINGNet <-
function (x, dirname, overwrite=F, ...)
{
	if (file.exists(dirname))
	{
		if(!overwrite){stop(paste(dirname,"already exists."))}
		unlink(dirname,recursive=T)
	}
	dir.create(dirname)
	write.table(x$Edges,paste(dirname,"Edges_attributes.txt",sep="/"),col.names=T,row.names=F,sep="\t",quote=F)
	write.table(cbind(NodeName=rownames(x$DEGenes),x$DEGenes),paste(dirname,"DEGenes_attributes.txt",sep="/"),col.names=T,row.names=F,sep="\t",quote=F)
	if (!is.null(x$Annotations)){write.table(cbind(NodeName=rownames(x$Annotations),x$Annotations),paste(dirname,"Annotations_attributes.txt",sep="/"),col.names=T,row.names=F,sep="\t",quote=F)}
}

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.