R/saveObj.R

#' @name saveObj
#' @aliases saveObj,Rscexv-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 obj the Rscexv object
#' @param file theoutfile default='SCExV_Grps.txt'
#' @title description of function analyse.data
#' @export 
setGeneric('saveObj', ## Name
		function ( data, file='analysis.RData' ){	
			standardGeneric('saveObj')
		}
)

setMethod('saveObj', signature = c ('Rscexv'),
		definition = function ( data, file='analysis.RData' ){
			exportGroups(data)
			print ( paste('data exported to', file ) )
			save(data , file=file.path(data@outpath, file) )
			if ( locked(file)){
				release.lock( file )
			}
			if ( ! is.null( data@usedObj$usedGrouping )) {
				write( data@usedObj$usedGrouping , file= file.path(data@outpath,'usedGrouping.txt') )
			}
			write(as.character(data@annotation$'Gene Name') , file=file.path(data@outpath,'GeneNames.txt') )
			
		}
)
stela2502/Rscexv documentation built on July 6, 2022, 9:02 p.m.