R/02_saveObj.R

#' @name saveObj
#' @aliases saveObj,StefansExpressionSet-method
#' @rdname saveObj-methods
#' @docType methods
#' @description This function saves the object either as analysis.RData or norm_data.RData if the analysi.RData has not been produced before
#' @param data the StefansExpressionSet object
#' @param file the outfile default=paste(str_replace_all(data@name, "\\s+", "_" ), '.RData',sep='')
#' @title description of function saveObj
#' @export 
setGeneric('saveObj', ## Name
		function ( data, file=NULL ){	## Argumente der generischen Funktion
			standardGeneric('saveObj') ## der Aufruf von standardGeneric sorgt für das Dispatching
		}
)

setMethod('saveObj', signature = c ('StefansExpressionSet'),
		definition = function ( data, file=NULL ){
			if ( is.null(file)){
				file=paste(str_replace_all(data@name, "\\s+", "_" ), '.RData',sep='')
			}
			print ( paste('data exported to', file.path(data@outpath,file) ) )
			save(data , file=file.path(data@outpath, file) )
			
		}
)
stela2502/StefansExpressionSet documentation built on April 24, 2023, 8:15 p.m.