Mercurial > repos > sblanck > mpagenomics_wrappers
view mpagenomics_normalize-7dc6ce39fb89/markersSelection.R @ 2:a3563a370482
tool dependencies for datatypes
| author | samuel blanck |
|---|---|
| date | Wed, 13 May 2015 11:43:17 +0200 |
| parents | 84b13b0e2b85 |
| children |
line wrap: on
line source
args<-commandArgs(TRUE) input=args[1] response=args[2] tmp_dir=args[3] nbFolds=as.numeric(args[4]) loss=args[5] output=args[6] library(MPAgenomics) workdir=file.path(tmp_dir, "mpagenomics") setwd(workdir) CN=read.table(input,header=TRUE,check.names=FALSE) drops=c("chromosome","position","probeName") CNsignal=CN[,!(names(CN)%in% drops)] samples=names(CNsignal) CNsignalMatrix=t(data.matrix(CNsignal)) resp=read.table(response,header=TRUE,sep=",") listOfFile=resp[[1]] responseValue=resp[[2]] index = match(listOfFile,rownames(CNsignalMatrix)) responseValueOrder=responseValue[index] result=variableSelection(CNsignalMatrix,responseValueOrder,nbFolds=nbFolds,loss=loss,plot=TRUE) CNsignalResult=CN[result$markers.index,(names(CN)%in% drops)] CNsignalResult["coefficient"]=result$coefficient CNsignalResult["index"]=result$markers.index sink(output) print(format(CNsignalResult),row.names=FALSE) sink() #write.table(CNsignalResult,output,row.names = FALSE, quote=FALSE, sep = "\t")
