comparison ideas_preprocessor.xml @ 11:26eb979cf8d9 draft

Uploaded
author greg
date Wed, 24 Jan 2018 13:47:16 -0500
parents 860b59cae5df
children 4d542da396a7
comparison
equal deleted inserted replaced
10:f45e461b0557 11:26eb979cf8d9
6 <requirement type="package" version="1.4.4">r-optparse</requirement> 6 <requirement type="package" version="1.4.4">r-optparse</requirement>
7 <requirement type="package" version="1.6">samtools</requirement> 7 <requirement type="package" version="1.6">samtools</requirement>
8 <requirement type="package" version="357">ucsc-bigwigaverageoverbed</requirement> 8 <requirement type="package" version="357">ucsc-bigwigaverageoverbed</requirement>
9 </requirements> 9 </requirements>
10 <command detect_errors="exit_code"><![CDATA[ 10 <command detect_errors="exit_code"><![CDATA[
11 #set chromosome_windows = "chromosome_windows.txt"
12 #set ideaspre_input_config = "ideaspre_input_config.txt"
13 #set specify_chrom_windows = $specify_chrom_windows_cond.specify_chrom_windows
11 #set tmp_dir = "tmp" 14 #set tmp_dir = "tmp"
12 #set ideaspre_input_config = "ideaspre_input_config.txt"
13 #set ideas_input_config = "IDEAS_input_config.txt"
14 #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window
15 mkdir $tmp_dir && 15 mkdir $tmp_dir &&
16 mkdir $output.files_path && 16 mkdir $output.files_path &&
17 #if str($specify_genomic_window) == "yes": 17 #if str($specify_chrom_windows) == "yes":
18 ############################################## 18 ##############################################
19 ## Using a genomic window bed file, so categorize 19 ## Using a bed file for defining chrom windows,
20 ## the window positions by chromosome to enable 20 ## so categorize the window positions by
21 ## the IDEAS -inv option. 21 ## chromosome to enable the IDEAS -inv option.
22 ############################################## 22 ##############################################
23 #set chromosome_windows = "chromosome_windows.txt"
24 cp '$gen_chromosome_windows' $chromosome_windows && 23 cp '$gen_chromosome_windows' $chromosome_windows &&
25 #end if 24 #end if
26 ############################################## 25 ##############################################
27 ## Create the config file and prepare the data 26 ## Create the config file and prepare the data
28 ############################################## 27 ##############################################
29 cp '$gen_ideaspre_input_config' $ideaspre_input_config && 28 cp '$gen_ideaspre_input_config' $ideaspre_input_config &&
30 sort $ideaspre_input_config -o $ideaspre_input_config && 29 sort $ideaspre_input_config -o $ideaspre_input_config &&
31 Rscript '$__tool_directory__/ideas_preprocessor.R' 30 Rscript '$__tool_directory__/ideas_preprocessor.R'
32 --ideaspre_input_config '$ideaspre_input_config' 31 --ideaspre_input_config '$ideaspre_input_config'
33 #if str($specify_genomic_window) == "yes": 32 #if str($specify_chrom_windows) == "yes":
34 --ideas_input_config '$ideas_input_config'
35 --chromosome_windows '$chromosome_windows' 33 --chromosome_windows '$chromosome_windows'
36 #end if 34 --chrom_bed_input '$specify_chrom_windows_cond.chrom_bed_input'
37 #if str($specify_genomic_window) == "yes":
38 --bed_input '$specify_genomic_window_cond.bed_input'
39 #else: 35 #else:
40 --chrom_len_file '$chromInfo' 36 --chrom_len_file '$chromInfo'
41 --window_size $specify_genomic_window_cond.window_size 37 --window_size $specify_chrom_windows_cond.window_size
42 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes 38 #set restrict_chromosomes = $specify_chrom_windows_cond.restrict_chromosomes_cond.restrict_chromosomes
43 #if str($restrict_chromosomes) == "yes": 39 #if str($restrict_chromosomes) == "yes":
44 #set chroms = [] 40 #set chroms = []
45 #set chrom_repeat = $specify_genomic_window_cond.restrict_chromosomes_cond.chrom_repeat 41 #set chrom_repeat = $specify_chrom_windows_cond.restrict_chromosomes_cond.chrom_repeat
46 #for $i in $chrom_repeat.chrom 42 #for $i in $chrom_repeat.chrom
47 $chroms.append($i) 43 $chroms.append($i)
48 #end for 44 #end for
49 --restrict_to_chroms ",".join(chroms) 45 --restrict_to_chroms ",".join(chroms)
50 #end if 46 #end if
57 --output_hid $output.hid 53 --output_hid $output.hid
58 --output_files_path '$output.files_path' 54 --output_files_path '$output.files_path'
59 &> ideas_preprocessor_log.txt; 55 &> ideas_preprocessor_log.txt;
60 if [[ $? -ne 0 ]]; then 56 if [[ $? -ne 0 ]]; then
61 cp ideas_preprocessor_log.txt '$output'; 57 cp ideas_preprocessor_log.txt '$output';
62 exit 1; 58 exit 1;
63 fi 59 fi
64 ]]></command> 60 ]]></command>
65 <configfiles> 61 <configfiles>
66 <configfile name="gen_ideaspre_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": 62 <configfile name="gen_ideaspre_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract":
67 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions 63 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions
84 #else: 80 #else:
85 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: 81 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat:
86 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} ${file_name} ${input_items.input.ext} 82 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} ${file_name} ${input_items.input.ext}
87 #end for 83 #end for
88 #end if]]></configfile> 84 #end if]]></configfile>
89 <configfile name="gen_chromosome_windows"><![CDATA[#if str($specify_genomic_window_cond.specify_genomic_window) == "yes": 85 <configfile name="gen_chromosome_windows"><![CDATA[#if str($specify_chrom_windows_cond.specify_chrom_windows) == "yes":
90 #import collections 86 #import collections
91 #set window_positions_by_chroms_odict = $collections.OrderedDict() 87 #set window_positions_by_chroms_odict = $collections.OrderedDict()
92 #for count, line in enumerate(open($specify_genomic_window_cond.bed_input.file_name, 'r')): 88 #for count, line in enumerate(open($specify_chrom_windows_cond.chrom_bed_input.file_name, 'r')):
93 #set $line = $line.strip() 89 #set $line = $line.strip()
94 #if not $line or $line.startswith('#'): 90 #if not $line or $line.startswith('#'):
95 #continue 91 #continue
96 #end if 92 #end if
97 #set items = $line.split('\t') 93 #set items = $line.split('\t')
137 <validator type="unspecified_build"/> 133 <validator type="unspecified_build"/>
138 </param> 134 </param>
139 </repeat> 135 </repeat>
140 </when> 136 </when>
141 </conditional> 137 </conditional>
142 <conditional name="specify_genomic_window_cond"> 138 <conditional name="specify_chrom_windows_cond">
143 <param name="specify_genomic_window" type="select" label="Select Bed file that defines genomic windows on which to process the data"> 139 <param name="specify_chrom_windows" type="select" label="Define chromosome window positions from a bed file?">
144 <option value="no" selected="true">No</option> 140 <option value="no" selected="true">No</option>
145 <option value="yes">Yes</option> 141 <option value="yes">Yes</option>
146 </param> 142 </param>
147 <when value="no"> 143 <when value="no">
148 <param name="window_size" type="integer" value="200" label="Window size in base pairs"/> 144 <param name="window_size" type="integer" value="200" label="Window size in base pairs"/>
158 </repeat> 154 </repeat>
159 </when> 155 </when>
160 </conditional> 156 </conditional>
161 </when> 157 </when>
162 <when value="yes"> 158 <when value="yes">
163 <param name="bed_input" type="data" format="bed" label="Bed file specifying the genomic windows"/> 159 <param name="chrom_bed_input" type="data" format="bed" label="Bed file for defining the chromosome window positions">
160 <validator type="empty_dataset"/>
161 </param>
164 </when> 162 </when>
165 </conditional> 163 </conditional>
166 <param argument="--bychr" type="boolean" truevalue="true" falsevalue="" checked="False" label="Output chromosomes in separate files"/> 164 <param name="bychr" type="boolean" truevalue="true" falsevalue="" checked="False" label="Output chromosomes in separate files"/>
167 <param name="reads_per_bp" type="select" display="radio" label="Calculate the signal in each genomic window using"> 165 <param name="reads_per_bp" type="select" display="radio" label="Calculate the signal in each window using">
168 <option value="6" selected="true">mean</option> 166 <option value="6" selected="true">mean</option>
169 <option value="8">max</option> 167 <option value="8">max</option>
170 </param> 168 </param>
171 <param name="exclude_input" type="data" format="bed" optional="True" multiple="True" label="Select file(s) containing regions to exclude"/> 169 <param name="exclude_input" type="data" format="bed" optional="True" multiple="True" label="Select file(s) containing regions to exclude"/>
172 <param argument="--standardize_datasets" type="boolean" truevalue="true" falsevalue="" checked="False" label="Standardize all datasets"/> 170 <param name="standardize_datasets" type="boolean" truevalue="true" falsevalue="" checked="False" label="Standardize all datasets"/>
173 </inputs> 171 </inputs>
174 <outputs> 172 <outputs>
175 <data name="output" format="ideaspre"/> 173 <data name="output" format="ideaspre"/>
176 </outputs> 174 </outputs>
177 <tests> 175 <tests>