Mercurial > repos > sblanck > mpagenomics_wrappers
comparison mpagenomics_normalize-7dc6ce39fb89/segcall.R @ 0:84b13b0e2b85
Uploaded
| author | sblanck |
|---|---|
| date | Thu, 07 May 2015 08:22:36 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:84b13b0e2b85 |
|---|---|
| 1 args<-commandArgs(TRUE) | |
| 2 | |
| 3 chrom=args[1] | |
| 4 dataset=args[2] | |
| 5 output=args[3] | |
| 6 tmp_dir=args[4] | |
| 7 nbcall=as.numeric(args[5]) | |
| 8 input=args[6] | |
| 9 outputfigures=type.convert(args[7]) | |
| 10 snp=type.convert(args[8]) | |
| 11 tumorcsv=args[9] | |
| 12 cellularity=as.numeric(args[10]) | |
| 13 user=args[11] | |
| 14 method=args[12] | |
| 15 | |
| 16 library(MPAgenomics) | |
| 17 workdir=file.path(tmp_dir, "mpagenomics",user) | |
| 18 setwd(workdir) | |
| 19 | |
| 20 if (grepl("all",tolower(chrom)) | chrom=="None") { | |
| 21 chrom_vec=c(1:25) | |
| 22 } else { | |
| 23 chrom_tmp <- strsplit(chrom,",") | |
| 24 chrom_vecstring <-unlist(chrom_tmp) | |
| 25 chrom_vec <- as.numeric(chrom_vecstring) | |
| 26 } | |
| 27 | |
| 28 input_tmp <- strsplit(input,",") | |
| 29 input_tmp_vecstring <-unlist(input_tmp) | |
| 30 | |
| 31 | |
| 32 input_vecstring = sub("^([^.]*).*", "\\1", input_tmp_vecstring) | |
| 33 | |
| 34 if (dataset == input) { | |
| 35 if (tumorcsv== "none") | |
| 36 { | |
| 37 segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, nclass=nbcall, savePlot=outputfigures,onlySNP=snp, cellularity=cellularity, method=method) | |
| 38 } else { | |
| 39 segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, nclass=nbcall, savePlot=outputfigures,onlySNP=snp, cellularity=cellularity, method=method) | |
| 40 } | |
| 41 } else { | |
| 42 if (tumorcsv== "none") | |
| 43 { | |
| 44 segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, listOfFiles=input_vecstring, nclass=nbcall, savePlot=outputfigures, onlySNP=snp, cellularity=cellularity, method=method) | |
| 45 } else { | |
| 46 segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, listOfFiles=input_vecstring, nclass=nbcall, savePlot=outputfigures, onlySNP=snp, cellularity=cellularity, method=method) | |
| 47 } | |
| 48 } | |
| 49 | |
| 50 sink(output) | |
| 51 print(format(segcall)) | |
| 52 sink() | |
| 53 #write.table(format(segcall),output,row.names = FALSE, quote=FALSE, sep = "\t") | |
| 54 #write.fwf(segcall,output,rownames = FALSE, quote=FALSE, sep = "\t") | |
| 55 quit() |
