diff segmentFracB.R @ 5:af4f63f27c77 draft

planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
author sblanck
date Wed, 08 Apr 2020 15:34:17 +0000
parents
children d5ed62b4d3ac
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/segmentFracB.R	Wed Apr 08 15:34:17 2020 +0000
@@ -0,0 +1,43 @@
+args<-commandArgs(TRUE)
+
+chrom=args[1]
+dataset=args[2]
+output=args[3]
+tmp_dir=args[4]
+input=args[5]
+outputfigures=type.convert(args[6])
+tumorcsv=args[7]
+user=args[8]
+method=args[9]
+
+library(MPAgenomics)
+workdir=file.path(tmp_dir, "mpagenomics",user)
+setwd(workdir)
+
+if (grepl("all",tolower(chrom)) | chrom=="None") {
+	chrom_vec=c(1:25)
+} else {
+	chrom_tmp <- strsplit(chrom,",")
+	chrom_vecstring <-unlist(chrom_tmp)
+	chrom_vec <- as.numeric(chrom_vecstring)
+}
+
+input_tmp <- strsplit(input,",")
+input_tmp_vecstring <-unlist(input_tmp)
+
+
+input_vecstring = sub("^([^.]*).*", "\\1", input_tmp_vecstring) 
+
+if (dataset == input) {
+	segcall=segFracBSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, savePlot=outputfigures, method=method)
+	
+} else {
+	segcall=segFracBSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, listOfFiles=input_vecstring, savePlot=outputfigures, method=method)
+	
+}
+sink(output)
+print(format(segcall))
+sink()
+#write.table(segcall,output,row.names = FALSE, quote=FALSE, sep = "\t")
+
+quit()