changeset 0:4d539083cf7f draft

planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 689d0d8dc899a683ee18700ef385753559850233-dirty
author sblanck
date Tue, 12 May 2020 10:40:36 -0400
parents
children b3acec804ebc
files extractCN.R extractCN.xml filter.R filter.xml preprocess.R preprocess.xml repository_dependencies.xml segcall.R segcall.xml segmentFracB.R segmentFracB.xml segmentation.R segmentation.xml selection.R selection.xml selectionExtracted.R selectionExtracted.xml
diffstat 17 files changed, 2335 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extractCN.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,170 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--chrom",type="character",default=NULL, dest="chrom"),
+		make_option("--input",type="character",default=NULL, dest="input"),
+		make_option("--output",type="character",default=NULL, dest="output"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--settings_type",type="character",default=NULL, dest="settings_type"),
+		make_option("--settings_tumor",type="character",default=NULL, dest="settings_tumor"),
+		make_option("--symmetrize",type="character",default=NULL, dest="symmetrize"),
+		make_option("--settings_signal",type="character",default=NULL, dest="settings_signal"),
+		make_option("--settings_snp",type="character",default=NULL, dest="settings_snp"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log"),
+		make_option("--userid",type="character",default=NULL, dest="userid")
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+chrom=opt$chrom
+input=opt$input
+tmp_dir=opt$new_file_path
+output=opt$output
+settingsType=opt$settings_type
+tumorcsv=opt$settings_tumor
+symmetrize=opt$symmetrize
+signal=opt$settings_signal
+snp=type.convert(opt$settings_snp)
+outputlog=opt$outputlog
+log=opt$log
+user=opt$userid
+
+library(MPAgenomics)
+workdir=file.path(tmp_dir, "mpagenomics",user)
+setwd(workdir)
+
+inputDataset=read.table(file=input,stringsAsFactors=FALSE)
+dataset=inputDataset[1,2]
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+
+
+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)
+	}
+if (signal == "CN")
+{
+	if (settingsType == "dataset") {
+		if (tumorcsv== "None")
+		{  		
+			CN=getCopyNumberSignal(dataset,chromosome=chrom_vec, onlySNP=snp)
+					
+	  	} else {
+	  		CN=getCopyNumberSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, onlySNP=snp)
+	  	}
+	} else {
+		input_tmp <- strsplit(settingsType,",")
+		input_tmp_vecstring <-unlist(input_tmp)
+		input_vecstring = sub("^([^.]*).*", "\\1", input_tmp_vecstring) 
+	  	if (tumorcsv== "None") 
+	  	{
+	  		CN=getCopyNumberSignal(dataset,chromosome=chrom_vec, listOfFiles=input_vecstring, onlySNP=snp)
+	  	} else {
+	  		CN=getCopyNumberSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, listOfFiles=input_vecstring, onlySNP=snp )
+	  	}
+	}
+	
+	list_chr=names(CN)
+	CN_global=data.frame(check.names = FALSE)
+	for (i in list_chr) {
+	  chr_data=data.frame(CN[[i]],check.names = FALSE)
+	  CN_global=rbind(CN_global,chr_data)
+	}
+	names(CN_global)[names(CN_global)=="featureNames"] <- "probeName"
+	write.table(format(CN_global), output, row.names = FALSE, quote = FALSE, sep = "\t")
+	
+} else {
+	if (symmetrize=="TRUE")	{
+		if (settingsType == "dataset") {
+			input_vecstring = getListOfFiles(dataset)
+		} else {
+			input_tmp <- strsplit(settingsType,",")
+			input_tmp_vecstring <-unlist(input_tmp)
+			input_vecstring = sub("^([^.]*).*", "\\1", input_tmp_vecstring) 
+		}
+		
+		symFracB_global=data.frame(check.names = FALSE)
+		
+		for (currentFile in input_vecstring) {
+			cat(paste0("extracting signal from ",currentFile,".\n"))
+			currentSymFracB=data.frame()
+			symFracB=getSymFracBSignal(dataset,chromosome=chrom_vec,file=currentFile,normalTumorArray=tumorcsv)
+			list_chr=names(symFracB)
+			for (i in list_chr) {
+				cat(paste0("   extracting ",i,".\n"))
+				chr_data=data.frame(symFracB[[i]]$tumor,check.names = FALSE)
+				currentSymFracB=rbind(currentSymFracB,chr_data)
+				
+			}
+			if (is.null(symFracB_global) || nrow(symFracB_global)==0) {
+				symFracB_global=currentSymFracB
+			} else {
+				symFracB_global=cbind(symFracB_global,currentFile=currentSymFracB[[3]])
+			}
+		}
+		names(symFracB_global)[names(symFracB_global)=="featureNames"] <- "probeName"
+		
+		write.table(format(symFracB_global), output, row.names = FALSE, quote = FALSE, sep = "\t")
+	} else {
+		if (settingsType == "dataset") {
+			if (tumorcsv== "None")
+			{  		
+				fracB=getFracBSignal(dataset,chromosome=chrom_vec)
+				
+			} else {
+				fracB=getFracBSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv)
+			}
+		} else {
+			input_tmp <- strsplit(settingsType,",")
+			input_tmp_vecstring <-unlist(input_tmp)
+			input_vecstring = sub("^([^.]*).*", "\\1", input_tmp_vecstring) 
+			if (tumorcsv== "None") 
+			{
+				fracB=getFracBSignal(dataset,chromosome=chrom_vec, listOfFiles=input_vecstring)
+			} else {
+				fracB=getFracBSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, listOfFiles=input_vecstring)
+			}
+		}
+		#formatage des données
+		list_chr=names(fracB)
+		fracB_global=data.frame(check.names = FALSE)
+		for (i in list_chr) {
+			chr_data=data.frame(fracB[[i]]$tumor,check.names = FALSE)
+			fracB_global=rbind(fracB_global,chr_data)
+		}
+		names(fracB_global)[names(fracB_global)=="featureNames"] <- "probeName"
+		write.table(format(fracB_global), output, row.names = FALSE, quote = FALSE, sep = "\t")
+	}
+	
+}
+
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extractCN.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,222 @@
+<tool id="extract" name="Extract" force_history_refresh="True" version="1.1.0">
+  <description>copy number or allele B fraction signal</description>
+  <requirement type="package" version="1.1.2">mpagenomics</requirement>
+   <command>
+    	<![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/extractCN.R	
+    --chrom '$chrom'
+  	--input '$input'
+  	--output '$output' 
+  	--new_file_path '$__new_file_path__'
+  	#if $settings.settingsType == "file":
+  		--settings_type '$settings.inputs'
+  	#end if
+  	#if $settings.settingsType == "dataset":
+  		--settings_type 'dataset'
+  	#end if
+  	#if $settingsSNP.signal == "fracB":
+  		--settings_snp 'TRUE'
+  		
+  		#if $settingsSNP.sym.symmetrize=="TRUE"
+  			--settings_tumor '$tumorcsvFracBsym'
+  		#elif $settingsSNP.sym.symmetrize=="FALSE"
+  			#if $settingsSNP.sym.settingsTumorFracB.settingsTypeTumorFracB == "standard":
+  				--settings_tumor 'None'
+  			#elif  $settingsSNP.sym.settingsTumorFracB.settingsTypeTumorFracB == "tumor":
+  				--settings_tumor '$tumorcsvFracB'
+   			#end if
+  		#end if
+  		--symmetrize '$settingsSNP.sym.symmetrize'
+  	#else
+  		--settings_snp '$settingsSNP.snp'
+  		#if $settingsSNP.settingsTumor.settingsTypeTumor == "standard":
+  			--settings_tumor 'None'
+  		#elif $settingsSNP.settingsTumor.settingsTypeTumor == "tumor":
+  			--settings_tumor '$tumorcsvCN'
+  		#end if
+  	#end if
+  	--outputlog '$outputlog'
+  	--log '$log' 
+  	--settings_signal '$settingsSNP.signal'
+  	--userid '$__user_id__'
+        	]]>
+  </command>
+  <inputs>
+    <param name="input" type="data" format="dsf" label="Dataset summary file" help="Summary text file generated by the Data normalization tool"/>
+	<conditional name="settings">
+      <param name="settingsType" type="select" label="Files selection Mode" help="Select the whole cel files dataset or pick-up only few files from the dataset">
+        <option value="dataset">Select whole dataset</option>
+        <option value="file">Select file individually</option>
+      </param>
+      <when value="dataset"/>
+      <when value="file">
+        <param name="inputs" type="select" format="cel" multiple="true" label="Cel files">
+        <options from_dataset="input">
+    		<column name="name" index="0"/>
+    		<column name="value" index="0"/>
+		</options>
+		</param>
+	   </when>
+    </conditional>
+    
+    <conditional name="settingsSNP">
+    	<param name="signal" type="select" multiple="false" label="Signal you want to work on">
+     		<option value="CN">CN</option>
+      		<option value="fracB">fracB</option>
+    	</param> 
+    	<when value="fracB">
+    		<conditional name="sym">
+    			<param name="symmetrize" type="select" label="Symmetrize allele B signal">
+        			<option value="TRUE">Yes</option>
+        			<option value="FALSE">No</option>
+    			</param>
+    			<when value="TRUE">
+    				<param name="tumorcsvFracBsym" type="data" format="csv" label="Normal-tumor csv file" help="Normal-tumor csv file. See below for more information."/>
+    			</when>
+    			<when value="FALSE">
+    				<conditional name="settingsTumorFracB">
+      					<param name="settingsTypeTumorFracB" type="select" label="Reference">
+        					<option value="standard">Study without reference</option>
+        					<option value="tumor">Normal-tumor study</option>
+      					</param>
+      					<when value="standard"/>
+      					<when value="tumor">
+        					<param name="tumorcsvFracB" type="data" format="csv" label="Tumor boost csv file" help="Normal-tumor csv file. See below for more information."/>
+      					</when>
+    				</conditional>        	
+    			</when>
+    		</conditional>
+    	</when>
+		<when value="CN">
+			<conditional name="settingsTumor">
+      			<param name="settingsTypeTumor" type="select" label="Reference">
+        			<option value="standard">Study without reference</option>
+        			<option value="tumor">Normal-tumor study</option>
+      			</param>
+      			<when value="standard"/>
+      			<when value="tumor">
+        			<param name="tumorcsvCN" type="data" format="csv" label="Normal tumor csv file" help="Normal-tumor csv file. See below for more information."/>
+      			</when>
+    		</conditional>        	
+     		<param name="snp" type="select" label="Select Probes">
+        		<option value="FALSE">CN and SNP probes</option>
+        		<option value="TRUE">Only SNP probes</option>
+    		</param>
+    	</when>
+    </conditional>
+         
+    <!--param name="chrom" type="text" value="All" label="Chromosomes" help="Chromosomes to segment. Use comma to choose multiple chromosomes: e.g. 1, 3, 8. Use 'All' for a segmentation on all chromosomes" /-->
+    
+    <param  name="chrom" type="select" size="6" multiple="true" label="Chromosomes" help="You can select several chromosomeleave blank for all chromosomes">
+      <option value="All">All</option>
+      <option value="1">chr 1</option>
+      <option value="2">chr 2</option>
+      <option value="3">chr 3</option>
+      <option value="4">chr 4</option>
+      <option value="5">chr 5</option>
+      <option value="6">chr 6</option>
+      <option value="7">chr 7</option>
+      <option value="8">chr 8</option>
+      <option value="9">chr 9</option>
+      <option value="10">chr 10</option>
+      <option value="11">chr 11</option>
+      <option value="12">chr 12</option>
+      <option value="13">chr 13</option>
+      <option value="14">chr 14</option>
+      <option value="15">chr 15</option>
+      <option value="16">chr 16</option>
+      <option value="17">chr 17</option>
+      <option value="18">chr 18</option>
+      <option value="19">chr 19</option>
+      <option value="20">chr 20</option>
+      <option value="21">chr 21</option>
+      <option value="22">chr 22</option>
+      <option value="23">chr 23</option>
+      <option value="24">chr 24</option>
+      <option value="25">chr 25</option>
+      
+    </param>   	
+     
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+  </inputs>
+  <outputs>
+    <data format="sef" name="output" label="signal extraction of ${input.name}" />
+    <data format="log" name="log" label="log of signal extraction of ${input.name}">
+    	<filter>outputlog == "TRUE"</filter>
+    </data>
+   </outputs>
+   <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+<help>
+.. class:: warningmark
+
+Data normalization must be run (with the data normalization tool) prior to signal extraction.
+
+-----
+
+**What it does**     	
+This tool extracts the copy number profile from the normalized data. 
+	
+Outputs:
+  	
+*A tabular text file containing 3 fixed columns and 1 column per sample:*
+	
+	- chr: Chromosome.
+	- position: Genomic position (in bp).
+	- probeNames: Name of the probes of the microarray.
+	- One column per sample which contains the copy number profile for each sample.
+  		
+-----
+  		
+**Normal-tumor study**
+     	
+In cases where normal (control) samples match to tumor samples, normalization can be improved using TumorBoost. In this case, a normal-tumor csv file must be provided :
+
+	- The first column contains the names of the files corresponding to normal samples of the dataset.
+     	 
+	- The second column contains the names of the tumor samples files. 
+     	
+	- Column names of these two columns are respectively normal and tumor.
+     	
+	- Columns are separated by a comma.
+     	
+	- *Extensions of the files (.CEL for example) should be removed*
+
+
+     	
+**Example** 
+
+Let 6 .cel files in the studied dataset (3 patients, each of them being represented by a couple of normal and tumor cel files.) ::
+     	
+     	patient1_normal.cel
+     	patient1_tumor.cel
+     	patient2_normal.cel
+     	patient2_tumor.cel
+     	patient3_normal.cel 
+     	patient3_tumor.cel
+      	
+
+The csv file should look like this ::
+     	
+     	normal,tumor
+     	patient1_normal,patient1_tumor
+     	patient2_normal,patient2_tumor
+     	patient3_normal,patient3_tumor
+
+-----     	  		
+
+     	
+**Citation**
+	
+If you use this tool please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. Mpagenomics : An r package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+  
+
+</help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filter.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,67 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--input",type="character",default=NULL, dest="input"),
+		make_option("--output",type="character",default=NULL, dest="output"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--nbcall",type="character",default=NULL, dest="nbcall"),
+		make_option("--length",type="character",default=NULL, dest="length"),
+		make_option("--probes",type="character",default=NULL, dest="probes"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log")
+	);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+input=opt$input
+output=opt$output
+tmp_dir=opt$new_file_path
+nbcall=opt$nbcall
+length=as.numeric(opt$length)
+probes=as.numeric(opt$probes)
+log=opt$log
+outputlog=opt$outputlog
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+
+nbcall_tmp <- strsplit(nbcall,",")
+nbcall_vecstring <-unlist(nbcall_tmp)
+
+nbcall_vecstring
+
+library(MPAgenomics)
+workdir=file.path(tmp_dir, "mpagenomics")
+setwd(workdir)
+
+segcall = read.table(input, header = TRUE)
+filtercall=filterSeg(segcall,length,probes,nbcall_vecstring)
+#sink(output)
+#print(format(filtercall),row.names=FALSE)
+#sink()
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
+write.table(filtercall,output,row.names = FALSE, quote = FALSE, sep = "\t")
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filter.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,74 @@
+<tool id="callfilter" name="Filter" description="segmented and called data" force_history_refresh="True" version="1.1.0">
+  <requirement type="package" version="1.1.2">mpagenomics</requirement>
+  <command>
+  	<![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/filter.R 
+  		--input '$input' 
+  		--length '$length' 
+  		--probes '$probes' 
+  		--new_file_path '$__new_file_path__' 
+  		--nbcall '$nbcall' 
+  		--output '$output' 
+  		--outputlog '$outputlog' 
+  		--log '$log'
+  	]]>
+  </command>
+  <inputs>
+    <param name="input" type="data" format="scr" label="Segmented and called data file" help="Input file with labelled segments"/>
+    <param name="length" type="integer" min="1" value="1" label="Minimum length for a segment" help="minimal length (in bp) to keep in a segment"/>
+	<param name="probes" type="integer" min="1" value="1" label="Minimum probes for a segment" help="minimal number of probes to keep in a segment"/>
+    <param name="nbcall" type="select" multiple="true" label="Label(s) to keep">
+      <option value="double loss">double loss</option>
+      <option value="loss">loss</option>
+      <option value="normal">normal</option>
+      <option value="gain">gain</option>
+      <option value="amplification">amplification</option>
+    </param>    
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+  </inputs>
+  
+  <outputs>
+    <data format="tabular" name="output" label="filter of ${on_string}" />
+    
+	<data format="log" name="log" label="log of segmentation of ${input.name}">
+    	<filter>outputlog == "TRUE"</filter>
+    </data>  
+  </outputs>
+ 
+  <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+   <help>
+   	
+**What it does**
+   	    	
+This tool filters results obtained by the segmentation and calling tool.
+
+-----
+
+Input/Output file:
+  	
+*A tabular text file containing 7 columns:*
+	
+	- sampleNames: Name of the file.
+	- chrom: Chromosome of the segment.
+	- chromStart: Starting position (in bp) of the segment. This position is not included in the segment.
+	- chromEnd: Ending position (in bp) of the segment. This position is included in the segment.
+	- probes: Number of probes in the segment.
+	- means: Mean of the segment.
+	- calls: Calling of the segment (”double loss”, ”loss”, ”normal”, ”gain” or ”amplification”).
+
+-----
+   	
+**Citation**
+	
+If you use this tool please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. MPAgenomics : An R package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+  
+ </help>
+   	</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/preprocess.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,158 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--summary",type="character",default=NULL, dest="summary"),
+		make_option("--dataSetName",type="character",default=NULL, dest="dataSetName"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--inputcdffull_name",type="character",default=NULL, dest="inputcdffull_name"),
+		make_option("--inputufl_name",type="character",default=NULL, dest="inputufl_name"),
+		make_option("--inputugp_name",type="character",default=NULL, dest="inputugp_name"),
+		make_option("--inputacs_name",type="character",default=NULL, dest="inputacs_name"),
+		make_option("--inputcdffull",type="character",default=NULL, dest="inputcdffull"),
+		make_option("--inputufl",type="character",default=NULL, dest="inputufl"),
+		make_option("--inputugp",type="character",default=NULL, dest="inputugp"),
+		make_option("--inputacs",type="character",default=NULL, dest="inputacs"),
+		make_option("--tumorcsv",type="character",default=NULL, dest="tumorcsv"),
+		make_option("--settingsType",type="character",default=NULL, dest="settingsType"),
+		make_option("--outputgraph",type="character",default=NULL, dest="outputgraph"),
+		make_option("--zipfigures",type="character",default=NULL, dest="zipfigures"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log"),
+		make_option("--user_id",type="character",default=NULL, dest="user_id"),
+		make_option("--input",type="character",default=NULL, dest="input")
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+summary=opt$summary
+dataSetName=opt$dataSetName
+newFilePath=opt$new_file_path
+inputCDFName=opt$inputcdffull_name
+inputUFLName=opt$inputufl_name
+inputUGPName=opt$inputugp_name
+inputACSName=opt$inputacs_name
+inputCDF=opt$inputcdffull
+inputUFL=opt$inputufl
+inputUGP=opt$inputugp
+inputACS=opt$inputacs
+tumorcsv=opt$tumorcsv
+settingsType=opt$settingsType
+outputGraph=opt$outputgraph
+zipfigures=opt$zipfigures
+outputlog=opt$outputlog
+log=opt$log
+userId=opt$user_id
+
+destinationPath=file.path(newFilePath, userId, dataSetName)
+mpagenomicsDir = file.path(newFilePath,"mpagenomics",userId)
+dataDir = file.path(newFilePath, userId)
+chipDir = file.path(newFilePath,"mpagenomics",userId,"annotationData","chipTypes")
+createArchitecture=TRUE
+
+if (dir.exists(chipDir))
+	system(paste0("rm -r ", chipDir))
+
+if (!dir.exists(mpagenomicsDir))
+	dir.create(mpagenomicsDir, showWarnings = TRUE, recursive = TRUE)
+
+if (!dir.exists(dataDir))
+	dir.create(dataDir, showWarnings = TRUE, recursive = TRUE)
+
+listInput <- trimws( unlist( strsplit(trimws(opt$input), ",") ) )
+if(length(listInput)<2){
+	stop("To few .CEL files selected : At least 2 .CEL files are required", call.=FALSE)
+}
+
+
+celList=vector()
+celFileNameList=vector()
+
+for (i in 1:length(listInput))
+{
+	inputFileInfo <- unlist( strsplit( listInput[i], ';' ) )
+	celList=c(celList,inputFileInfo[1])
+	celFileNameList=c(celFileNameList,inputFileInfo[2])
+}
+
+
+for (i in 1:length(celFileNameList))
+	{
+		source = celList[i]
+		destination=file.path(dataDir,celFileNameList[i])
+		file.copy(source, destination)
+}
+split=unlist(strsplit(inputCDFName,",",fixed=TRUE))
+tag=NULL
+if (length(split) != 0) {
+	chipType=split[1]
+	tagExt=split[2]
+	tag=unlist(strsplit(tagExt,".",fixed=TRUE))[1]
+	} else {
+	chipType=split[1]
+}
+
+if(!file.exists(file.path(dataDir,inputCDFName)))
+	file.symlink(inputCDF,file.path(dataDir,inputCDFName))
+if(!file.exists(file.path(dataDir,inputACSName)))
+	file.symlink(inputACS,file.path(dataDir,inputACSName))
+if(!file.exists(file.path(dataDir,inputUFLName)))
+	file.symlink(inputUFL,file.path(dataDir,inputUFLName))
+if(!file.exists(file.path(dataDir,inputUGPName)))
+	file.symlink(inputUGP,file.path(dataDir,inputUGPName))
+
+fig_dir = file.path("mpagenomics", userId, "figures", dataSetName, "signal")
+abs_fig_dir = file.path(newFilePath, fig_dir)
+
+chip=chipType
+dataset=dataSetName
+workdir=mpagenomicsDir
+celPath=dataDir
+chipPath=dataDir		
+tumor=tumorcsv
+outputgraph=type.convert(outputGraph)
+
+
+library(MPAgenomics)
+setwd(workdir)
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+
+if (settingsType=="standard")
+{
+	signalPreProcess(dataSetName=dataset, chipType=chip, dataSetPath=celPath,chipFilesPath=chipPath, path=workdir,createArchitecture=createArchitecture, savePlot=outputgraph, tags=tag)
+} else {
+	signalPreProcess(dataSetName=dataset, chipType=chip, dataSetPath=celPath,chipFilesPath=chipPath, normalTumorArray=tumor, path=workdir,createArchitecture=createArchitecture, savePlot=outputgraph, tags=tag)
+}
+setwd(abs_fig_dir)
+files2zip <- dir(abs_fig_dir)
+zip(zipfile = "figures.zip", files = files2zip)
+file.rename("figures.zip",zipfigures)
+summarydf=data.frame(celFileNameList,rep(dataSetName,length(celFileNameList)),rep(chipType,length(celFileNameList)))
+write.table(summarydf,file=summary,quote=FALSE,row.names=FALSE,col.names=FALSE,sep="\t")
+
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/preprocess.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,159 @@
+<tool id="preprocess" name="Data Normalization" force_history_refresh="True" version="1.1.0">
+  	<requirements>
+    <!--requirement type="set_environment">R_SCRIPT_PATH</requirement-->
+    <requirement type="package" version="1.1.2">mpagenomics</requirement>
+   </requirements>
+	<!--command interpreter="python"-->
+    <command>
+    	<![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/preprocess.R	
+		--summary '$summary' 
+		--new_file_path '$__new_file_path__'  
+		--inputcdffull_name '$inputcdffull.name' 
+		--inputufl_name '$inputufl.name' 
+		--inputugp_name '$inputugp.name' 
+		--inputacs_name '$inputacs.name'
+		--inputcdffull '$inputcdffull' 
+		--inputufl '$inputufl' 
+		--inputugp '$inputugp' 
+		--inputacs '$inputacs'
+		--dataSetName '$datasetName'
+  	#if $settings.settingsType == "tumor":
+  	--tumorcsv '$tumorcsv' 
+  	#end if
+  	#if $settings.settingsType == "standard":
+  	--tumorcsv 'none'
+  	#end if
+  	 --settingsType '$settings.settingsType' 
+	 --outputgraph '$outputgraph' 
+	 --zipfigures '$zipfigures' 
+	 --outputlog '$outputlog' 
+	 --log '$log' 
+	 --user_id '$__user_id__'
+	 --input "#for $input in $inputs# $input;$input.name, #end for#"
+    	]]>
+     
+  </command>
+  <inputs>
+  	<param name="datasetName" type="text" label="Dataset Name"/>
+  	<param name="inputs" type="data" format="cel" multiple="True" label="Cel files dataset" help="Cel files dataset previously uploaded with the Multiple File Datasets tool."/>
+    <param name="inputcdffull" type="data" format="cdf" label="cdf file" help=".cdf file name must comply with the following format : &lt; chiptype &gt;,&lt; tag &gt;.cdf (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,Full.cdf)." />
+    <param name="inputufl" type="data" format="ufl" label="ufl file" help=".ufl file name must start with  &lt; chiptype &gt;,&lt; tag &gt; (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,Full,na31,hg19,HB20110328.ufl)."/>
+    <param name="inputugp" type="data" format="ugp" label="ugp file" help=".ugp file name must start with  &lt; chiptype &gt;,&lt; tag &gt; (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,Full,na31,hg19,HB20110328.ugp)."/>
+    <param name="inputacs" type="data" format="acs" label="acs file" help=".acs file name must start with  &lt; chiptype &gt;,&lt; tag &gt; (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,HB20080710.acs)."/>
+	<conditional name="settings">
+      <param name="settingsType" type="select" label="Reference">
+        <option value="standard">Study without reference</option>
+        <option value="tumor">Normal-tumor study with TumorBoost</option>
+      </param>
+      <when value="standard" />
+      <when value="tumor">
+        <param name="tumorcsv" type="data" format="csv" label="TumorBoost csv file" help="Normal-tumor csv file. See below for more information."/>
+      </when>
+    </conditional>
+    <!--param name="outputgraph" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Output figures" /-->
+    <!--param name="outputlog" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Output log" /-->
+	<param name="outputgraph" type="select" label="Output figures">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+      </param>
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+    <!--param name="chipType" type="text" label="chipType" /-->
+    <!--param name="workspace" type="text" label="Workspace"/-->
+  </inputs>
+  
+  <outputs>
+  	<!-- Would like to make this hidden or not appear all together, but
+  	     variable outputs require a primary dataset. If hidden refresh 
+  	     doesn't occur. 
+  	-->
+    <data format="dsf" name="summary" label="Dataset summary file of ${datasetName}" />
+    <data format="zip" name="zipfigures" label="figures of normalization of ${datasetName}">
+    	<filter>outputgraph == "TRUE"</filter>	
+    </data>    
+    <data format="log" name="log" label="log of normalization ${datasetName}">
+    	<filter>outputlog == "TRUE"</filter>
+    </data>
+  </outputs>
+  
+  <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+   
+     <help>
+  
+**What it does**
+     	
+This preprocessing step consists in a correction of biological and technical biaises due to the experiment. Raw data from Affymetrix arrays are provided in different CEL files. These data must be normalized before statistical analysis.
+The pre-processing is proposed as a wrapper of aroma.* packages (using CRMAv2 and TumorBoost when appropriate). Note that this implies that the pre-processing step is only available for Affymetrix arrays.
+
+-----
+     	
+**Chip file naming conventions**
+      	
+Chip filenames must strictly follow the following rules :
+     	
+- *.cdf* filename must comply with the following format : &lt; chiptype &gt;,&lt; tag &gt;.cdf (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,Full.cdf). Note the use of a comma (not a point) between &lt;chiptype&gt; and the tag "Full".
+
+- *.ufl* filename must start with  &lt; chiptype &gt;,&lt; tag &gt; (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,Full,na31,hg19,HB20110328.ufl).
+
+- *.ugp* filename must start with  &lt; chiptype &gt;,&lt; tag &gt; (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,Full,na31,hg19,HB20110328.ugp).   	
+
+- *.acs* file name must start with  &lt; chiptype &gt;,&lt; tag &gt; (e.g, for a GenomeWideSNP_6 chip: GenomeWideSNP_6,HB20080710.acs).
+     	
+-----
+     	
+**Normal-tumor study with TumorBoost**
+     	
+In cases where normal (control) samples match to tumor samples, normalization can be improved using TumorBoost. In this case, a normal-tumor csv file must be provided :
+
+	- The first column contains the names of the files corresponding to normal samples of the dataset.
+     	 
+	- The second column contains the names of the tumor samples files. 
+     	
+	- Column names of these two columns are respectively normal and tumor.
+     	
+	- Columns are separated by a comma.
+     	
+	- *Extensions of the files (.CEL for example) should be removed*
+
+
+     	
+**Example** 
+
+Let 6 .cel files in the dataset studied (3 patients, each of them being represented by a couple of normal and tumor cel files.) ::
+     	
+     	patient1_normal.cel
+     	patient1_tumor.cel
+     	patient2_normal.cel
+     	patient2_tumor.cel
+     	patient3_normal.cel 
+     	patient3_tumor.cel
+      	
+
+The csv file should look like this ::
+     	
+     	normal,tumor
+     	patient1_normal,patient1_tumor
+     	patient2_normal,patient2_tumor
+     	patient3_normal,patient3_tumor
+
+     	
+-----
+     	
+**Citation**
+	
+When using this tool, please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. MPAgenomics : An R package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+     	
+As CRMAv2 normalization is used, please also cite `H. Bengtsson, P. Wirapati, and T. P. Speed. A single-array preprocessing method for estimating full-resolution raw copy numbers from all Affymetrix genotyping arrays including GenomeWideSNP 5 &amp; 6. Bioinformatics, 5(17):2149–2156, 2009. &lt;http://bioinformatics.oxfordjournals.org/content/25/17/2149.short&gt;`_
+
+When using TumorBoost to improve normalization in a normal-tumor study, please cite `H. Bengtsson, P. Neuvial, and T. P. Speed. TumorBoost: Normalization of allele-specific tumor copy numbers from a single pair of tumor-normal genotyping microarrays. BMC Bioinformatics, 11, 2010 &lt;http://www.biomedcentral.com/1471-2105/11/245&gt;`_
+
+  </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/repository_dependencies.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,4 @@
+<?xml version="1.0" ?>
+<repositories description="mpagenomics datatypes">
+    <repository changeset_revision="c5284b46cbf4" name="mpagenomics_datatypes" owner="sblanck" toolshed="testtoolshed.g2.bx.psu.edu"/>
+</repositories>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/segcall.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,124 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--chrom",type="character",default=NULL, dest="chrom"),
+		make_option("--input",type="character",default=NULL, dest="input"),
+		make_option("--output",type="character",default=NULL, dest="output"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--nbcall",type="character",default=NULL, dest="nbcall"),
+		make_option("--settingsType",type="character",default=NULL, dest="settingsType"),
+		make_option("--outputgraph",type="character",default=NULL, dest="outputgraph"),
+		make_option("--snp",type="character",default=NULL, dest="snp"),
+		make_option("--zipfigures",type="character",default=NULL, dest="zipfigures"),
+		make_option("--settingsTypeTumor",type="character",default=NULL, dest="settingsTypeTumor"),
+		make_option("--cellularity",type="character",default=NULL, dest="cellularity"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log"),
+		make_option("--userid",type="character",default=NULL, dest="userid"),
+		make_option("--method",type="character",default=NULL, dest="method")
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+chrom=opt$chrom
+datasetFile=opt$input
+output=opt$output
+tmp_dir=opt$new_file_path
+nbcall=as.numeric(opt$nbcall)
+settingsType=opt$settingsType
+outputfigures=type.convert(opt$outputgraph)
+snp=type.convert(opt$snp)
+tumorcsv=opt$settingsTypeTumor
+cellularity=as.numeric(opt$cellularity)
+user=opt$userid
+method=opt$method
+log=opt$log
+outputlog=opt$outputlog
+outputgraph=opt$outputgraph
+zipfigures=opt$zipfigures
+
+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)
+	}
+
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+	
+	
+inputDataset=read.table(file=datasetFile,stringsAsFactors=FALSE)
+dataset=inputDataset[1,2]
+
+fig_dir = file.path("mpagenomics", user, "figures", dataset, "segmentation","CN")
+abs_fig_dir = file.path(tmp_dir, fig_dir)
+
+if (outputgraph) {
+	if (dir.exists(abs_fig_dir)) {
+		system(paste0("rm -r ", abs_fig_dir))
+	}
+}
+
+if (settingsType == 'dataset') {
+	if (tumorcsv== "none")
+	{
+  		segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, nclass=nbcall, savePlot=outputfigures,onlySNP=snp, cellularity=cellularity, method=method)
+  	} else {
+  		segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, nclass=nbcall, savePlot=outputfigures,onlySNP=snp, cellularity=cellularity, method=method)
+  	}
+} else {
+	input_tmp <- strsplit(settingsType,",")
+	input_tmp_vecstring <-unlist(input_tmp)
+	input_vecstring = sub("^([^.]*).*", "\\1", input_tmp_vecstring) 
+  	if (tumorcsv== "none") 
+  	{
+  		segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, listOfFiles=input_vecstring, nclass=nbcall, savePlot=outputfigures, onlySNP=snp, cellularity=cellularity, method=method)
+  	} else {
+  		segcall=cnSegCallingProcess(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, listOfFiles=input_vecstring, nclass=nbcall, savePlot=outputfigures, onlySNP=snp, cellularity=cellularity, method=method)
+  	}
+}
+
+
+write.table(format(segcall),output,row.names = FALSE, quote=FALSE, sep = "\t")
+
+
+if (outputgraph) {	
+	setwd(abs_fig_dir)
+	files2zip <- dir(abs_fig_dir)
+	zip(zipfile = "figures.zip", files = files2zip)
+	file.rename("figures.zip",zipfigures)
+}
+
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
+#write.fwf(segcall,output,rownames = FALSE, quote=FALSE, sep = "\t")
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/segcall.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,212 @@
+<tool id="segcall" name="Segmentation and calling" force_history_refresh="True" version="1.1.0">
+  <description>of the normalized data</description>
+  <requirement type="package" version="1.1.2">mpagenomics</requirement>
+  <command>
+    <![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/segcall.R 
+  		--chrom '$chrom' 
+  		--input '$input' 
+  		--output '$output' 
+  		--new_file_path '$__new_file_path__' 
+  		--nbcall '$nbcall' 
+  	#if $settings.settingsType == "file":
+  		--settingsType '$settings.inputs'
+  	#end if
+  	#if $settings.settingsType == "dataset":
+  		--settingsType '$settings.settingsType'
+  	#end if
+  		--outputgraph '$outputgraph' 
+  		--snp '$snp' 
+  		--zipfigures '$zipfigures'
+  	#if $settingsTumor.settingsTypeTumor == "standard":
+  		--settingsTypeTumor 'none'
+  	#end if
+  	#if $settingsTumor.settingsTypeTumor == "tumor":
+  		--settingsTypeTumor '$tumorcsv'
+  	#end if
+  		--cellularity '$cellularity' 
+  		--outputlog '$outputlog' 
+  		--log '$log' 
+  		--userid '$__user_id__' 
+  		--method '$method'
+  	]]>
+  </command>
+  <inputs>
+    <!--param name="input" type="data" format="m:cel" label="Cel dataset" refresh="TRUE" help="cel files dataset previously normalized with the Data Normalization tool"/-->
+  	<!--param name="inputXml" type="data" format="xml" label="Workspace" help="cel files dataset previously normalized with the Data Normalization tool"/-->
+	<param name="input" type="data" format="dsf" label="Dataset summary file" help="Summary text file generated by the Data Normalization tool"/>
+	        
+    <conditional name="settings">
+      <param name="settingsType" type="select" label="Files selection Mode" help="Select the whole cel files dataset or pick-up only few files from the dataset">
+        <option value="dataset">Select whole dataset</option>
+        <option value="file">Select file(s) individually</option>
+      </param>
+      <when value="dataset" />
+      <when value="file">
+        <param name="inputs" type="select" format="cel" multiple="true" label="Cel files">
+        <options from_dataset="input">
+    		<column name="name" index="0"/>
+    		<column name="value" index="0"/>
+		</options>
+		</param>
+      </when>
+    </conditional>
+    <conditional name="settingsTumor">
+      <param name="settingsTypeTumor" type="select" label="Reference">
+        <option value="standard">Study without reference</option>
+        <option value="tumor">Normal-tumor study</option>
+      </param>
+      <when value="standard" />
+      <when value="tumor">
+        <param name="tumorcsv" type="data" format="csv" label="TumorBoost csv file" help="Normal-tumor csv file. See below for more information."/>
+      </when>
+    </conditional>    
+      
+      <param name="snp" type="select" label="Select Probes">
+        	<option value="FALSE">CN and SNP probes</option>
+        	<option value="TRUE">Only SNP probes</option>
+    	</param>
+   
+    <!--param name="chrom" type="text" value="All" label="Chromosomes" help="Chromosomes to segment. Use comma to choose multiple chromosomes: e.g. 1, 3, 8. Use 'All' for a segmentation on all chromosomes" /-->
+    
+    <param  name="chrom" type="select" size="6" multiple="true" label="Chromosomes" help="leave blank for all chromosomes">
+      <option value="All">All</option>
+      <option value="1">chr 1</option>
+      <option value="2">chr 2</option>
+      <option value="3">chr 3</option>
+      <option value="4">chr 4</option>
+      <option value="5">chr 5</option>
+      <option value="6">chr 6</option>
+      <option value="7">chr 7</option>
+      <option value="8">chr 8</option>
+      <option value="9">chr 9</option>
+      <option value="10">chr 10</option>
+      <option value="11">chr 11</option>
+      <option value="12">chr 12</option>
+      <option value="13">chr 13</option>
+      <option value="14">chr 14</option>
+      <option value="15">chr 15</option>
+      <option value="16">chr 16</option>
+      <option value="17">chr 17</option>
+      <option value="18">chr 18</option>
+      <option value="19">chr 19</option>
+      <option value="20">chr 20</option>
+      <option value="21">chr 21</option>
+      <option value="22">chr 22</option>
+      <option value="23">chr 23</option>
+      <option value="24">chr 24</option>
+      <option value="25">chr 25</option>
+    </param>   	
+    <param name="method" type="select" label="Segmentation method" help="">
+      <option value="cghseg">cghseg</option>
+      <option value="PELT">PELT</option>
+    </param>
+    	
+    <param name="nbcall" type="select" label="Number of calling classes" help="The number of levels to be used for calling. Either 3 (loss, normal, gain), 4 (including amplifications), 5 (including double deletions) ">
+      <option value="3">3</option>
+      <option value="4">4</option>
+      <option value="5">5</option>
+    </param>
+    <param name="cellularity" type="float" size="5" value="1" min="0" max="1" label="Cellularity" help="Ratio of tumor cells in the sample. Real value between 0 and 1"/>
+	<param name="outputgraph" type="select" label="Output figures">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+     </param>    
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+  </inputs>
+  <outputs>
+    <data format="scr" name="output" label="seg. and call of ${input.name}" />
+    <data format="zip" name="zipfigures" label="seg. and call figures of ${input.name}">
+    	<filter>outputgraph == "TRUE"</filter>	
+    </data>
+    <data format="log" name="log" label="log of segmentation of ${input.name}">
+    	<filter>outputlog == "TRUE"</filter>
+    </data>
+   </outputs>
+   <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+<help>
+.. class:: warningmark
+
+Data normalization must be run with the Data Normalization tool prior to segmentation. Otherwise, the standalone version can be used to perform marker selection from matrices containing data normalized with tools different from the one proposed in this instance.  
+	
+
+-----
+
+**What it does**     	
+This tool segments the previously normalized profiles and labels segments found in the copy-number profiles. Otherwise, the standalone version can be used to perform segmentation from matrices containing data normalized with tools different from the one proposed in this instance.  
+	
+Outputs:
+  	
+*A tabular text file containing 7 columns which describe all the segments (1 line per segment):*
+	
+	- sampleNames: Names of the original .CEL files.
+	- chrom: Chromosome of the segment.
+	- chromStart: Starting position (in bp) of the segment. This position is not included in the segment.
+	- chromEnd: Ending position (in bp) of the segment. This position is included in the segment.
+	- probes: Number of probes in the segment.
+	- means: Mean of the segment.
+	- calls: Calling of the segment (”double loss”, ”loss”, ”normal”, ”gain” or ”amplification”).
+  		
+*A .zip file containing all the figures (optionnal)*
+	
+-----
+  		
+**Normal-tumor study**
+     	
+In cases where normal (control) samples match to tumor samples, they are taken as references to extract copy number profile. In this case, a normal-tumor csv file must be provided :
+
+	- The first column contains the names of the files corresponding to normal samples of the dataset.
+     	 
+	- The second column contains the names of the tumor samples files. 
+     	
+	- Column names of these two columns are respectively normal and tumor.
+     	
+	- Columns are separated by a comma.
+     	
+	- *Extensions of the files (.CEL for example) should be removed*
+
+
+     	
+**Example** 
+
+Let 6 .cel files in the studied dataset (3 patients, each of them being represented by a couple of normal and tumor cel files.) ::
+     	
+     	patient1_normal.cel
+     	patient1_tumor.cel
+     	patient2_normal.cel
+     	patient2_tumor.cel
+     	patient3_normal.cel 
+     	patient3_tumor.cel
+      	
+
+The csv file should look like this ::
+     	
+     	normal,tumor
+     	patient1_normal,patient1_tumor
+     	patient2_normal,patient2_tumor
+     	patient3_normal,patient3_tumor
+
+-----     	  		
+
+     	
+**Citation**
+
+If you use this tool please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. MPAgenomics : An R package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+	
+As segmentation is performed with PELT, please also cite `R. Killick, P. Fearnhead, and I. A. Eckley. Optimal detection of changepoints with a linear computational cost. Journal of the American Statistical Association, 107(500):1590–1598, 2012. &lt;http://arxiv.org/abs/1101.1438&gt;`_
+
+As segmentation is performed by cghseg, please cite	`Picard, F., Robin, S., Lavielle, M., Vaisse, C., and Daudin, J.-J. (2005). A statistical approach for array CGH data analysis. BMC Bioinformatics, 6(1):27. &lt;http://www.ncbi.nlm.nih.gov/pubmed/15705208&gt;`_ ,
+and also cite Rigaill, G. (2010). `Pruned dynamic programming for optimal multiple change-point detection. &lt;http://arxiv.org/abs/1004.0887&gt;`_	
+
+When using the labels of the segments, please cite CGHCall `M. A. van de Wiel, K. I. Kim, S. J. Vosse, W. N. van Wieringen, S. M. Wilting, and B. Ylstra. CGHcall: calling aberrations for array CGH tumor profiles. Bioinformatics, 23(7):892–894, 2007. &lt;http://bioinformatics.oxfordjournals.org/content/23/7/892.abstract&gt;`_
+	
+</help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/segmentFracB.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,144 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--chrom",type="character",default=NULL, dest="chrom"),
+		make_option("--input",type="character",default=NULL, dest="input"),
+		make_option("--output",type="character",default=NULL, dest="output"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--settings_type",type="character",default=NULL, dest="settingsType"),
+		make_option("--output_graph",type="character",default=NULL, dest="outputgraph"),
+		make_option("--zip_figures",type="character",default=NULL, dest="zipfigures"),
+		make_option("--settings_tumor",type="character",default=NULL, dest="settingsTypeTumor"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log"),
+		make_option("--userid",type="character",default=NULL, dest="userid"),
+		make_option("--method",type="character",default=NULL, dest="method")
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+args<-commandArgs(TRUE)
+
+chrom=opt$chrom
+datasetFile=opt$input
+output=opt$output
+tmp_dir=opt$new_file_path
+input=opt$settingsType
+outputfigures=type.convert(opt$outputgraph)
+tumorcsv=opt$settingsTypeTumor
+user=opt$userid
+method=opt$method
+log=opt$log
+outputlog=opt$outputlog
+outputgraph=opt$outputgraph
+zipfigures=opt$zipfigures
+
+#chrom=opt$chrom
+#datasetFile=opt$input
+#output=opt$output
+#tmp_dir=opt$new_file_path
+#nbcall=as.numeric(opt$nbcall)
+#settingsType=opt$settingsType
+#outputfigures=type.convert(opt$outputgraph)
+#snp=type.convert(opt$snp)
+#tumorcsv=opt$settingsTypeTumor
+#cellularity=as.numeric(opt$cellularity)
+#user=opt$userid
+#method=opt$method
+#log=opt$log
+#outputlog=opt$outputlog
+#outputgraph=opt$outputgraph
+#zipfigures=opt$zipfigures
+
+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)
+}
+
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+
+
+inputDataset=read.table(file=datasetFile,stringsAsFactors=FALSE)
+dataset=inputDataset[1,2]
+
+
+
+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)
+}
+
+fig_dir = file.path("mpagenomics", user, "figures", dataset, "segmentation","fracB")
+abs_fig_dir = file.path(tmp_dir, fig_dir)
+
+if (outputgraph) {
+	if (dir.exists(abs_fig_dir)) {
+		system(paste0("rm -r ", abs_fig_dir))
+	}
+}
+
+if (input == 'dataset') {
+	segcall=segFracBSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, savePlot=outputfigures, method=method)
+	
+} else {
+	input_tmp <- strsplit(input,",")
+	input_tmp_vecstring <-unlist(input_tmp)
+	input_vecstring = sub("^([^.]*).*", "\\1", input_tmp_vecstring) 
+	segcall=segFracBSignal(dataset,chromosome=chrom_vec, normalTumorArray=tumorcsv, listOfFiles=input_vecstring, savePlot=outputfigures, method=method)
+	
+}
+write.table(segcall,output,row.names = FALSE, quote=FALSE, sep = "\t")
+
+if (outputgraph) {	
+	setwd(abs_fig_dir)
+	files2zip <- dir(abs_fig_dir)
+	zip(zipfile = "figures.zip", files = files2zip)
+	file.rename("figures.zip",zipfigures)
+}
+
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
+
+#sink(output)
+#print(format(segcall))
+#sink()
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/segmentFracB.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,178 @@
+<tool id="segFracB" name="Segmentation of allele B fraction " force_history_refresh="True" version="1.0.0">
+  <description></description>
+  <command>
+    <![CDATA[ 
+        Rscript
+        ${__tool_directory__}/segmentFracB.R  
+  		--chrom '$chrom' 
+  		--input '$input' 
+  		--output '$output' 
+  		--new_file_path '$__new_file_path__'
+  		#if $settings.settingsType == "file":
+  			--settings_type '$settings.inputs'
+  		#end if
+  		#if $settings.settingsType == "dataset":
+  			--settings_type '$settings.settingsType'
+  		#end if
+  		--output_graph '$outputgraph' 
+  		--zip_figures '$zipfigures'
+  		--settings_tumor '$tumorcsv'
+  		--outputlog '$outputlog' 
+  		--log '$log' 
+  		--userid '$__user_id__' 
+  		--method '$method'
+  	]]>
+  </command>
+  <inputs>
+   	<param name="input" type="data" format="dsf" label="Dataset summary file" help="Summary text file generated by the Data normalization tool"/>
+	        
+    <conditional name="settings">
+      <param name="settingsType" type="select" label="Files selection Mode" help="Select the whole cel files dataset or pick-up only few files from the dataset">
+        <option value="dataset">Select whole dataset</option>
+        <option value="file">Select file individually</option>
+      </param>
+      <when value="dataset" />
+      <when value="file">
+        <param name="inputs" type="select" format="cel" multiple="true" label="Cel files">
+        <options from_dataset="input">
+    		<column name="name" index="0"/>
+    		<column name="value" index="0"/>
+		</options>
+		</param>
+      </when>
+    </conditional>
+    
+    <param name="tumorcsv" type="data" format="csv" label="Normal-tumor csv file" help="Normal-tumor csv file. See below for more information."/>
+        
+              
+    <!--param name="chrom" type="text" value="All" label="Chromosomes" help="Chromosomes to segment. Use comma to choose multiple chromosomes: e.g. 1, 3, 8. Use 'All' for a segmentation on all chromosomes" /-->
+    
+    <param  name="chrom" type="select" size="6" multiple="true" label="Chromosomes" help="leave blank for all chromosomes">
+      <option value="All">All</option>
+      <option value="1">chr 1</option>
+      <option value="2">chr 2</option>
+      <option value="3">chr 3</option>
+      <option value="4">chr 4</option>
+      <option value="5">chr 5</option>
+      <option value="6">chr 6</option>
+      <option value="7">chr 7</option>
+      <option value="8">chr 8</option>
+      <option value="9">chr 9</option>
+      <option value="10">chr 10</option>
+      <option value="11">chr 11</option>
+      <option value="12">chr 12</option>
+      <option value="13">chr 13</option>
+      <option value="14">chr 14</option>
+      <option value="15">chr 15</option>
+      <option value="16">chr 16</option>
+      <option value="17">chr 17</option>
+      <option value="18">chr 18</option>
+      <option value="19">chr 19</option>
+      <option value="20">chr 20</option>
+      <option value="21">chr 21</option>
+      <option value="22">chr 22</option>
+      <option value="23">chr 23</option>
+      <option value="24">chr 24</option>
+      <option value="25">chr 25</option>
+    </param>   	
+    <param name="method" type="select" label="Segmentation method" help="">
+      <option value="cghseg">cghseg</option>
+      <option value="PELT">PELT</option>
+    </param>
+  	<param name="outputgraph" type="select" label="Output figures">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+  </inputs>
+  <outputs>
+    <data format="sar" name="output" label="allele B fraction segmentation of ${input.name}" />
+    <data format="zip" name="zipfigures" label="allele B fraction segmentation figures of ${input.name}">
+    	<filter>outputgraph == "TRUE"</filter>	
+    </data>
+    <data format="log" name="log" label="log of allele B fraction segmentation of ${input.name}">
+    	<filter>outputlog == "TRUE"</filter>
+    </data>
+   </outputs>
+   <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+<help>
+.. class:: warningmark
+
+Data normalization must be run (with the data normalization tool) prior to segmentation.
+
+-----
+
+**What it does**     	
+This tool segments allele B fraction extracted from the previously normalized data. This tools works only on normal-tumor study.
+	
+Outputs:
+  	
+*A tabular text file containing 6 columns which describe all the segment (1 line per segment):*
+	
+	- sampleNames: Name of the file.
+	- chrom: The chromosome of the segment.
+	- chromStart: The starting position (in bp) of the segment. This position is not included in the segment.
+	- chromEnd: The ending position (in bp) of the segment. This position is included in the segment.
+	- probes: Number of probes in the segment.
+	- means: Mean of the segment.
+	  		
+*A .zip file containing all the figures (optionnal)*
+	
+-----
+  		  		
+**Normal-tumor csv files**
+     	
+Normal-tumor csv file is required to segment Allele B fraction, because naive genotyping is based on normal samples :
+
+	- The first column contains the names of the files corresponding to normal samples of the dataset.
+     	 
+	- The second column contains the names of the tumor samples files. 
+     	
+	- Column names of these two columns are respectively normal and tumor.
+     	
+	- Columns are separated by a comma.
+     	
+	- *Extensions of the files (.CEL for example) should be removed*
+
+
+     	
+**Example** 
+
+Let 6 .cel files in the studied dataset (3 patients, each of them being represented by a couple of normal and tumor cel files.) ::
+     	
+     	patient1_normal.cel
+     	patient1_tumor.cel
+     	patient2_normal.cel
+     	patient2_tumor.cel
+     	patient3_normal.cel 
+     	patient3_tumor.cel
+      	
+
+The csv file should look like this ::
+     	
+     	normal,tumor
+     	patient1_normal,patient1_tumor
+     	patient2_normal,patient2_tumor
+     	patient3_normal,patient3_tumor
+
+-----     	  		
+
+     	
+**Citation**
+
+If you use this tool please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. MPAgenomics : An R package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+	
+If segmentation is performed with PELT, please cite `R. Killick, P. Fearnhead, and I. A. Eckley. Optimal detection of changepoints with a linear computational cost. Journal of the American Statistical Association, 107(500):1590–1598, 2012. &lt;http://arxiv.org/abs/1101.1438&gt;`_
+
+If segmentation is performed by cghseg, please cite	`Picard, F., Robin, S., Lavielle, M., Vaisse, C., and Daudin, J.-J. (2005). A statistical approach for array CGH data analysis. BMC Bioinformatics, 6(1):27. &lt;http://www.ncbi.nlm.nih.gov/pubmed/15705208&gt;`_ ,
+and also cite Rigaill, G. (2010). `Pruned dynamic programming for optimal multiple change-point detection. &lt;http://arxiv.org/abs/1004.0887&gt;`_
+	
+</help>
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/segmentation.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,139 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--input",type="character",default=NULL, dest="input"),
+		make_option("--output",type="character",default=NULL, dest="output"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--nbcall",type="character",default=NULL, dest="nbcall"),
+		make_option("--outputgraph",type="character",default=NULL, dest="outputgraph"),
+		make_option("--graph",type="character",default=NULL, dest="graph"),
+		make_option("--signalType",type="character",default=NULL, dest="signalType"),
+		make_option("--cellularity",type="character",default=NULL, dest="cellularity"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log"),
+		make_option("--user_id",type="character",default=NULL, dest="userid"),
+		make_option("--method",type="character",default=NULL, dest="method")
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+input=opt$input
+output=opt$output
+tmp_dir=opt$new_file_path
+nbcall=as.numeric(opt$nbcall)
+outputgraph=type.convert(opt$outputgraph)
+cellularity=as.numeric(opt$cellularity)
+userId=opt$userid
+method=opt$method
+log=opt$log
+outputlog=opt$outputlog
+graph=opt$graph
+signalType=opt$signalType
+
+#args<-commandArgs(TRUE)
+#
+#input=args[1]
+#tmp_dir=args[2]
+#nbcall=as.numeric(args[3])
+#cellularity=as.numeric(args[4]) 
+#output=args[5]
+#method=args[6]
+#userId=args[7]
+#signalType=args[8]
+
+library(MPAgenomics)
+workdir=file.path(tmp_dir,"mpagenomics",userId)
+setwd(workdir)
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+
+CN=read.table(input,header=TRUE)
+uniqueChr=unique(CN$chromosome)
+drops=c("chromosome","position","probeName")
+CNsignal=CN[,!(names(CN)%in% drops),drop=FALSE]
+
+samples=names(CNsignal)
+
+if (signalType=="CN")
+{
+
+result=data.frame(sampleNames=character(0),chrom=character(0),chromStart=numeric(0),chromEnd=numeric(0),probes=numeric(0),means=numeric(0),calls=character(0),stringsAsFactors=FALSE)
+
+for (chr in uniqueChr)
+{
+currentSubset=subset(CN, chromosome==chr)
+currentPositions=currentSubset["position"]
+for (sample in samples) 
+  {
+    currentSignal=currentSubset[sample]
+	if (length(which(!is.na(unlist(currentSignal))))>1)
+	{
+		currentSeg=segmentation(signal=unlist(currentSignal),position=unlist(currentPositions),method=method)
+    	callobj= callingObject(copynumber=currentSeg$signal, segmented=currentSeg$segmented,chromosome=rep(chr,length(currentSeg$signal)), position=currentSeg$startPos,sampleNames=sample)
+	    currentCall=callingProcess(callobj,nclass=nbcall,cellularity=cellularity,verbose=TRUE)
+	    currentResult=currentCall$segment
+	    currentResult["sampleNames"]=c(rep(sample,length(currentCall$segment$chrom)))
+	    result=rbind(result,currentResult)
+	}
+  }
+}
+finalResult=data.frame(sampleNames=result["sampleNames"],chrom=result["chrom"],chromStart=result["chromStart"],chromEnd=result["chromEnd"],probes=result["probes"],means=result["means"],calls=result["calls"],stringsAsFactors=FALSE)
+
+write.table(finalResult,output,row.names = FALSE, quote=FALSE, sep = "\t")
+} else {
+	result=data.frame(sampleNames=character(0),chrom=character(0),start=numeric(0),end=numeric(0),points=numeric(0),means=numeric(0),stringsAsFactors=FALSE)
+	
+	for (chr in uniqueChr)
+	{
+		cat(paste0("chromosome ",chr,"\n"))
+		currentSubset=subset(CN, chromosome==chr)
+		currentPositions=currentSubset["position"]
+		for (sample in samples) 
+		{
+			cat(paste0("  sample ",sample,"..."))
+			currentSignal=currentSubset[sample]
+			if (length(which(!is.na(unlist(currentSignal))))>1)
+			{
+				currentSeg=segmentation(signal=unlist(currentSignal),position=unlist(currentPositions),method=method)
+				currentResult=currentSeg$segment
+				currentResult["chrom"]=c(rep(chr,length(currentSeg$segment$means)))
+				currentResult["sampleNames"]=c(rep(sample,length(currentSeg$segment$means)))
+				result=rbind(result,currentResult)
+				
+			}
+			cat(paste0("OK\n"))
+		}
+	}
+	finalResult=data.frame(sampleNames=result["sampleNames"],chrom=result["chrom"],chromStart=result["start"],chromEnd=result["end"],probes=result["points"],means=result["means"],stringsAsFactors=FALSE)
+	write.table(finalResult,output,row.names = FALSE, quote=FALSE, sep = "\t")
+}
+
+if (outputgraph){
+	file.rename(file.path(tmp_dir,"mpagenomics",userId,"Rplots.pdf"), graph)
+}
+
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/segmentation.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,114 @@
+<tool id="segmentation" name="Segmentation and calling" force_history_refresh="True" version="1.1.0">
+  <description>of a previously normalized signal</description>
+  <requirement type="package" version="1.1.2">mpagenomics</requirement>
+  <command>
+    <![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/segmentation.R 
+  		#if $signalType.signal == "CN":
+  			--nbcall '$signalType.nbcall' 
+  			--cellularity '$signalType.cellularity'
+  		#else
+  			--nbcall '3' 
+  			--cellularity '1.0'
+  		#end if
+  		--input '$input' 
+  		--new_file_path '$__new_file_path__' 
+  		--outputlog '$outputlog' 
+  		--output '$output' 
+  		--log '$log' 
+  		--outputgraph '$outputgraph'
+  		--graph '$graph' 
+  		--method '$method' 
+  		--signalType '$signalType.signal'
+  		--user_id '$__user_id__'
+  	]]>
+  		
+  </command>
+  <inputs>
+    <param name="input" type="data" format="sef" label="Input Signal" help="see below for more information on file format"/>
+	    
+    <param name="method" type="select" label="Segmentation method" help="">
+      <option value="cghseg">cghseg</option>
+      <option value="PELT">PELT</option>
+    </param>
+    
+	<conditional name="signalType">
+    	<param name="signal" type="select" multiple="false" label="Signal type">
+     		<option value="CN">CN</option>
+      		<option value="fracB">fracB</option>
+    	</param> 
+    	<when value="fracB"/>
+    	<when value="CN">
+    		
+    <param name="nbcall" type="select" label="Number of calling classes" help="The number of levels to be used for calling. Either 3 (loss, normal, gain), 4 (including amplifications), 5 (including double deletions) ">
+      <option value="3">3</option>
+      <option value="4">4</option>
+      <option value="5">5</option>
+    </param>
+    <param name="cellularity" type="float" size="5" value="1" min="0" max="1" label="Cellularity" help="Ratio of tumor cells in the sample. Real value between 0 and 1"/>
+	</when>
+    </conditional>
+    <param name="outputgraph" type="select" label="Output figures">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+     </param>    
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+  </inputs>       
+  <outputs>
+    <data format="scr" name="output" label="segmentation of ${input.name}" />
+    <data format="log" name="log" label="log of segmentation of ${input.name}">
+    	<filter>outputlog == "TRUE"</filter>
+    </data>
+    <data format="pdf" name="graph" label="graph of segmentation of ${input.name}">
+    	<filter>outputgraph == "TRUE"</filter>
+    </data>
+  </outputs>
+  <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+  <help>
+
+**What it does**     	
+This tool segments normalized profiles provided by the user and labels segments found in the copy-number profiles.
+	
+Input format:
+  	
+*A tabular text file containing 3 fixed columns and 1 column per sample:*
+	
+	- chr: Chromosome.
+	- position: Genomic position (in bp)
+  	- probeName: Probes names.
+  	- One column per sample which contains the copy number profile for each sample
+ 
+Output format:
+  	
+*A tabular text file containing 7 columns which describe all the segments (1 line per segment):*
+	
+	- sampleNames: Column names corresponding to samples in the input file.
+  	- chrom: Chromosome of the segment.
+	- chromStart: Starting position (in bp) of the segment. This position is not included in the segment.
+	- chromEnd: Ending position (in bp) of the segment. This position is included in the segment.
+	- probes: Number of probes in the segment.
+	- means: Mean of the segment.
+	- calls: Calling of the segment (”double loss”, ”loss”, ”normal”, ”gain” or ”amplification”).
+    
+-----
+  		
+**Citation**
+If you use this tool please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. MPAgenomics : An R package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+  	
+If segmentation is performed with PELT, please also cite `R. Killick, P. Fearnhead, and I. A. Eckley. Optimal detection of changepoints with a linear computational cost. Journal of the American Statistical Association, 107(500):1590–1598, 2012. &lt;http://arxiv.org/abs/1101.1438&gt;`_
+
+If segmentation is performed by cghseg, please cite	`Picard, F., Robin, S., Lavielle, M., Vaisse, C., and Daudin, J.-J. (2005). A statistical approach for array CGH data analysis. BMC Bioinformatics, 6(1):27. &lt;http://www.ncbi.nlm.nih.gov/pubmed/15705208&gt;`_ ,
+and also cite Rigaill, G. (2010). `Pruned dynamic programming for optimal multiple change-point detection. &lt;http://arxiv.org/abs/1004.0887&gt;`_	
+
+When using the labels of the segments, please cite CGHCall `M. A. van de Wiel, K. I. Kim, S. J. Vosse, W. N. van Wieringen, S. M. Wilting, and B. Ylstra. CGHcall: calling aberrations for array CGH tumor profiles. Bioinformatics, 23(7):892–894, 2007. &lt;http://bioinformatics.oxfordjournals.org/content/23/7/892.abstract&gt;`_
+	
+</help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/selection.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,135 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--chrom",type="character",default=NULL, dest="chrom"),
+		make_option("--input",type="character",default=NULL, dest="input"),
+		make_option("--output",type="character",default=NULL, dest="output"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--response",type="character",default=NULL, dest="response"),
+		make_option("--settingsType",type="character",default=NULL, dest="settingsType"),
+		make_option("--outputgraph",type="character",default=NULL, dest="outputgraph"),
+		make_option("--settingsSnp",type="character",default=NULL, dest="settingsSnp"),
+		make_option("--settingsSignal",type="character",default=NULL, dest="settingsSignal"),
+		make_option("--settingsLoss",type="character",default=NULL, dest="settingsLoss"),
+		make_option("--pdffigures",type="character",default=NULL, dest="pdffigures"),
+		make_option("--folds",type="character",default=NULL, dest="folds"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log"),
+		make_option("--userId",type="character",default=NULL, dest="userid"),
+		make_option("--settingsPackage",type="character",default=NULL, dest="settingsPackage")
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+
+chrom=opt$chrom
+dataset=opt$input
+dataResponse=opt$response
+output=opt$output
+tmp_dir=opt$new_file_path
+signal=opt$settingsSignal
+settingsType=opt$settingsType
+outputfigures=type.convert(opt$outputgraph)
+snp=type.convert(opt$settingsSnp)
+user=opt$userid
+folds=as.numeric(opt$folds)
+loss=opt$settingsLoss
+log=opt$log
+outputlog=opt$outputlog
+outputgraph=opt$outputgraph
+pdffigures=opt$pdffigures
+package=opt$settingsPackage
+
+
+library(MPAgenomics)
+library(glmnet)
+library(spikeslab)
+library(lars)
+
+inputDataset=read.table(file=dataset,stringsAsFactors=FALSE)
+input=inputDataset[1,2]
+workdir=file.path(tmp_dir, "mpagenomics",user)
+print(workdir)
+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)
+	}
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+
+if (settingsType == "tumor") {
+	if (signal=="CN") {
+			res=markerSelection(input,dataResponse, chromosome=chrom_vec, signal=signal, normalTumorArray=tumor, onlySNP=snp, loss=loss, plot=outputfigures, nbFolds=folds, pkg=package)
+		} else {
+			res=markerSelection(input,dataResponse, chromosome=chrom_vec,signal=signal,normalTumorArray=tumor, loss=loss, plot=outputfigures, nbFolds=folds,pkg=package)	
+		} 
+} else {
+	if (signal=="CN") {
+		res=markerSelection(input,dataResponse, chromosome=chrom_vec, signal=signal, onlySNP=snp, loss=loss, plot=outputfigures, nbFolds=folds,pkg=package)
+		} else {
+  		res=markerSelection(input,dataResponse, chromosome=chrom_vec, signal=signal, loss=loss, plot=outputfigures, nbFolds=folds,pkg=package)
+		}
+}
+
+res
+
+df=data.frame()
+list_chr=names(res)
+markerSelected=FALSE
+
+for (i in list_chr) {
+  chr_data=res[[i]]
+  len=length(chr_data$markers.index)
+  if (len != 0)
+  {
+	markerSelected=TRUE
+	chrdf=data.frame(rep(i,len),chr_data$markers.position,chr_data$markers.index,chr_data$markers.names,chr_data$coefficient)
+  	df=rbind(df,chrdf)
+  }
+}
+
+if (outputgraph){
+	file.rename(file.path(tmp_dir,"mpagenomics",user,"Rplots.pdf"), pdffigures)
+}
+
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
+
+if (markerSelected) {
+	colnames(df) <- c("chr","position","index","names","coefficient")
+	#sink(output)
+	#print(format(df),row.names=FALSE)
+	#sink()
+	write.table(df,output,row.names = FALSE, quote = FALSE, sep = "\t")
+} else 
+	writeLines("no SNP selected", output)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/selection.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,235 @@
+<tool id="selection" name="Markers selection" force_history_refresh="True" version="0.1.0">
+  <command>
+    <![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/selection.R 
+  	 --input '$input'  
+  	 --response '$response' 
+  	 --chrom '$chromosome' 
+  	 --new_file_path '$__new_file_path__' 
+  	 --settingsSignal '$settingsSNP.signal'
+  	#if $settingsSNP.signal == "CN":
+  	 --settingsSnp '$settingsSNP.snp' 
+  	#end if
+  	#if $settingsSNP.signal == "fracB":
+  	 --settingsSnp 'none'
+  	#end if
+  	 --settingsType '$settings.settingsType'
+  	#if $settings.settingsType == "tumor":
+  	 --settingsType '$tumorcsv' 
+  	#end if
+  	#if $settings.settingsType == "standard":
+  	 --settingsType 'none'
+  	#end if
+  	 --folds '$folds' 
+  	 --settingsLoss '$settingsLoss.loss' 
+  	 --outputgraph '$outputgraph' 
+  	 --output '$output' 
+  	 --pdffigures '$pdffigures' 
+  	 --outputlog '$outputlog' 
+  	 --log '$log' 
+  	 --userId '$__user_id__'
+  	#if $settingsLoss.loss == "linear":
+  	 --settingsPackage '$settingsLoss.package' 
+  	#end if
+  	#if $settingsLoss.loss == "logistic":
+  	 --settingsPackage'HDPenReg'
+  	#end if
+  	]]>
+  </command>
+  <inputs>
+    <param name="input" type="data" format="dsf" label="Dataset summary file" help="Summary text file generated by the Data normalization tool"/>
+	 
+  	<param name="response" type="data" format="csv" label="Data response" help="Data response csv file. See below for more information on file format" />
+	
+	<param  name="chromosome" type="select" size="6" multiple="true" label="Chromosomes">
+      <option value="1">chr 1</option>
+      <option value="2">chr 2</option>
+      <option value="3">chr 3</option>
+      <option value="4">chr 4</option>
+      <option value="5">chr 5</option>
+      <option value="6">chr 6</option>
+      <option value="7">chr 7</option>
+      <option value="8">chr 8</option>
+      <option value="9">chr 9</option>
+      <option value="10">chr 10</option>
+      <option value="11">chr 11</option>
+      <option value="12">chr 12</option>
+      <option value="13">chr 13</option>
+      <option value="14">chr 14</option>
+      <option value="15">chr 15</option>
+      <option value="16">chr 16</option>
+      <option value="17">chr 17</option>
+      <option value="18">chr 18</option>
+      <option value="19">chr 19</option>
+      <option value="20">chr 20</option>
+      <option value="21">chr 21</option>
+      <option value="22">chr 22</option>
+      <option value="23">chr 23</option>
+      <option value="24">chr 24</option>
+      <option value="25">chr 25</option>
+    </param>   
+	<conditional name="settingsSNP">
+    	<param name="signal" type="select" multiple="false" label="Signal you want to work on">
+     		<option value="CN">CN</option>
+      		<option value="fracB">fracB</option>
+    	</param> 
+    	<when value="fracB"/>
+		<when value="CN">    	
+     	<param name="snp" type="select" label="Select Probes">
+        	<option value="FALSE">CN and SNP probes</option>
+        	<option value="TRUE">Only SNP probes</option>
+    	</param>
+    	</when>
+    </conditional>
+    <conditional name="settings">
+      <param name="settingsType" type="select" label="Reference" help="">
+        <option value="standard">Study without reference</option>
+        <option value="tumor">Normal-tumor study</option>
+      </param>
+      <when value="standard" />
+      <when value="tumor">
+        <param name="tumorcsv" type="data" format="csv" label="tumor boost csv file" help="Normal-tumor csv file. See below for more information."/>
+      </when>
+    </conditional>
+   
+    <param name="folds" type="integer" min="1" value="10" label ="Number of folds for cross validation" help="Integer between 1 and number of file in the .cel file dataset"/>
+    <conditional name="settingsLoss">
+    <param name="loss" type="select" multiple="false" label="Response type">
+      	<option value="linear">Linear</option>
+    	<option value="logistic">Logistic</option>
+     </param>
+      <when value="logistic" />
+      <when value="linear">
+        <param name="package" type="select" multiple="false" label="Method" help="Either “HDPenReg” or “spikeslab”. Used package in linear case">
+      		<option value="HDPenReg">HDPenReg</option>
+    		<option value="spikeslab">spikeslab</option>
+     	</param> 
+     </when>
+    </conditional>
+    <param name="outputgraph" type="select" multiple="false" label="Plot figures">
+      <option value="TRUE">Yes</option>
+      <option value="FALSE">No</option>
+    </param>
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>
+    
+    </inputs>        
+  <outputs>
+  	<data format="tabular" name="output" label="selection of ${input.name}" />
+    <data format="pdf" name="pdffigures" label="figures of SNPs selection of ${input.name}">
+    	<filter>outputgraph == "TRUE"</filter>
+    	<filter>(settingsLoss['package'] != 'spikeslab')</filter>	
+    </data>    
+    <data format="log" name="log" label="log of SNPs selection of ${input.name}">
+    	<filter>outputlog == "TRUE"</filter>
+    </data>  	
+  </outputs>
+  <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+  <help>
+.. class:: warningmark
+
+Data normalization must be run with the Data Normalization tool prior to SNPs selection. Otherwise, the standalone version can be used to perform marker selection from matrices containing data normalized with tools different from the one proposed in this instance.  
+
+-----
+   	
+**What it does**
+   	    	
+This tool selects some relevant markers according to a response using penalized regressions.
+
+Output:
+  	
+A tabular text file containing 5 columns which describe all the selected SNPs (1 line per SNPs):
+	
+	- chr: Chromosome containing the selected SNP.
+  	- position: Position of the selected SNP.
+	- index: Index of the selected SNP.
+	- names: Name of the selected SNP.
+	- coefficient: Regression coefficient of the selected SNP.
+
+-----
+
+**Data Response csv file**
+     	
+Data response csv file format:
+	
+	- The first column contains the names of the different files of the data-set.
+     	 
+	- The second column contains the response associated with each file. 
+     	
+	- Column names of these two columns are respectively files and response.
+
+	- Columns are separated by a comma
+     	
+	- *Extensions of the files (.CEL for example) should be removed*
+
+
+     	
+**Example** 
+
+Let 3 .cel files in the studied dataset ::
+     	
+     	patient1.cel
+     	patient2.cel
+     	patient3.cel 
+     	
+The csv file should look like this ::
+     	
+     	files,response
+     	patient1,1.92145
+     	patient2,2.12481
+     	patient3,1.23545
+
+
+-----
+  	
+**Normal-tumor study**
+     	
+In cases where normal (control) samples match to tumor samples, they are taken as references to extract copy number profile. In this case, a normal-tumor csv file must be provided :
+
+	- The first column contains the names of the files corresponding to normal samples of the dataset.
+     	 
+	- The second column contains the names of the tumor samples files. 
+     	
+	- Column names of these two columns are respectively normal and tumor.
+     	
+	- Columns are separated by a comma.
+     	
+	- *Extensions of the files (.CEL for example) should be removed*
+
+     	
+**Example** 
+
+Let 6 .cel files in the studied dataset (3 patients, each of them being represented by a couple of normal and tumor cel file.) ::
+     	
+     	patient1_normal.cel
+     	patient1_tumor.cel
+     	patient2_normal.cel
+     	patient2_tumor.cel
+     	patient3_normal.cel 
+     	patient3_tumor.cel
+      	
+
+The csv file should look like this ::
+     	
+     	normal,tumor
+     	patient1_normal,patient1_tumor
+     	patient2_normal,patient2_tumor
+     	patient3_normal,patient3_tumor
+
+-----     	  		
+
+
+   	
+**Citation**
+		
+If you use this tool please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. MPAgenomics : An R package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+ 
+ </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/selectionExtracted.R	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,89 @@
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--input",type="character",default=NULL, dest="input"),
+		make_option("--output",type="character",default=NULL, dest="output"),
+		make_option("--new_file_path",type="character",default=NULL, dest="new_file_path"),
+		make_option("--response",type="character",default=NULL, dest="response"),
+		make_option("--loss",type="character",default=NULL, dest="loss"),
+		make_option("--folds",type="character",default=NULL, dest="folds"),
+		make_option("--outputlog",type="character",default=NULL, dest="outputlog"),
+		make_option("--log",type="character",default=NULL, dest="log")
+);
+
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
+
+#loading libraries
+
+
+input=opt$input
+response=opt$response
+output=opt$output
+tmp_dir=opt$new_file_path
+nbFolds=as.numeric(opt$folds)
+loss=opt$loss
+log=opt$log
+outputlog=opt$outputlog
+
+
+#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)
+
+if (outputlog){
+	sinklog <- file(log, open = "wt")
+	sink(sinklog ,type = "output")
+	sink(sinklog, type = "message")
+} 
+
+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
+
+if (outputlog){
+	sink(type="output")
+	sink(type="message")
+	close(sinklog)
+} 
+
+#sink(output)
+#print(format(CNsignalResult),row.names=FALSE)
+#sink()
+write.table(CNsignalResult,output,row.names = FALSE, quote=FALSE, sep = "\t")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/selectionExtracted.xml	Tue May 12 10:40:36 2020 -0400
@@ -0,0 +1,111 @@
+<tool id="markersSelection" name="Markers selection" force_history_refresh="True" version="0.1.0">
+  <description> of previously extracted signal</description>
+  <command>
+  	<![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/selectionExtracted.R 
+    --input '$input' 
+  	--response '$response' 
+  	--new_file_path '$__new_file_path__' 
+  	--folds '$folds' 
+  	--loss '$loss' 
+  	--outputlog '$outputlog' 
+  	--output '$output' 
+  	--log '$log'
+  	]]>
+  </command>
+  <inputs>
+    <param name="input" type="data" format="sef" label="Input Signal" help="see below for more information on file format"/>
+	<param name="response" type="data" format="csv" label="Data response" help="Data response csv file. See below for more information on file format" />    
+	<param name="folds" type="integer" min="1" value="10" label ="Number of folds for cross validation" help="Integer between 1 and number of file in the .cel file dataset"/>
+    <param name="loss" type="select" multiple="false" label="Response type">
+      	<option value="linear">Linear</option>
+    	<option value="logistic">Logistic</option>
+    </param>
+   
+	<param name="outputgraph" type="select" label="Output figures">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+     </param>    
+    <param name="outputlog" type="select" label="Output log">
+        <option value="TRUE">Yes</option>
+        <option value="FALSE">No</option>
+    </param>    
+  </inputs>       
+  <outputs>
+    <data format="tabular" name="output" label="selection of ${input.name}" />
+    <data format="log" name="log" label="log of selection of ${input.name}" >
+    	<filter>outputlog == "TRUE"</filter>
+    </data>
+  </outputs>
+  <stdio>
+    <exit_code range="1:"   level="fatal"   description="See logs for more details" />
+   </stdio>
+  <help>
+  **What it does**
+   	    	
+This tool selects some relevant markers according to a response using penalized regressions.
+  
+Input:
+
+*A tabular text file containing 3 fixed columns and 1 column per sample:*
+	
+	- chr: Chromosome.
+	- position: Genomic position (in bp).
+  	- probeNames: Names of the probes.
+  	- One column per sample which contain the copy number signal for each sample.
+
+Output:
+  	
+*A tabular text file containing 5 columns which describe all the selected SNPs (1 line per SNP):*
+	
+	- chr: Chromosome containing the selected SNP.
+  	- position: Position of the selected SNP.
+	- index: Index of the selected SNP.
+	- names: Name of the selected SNP.
+	- coefficient: Regression coefficient of the selected SNP.
+
+-----
+
+**Data Response csv file**
+     	
+Data response csv file format:
+	
+	- The first column contains the names of the different files of the dataset.
+     	 
+	- The second column is the response associated with each file. 
+     	
+	- Column names of these two columns are respectively files and response.
+
+	- Columns are separated by a comma
+     	
+	- *Extensions of the files (.CEL for example) should be removed*
+
+
+     	
+**Example** 
+
+Let 3 .cel files in the studied dataset ::
+     	
+     	patient1.cel
+     	patient2.cel
+     	patient3.cel 
+     	
+The csv file should look like this ::
+     	
+     	files,response
+     	patient1,1.92145
+     	patient2,2.12481
+     	patient3,1.23545
+
+
+-----
+  	   	
+**Citation**
+	
+If you use this tool please cite : 
+
+`Q. Grimonprez, A. Celisse, M. Cheok, M. Figeac, and G. Marot. MPAgenomics : An R package for multi-patients analysis of genomic markers, 2014. Preprint &lt;http://fr.arxiv.org/abs/1401.5035&gt;`_
+  
+ </help>
+</tool>