view read_make_design_datasets/ReadDataSet.R @ 0:fda6b789e267 draft

Uploaded
author proteomisc
date Fri, 01 Dec 2023 09:58:18 +0000
parents
children
line wrap: on
line source

options(show.error.messages=F, error=function(){cat(geterrmessage(),file=stderr());q("no",1,F)})
sink(stdout(), type = "message")
suppressWarnings(suppressMessages(library("batch")))
suppressWarnings(suppressMessages(library(affy)))
suppressWarnings(suppressMessages(library(affyPLM)))
suppressWarnings(suppressMessages(library(limma)))
source_local <- function(fname){
    argv <- commandArgs(trailingOnly = FALSE)
    base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
    source(paste(base_dir, fname, sep="/"))
}
source_local("Read_GenePix_Functions.R")
source_local("Read_Affymetrix_Functions.R")
source_local("Read_Agilent_Functions.R")
listArguments = parseCommandArgs(evaluate=FALSE)
datasetsource = listArguments[["datasetsource"]]
listArguments[["datasetsource"]] = NULL
if(datasetsource=="intern"){
		if (!is.null(listArguments[["image"]])){
    		load(listArguments[["image"]])
    		listArguments[["image"]]=NULL
		}
		dataset=listArguments[["projectchoice"]]
		colus=as.integer(dataset)
		datachosen=listdataset[colus]
		listArguments[["projectchoice"]]=NULL
		if(technology=="Affymetrix"){
		listArguments=append(list(datachosen), listArguments)
		MicroArray_Object<-do.call("ReadAffymetrix",listArguments)
		}
		if(technology=="Agilent_One_Color"){
		listArguments=append(list(datachosen), listArguments)
		MicroArray_Object<-do.call("ReadAgilentOneChannel",listArguments)
		}
		if(technology=="Agilent_Two_Colors"){
		listArguments=append(list(datachosen), listArguments)
		MicroArray_Object<-do.call("ReadAgilentTwoChannels",listArguments)
		}
		if(technology=="GenePix_One_Color"){
		listArguments=append(list(datachosen), listArguments)
		MicroArray_Object<-do.call("ReadGenePixOneChannel",listArguments)
		}
		if(technology=="GenePix_Two_Colors"){
		listArguments=append(list(datachosen), listArguments)
		MicroArray_Object<-do.call("ReadGenePixTwoChannels",listArguments)
		}
}else{
		if (!is.null(listArguments[["imageimported"]])){
    		load(listArguments[["imageimported"]])
    		listArguments[["imageimported"]]=NULL
		}
		listArguments<-append(listArguments,list(listcelsfullpath=listcelsfullpath,listfullnames=listfullnames))
		if(technology=="Affymetrix"){
                listArguments[["listfullnames"]]=NULL
		MicroArray_Object<-do.call("ReadAffymetrixImported",listArguments)
		}
		if(technology=="Agilent_One_Color"){
		MicroArray_Object<-do.call("ReadAgilentOneChannelImported",listArguments)
		}
		if(technology=="Agilent_Two_Colors"){
		MicroArray_Object<-do.call("ReadAgilentTwoChannelsImported",listArguments)
		}
		if(technology=="GenePix_One_Color"){
		MicroArray_Object<-do.call("ReadGenePixOneChannelImported",listArguments)
		}
		if(technology=="GenePix_Two_Colors"){
		MicroArray_Object<-do.call("ReadGenePixTwoChannelsImported",listArguments)
		}
                
}


rm(listArguments)
save.image(paste("MicroArrayObject","RData",sep="."))