Mercurial > repos > greg > ideas_preprocessor
comparison ideas_preprocessor.xml @ 4:f577a83e86c4 draft
Uploaded
author | greg |
---|---|
date | Wed, 24 Jan 2018 08:29:58 -0500 |
parents | 248b5f72fc02 |
children | 6fe65d1379a8 |
comparison
equal
deleted
inserted
replaced
3:e97851e8951b | 4:f577a83e86c4 |
---|---|
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 tmp_dir = "tmp" | 11 #set tmp_dir = "tmp" |
12 #set prep_input_config = "prep_input_config.txt" | 12 #set ideaspre_input_config = "ideaspre_input_config.txt" |
13 #set prep_output_config = "prep_output_config.txt" | 13 #set ideas_input_config = "IDEAS_input_config.txt" |
14 #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window | 14 #set specify_chrom_window = $specify_chrom_window_cond.specify_chrom_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_window) == "yes": |
18 ############################################## | 18 ############################################## |
19 ## Using a genomic window bed file, so categorize | 19 ## Using a genomic window bed file, so categorize |
20 ## the window positions by chromosome to enable | 20 ## the window positions by chromosome to enable |
21 ## the IDEAS -inv option. | 21 ## the IDEAS -inv option. |
22 ############################################## | 22 ############################################## |
23 #set windows_positions_by_chroms_config = "windows_positions_by_chroms_config.txt" | 23 #set chromosome_windows = "chromosome_windows.txt" |
24 cp '$gen_windows_positions_by_chroms_config' $windows_positions_by_chroms_config && | 24 cp '$gen_chromosome_windows' $chromosome_windows && |
25 #end if | 25 #end if |
26 ############################################## | 26 ############################################## |
27 ## Create the config file and prepare the data | 27 ## Create the config file and prepare the data |
28 ############################################## | 28 ############################################## |
29 cp '$gen_prep_input_config' $prep_input_config && | 29 cp '$gen_ideaspre_input_config' $ideaspre_input_config && |
30 sort $prep_input_config -o $prep_input_config && | 30 sort $ideaspre_input_config -o $ideaspre_input_config && |
31 Rscript '$__tool_directory__/ideas_preprocessor.R' | 31 Rscript '$__tool_directory__/ideas_preprocessor.R' |
32 --prep_input_config '$prep_input_config' | 32 --ideaspre_input_config '$ideaspre_input_config' |
33 #if str($specify_genomic_window) == "yes": | 33 #if str($specify_chrom_window) == "yes": |
34 --prep_output_config '$prep_output_config' | 34 --ideas_input_config '$ideas_input_config' |
35 --windows_positions_by_chroms_config '$windows_positions_by_chroms_config' | 35 --chromosome_windows '$chromosome_windows' |
36 #end if | 36 #end if |
37 #if str($specify_genomic_window) == "yes": | 37 #if str($specify_chrom_window) == "yes": |
38 --bed_input '$specify_genomic_window_cond.bed_input' | 38 --chrom_bed_input '$specify_chrom_window_cond.chrom_bed_input' |
39 #else: | 39 #else: |
40 --chrom_len_file '$chromInfo' | 40 --chrom_len_file '$chromInfo' |
41 --window_size $specify_genomic_window_cond.window_size | 41 --window_size $specify_chrom_window_cond.window_size |
42 #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes | 42 #set restrict_chromosomes = $specify_chrom_window_cond.restrict_chromosomes_cond.restrict_chromosomes |
43 #if str($restrict_chromosomes) == "yes": | 43 #if str($restrict_chromosomes) == "yes": |
44 #set chroms = [] | 44 #set chroms = [] |
45 #set chrom_repeat = $specify_genomic_window_cond.restrict_chromosomes_cond.chrom_repeat | 45 #set chrom_repeat = $specify_chrom_window_cond.restrict_chromosomes_cond.chrom_repeat |
46 #for $i in $chrom_repeat.chrom | 46 #for $i in $chrom_repeat.chrom |
47 $chroms.append($i) | 47 $chroms.append($i) |
48 #end for | 48 #end for |
49 --restrict_to_chroms ",".join(chroms) | 49 --restrict_to_chroms ",".join(chroms) |
50 #end if | 50 #end if |
52 --reads_per_bp $reads_per_bp | 52 --reads_per_bp $reads_per_bp |
53 #if str($exclude_input) not in ["None", ""]: | 53 #if str($exclude_input) not in ["None", ""]: |
54 --exclude_input '$exclude_input' | 54 --exclude_input '$exclude_input' |
55 #end if | 55 #end if |
56 --output '$output' | 56 --output '$output' |
57 --output_hid $output.hid | |
57 --output_files_path '$output.files_path' | 58 --output_files_path '$output.files_path' |
58 &> ideas_preprocessor_log.txt; | 59 &> ideas_preprocessor_log.txt; |
59 if [[ $? -ne 0 ]]; then | 60 if [[ $? -ne 0 ]]; then |
60 cp ideas_preprocessor_log.txt '$output'; | 61 cp ideas_preprocessor_log.txt '$output'; |
61 exit 1; | 62 exit 1; |
62 fi | 63 fi |
63 ]]></command> | 64 ]]></command> |
64 <configfiles> | 65 <configfiles> |
65 <configfile name="gen_prep_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": | 66 <configfile name="gen_ideaspre_input_config"><![CDATA[#if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": |
66 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions | 67 #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions |
67 #for $i in $cell_type_epigenetic_factor_cond.input: | 68 #for $i in $cell_type_epigenetic_factor_cond.input: |
68 #set file_name_with_ext = $i.name | 69 #set file_name_with_ext = $i.name |
69 #if str($file_name_with_ext).find("http") >= 0 or str($file_name_with_ext).find("ftp") >= 0: | 70 #if str($file_name_with_ext).find("http") >= 0 or str($file_name_with_ext).find("ftp") >= 0: |
70 #set file_name_with_ext = $file_name_with_ext.split('/')[-1] | 71 #set file_name_with_ext = $file_name_with_ext.split('/')[-1] |
83 #else: | 84 #else: |
84 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: | 85 #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: |
85 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} ${file_name} ${input_items.input.ext} | 86 ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} ${file_name} ${input_items.input.ext} |
86 #end for | 87 #end for |
87 #end if]]></configfile> | 88 #end if]]></configfile> |
88 <configfile name="gen_windows_positions_by_chroms_config"><![CDATA[#if str($specify_genomic_window_cond.specify_genomic_window) == "yes": | 89 <configfile name="gen_chromosome_windows"><![CDATA[#if str($specify_chrom_window_cond.specify_chrom_window) == "yes": |
89 #import collections | 90 #import collections |
90 #set window_positions_by_chroms_odict = $collections.OrderedDict() | 91 #set window_positions_by_chroms_odict = $collections.OrderedDict() |
91 #for count, line in enumerate(open($specify_genomic_window_cond.bed_input.file_name, 'r')): | 92 #for count, line in enumerate(open($specify_chrom_window_cond.chrom_bed_input.file_name, 'r')): |
92 #set $line = $line.strip() | 93 #set $line = $line.strip() |
93 #if not $line or $line.startswith('#'): | 94 #if not $line or $line.startswith('#'): |
94 #continue | 95 #continue |
95 #end if | 96 #end if |
96 #set items = $line.split('\t') | 97 #set items = $line.split('\t') |
136 <validator type="unspecified_build"/> | 137 <validator type="unspecified_build"/> |
137 </param> | 138 </param> |
138 </repeat> | 139 </repeat> |
139 </when> | 140 </when> |
140 </conditional> | 141 </conditional> |
141 <conditional name="specify_genomic_window_cond"> | 142 <conditional name="specify_chrom_window_cond"> |
142 <param name="specify_genomic_window" type="select" label="Select Bed file that defines genomic windows on which to process the data"> | 143 <param name="specify_chrom_window" type="select" label="Specify window positions using a bed file?"> |
143 <option value="no" selected="true">No</option> | 144 <option value="no" selected="true">No</option> |
144 <option value="yes">Yes</option> | 145 <option value="yes">Yes</option> |
145 </param> | 146 </param> |
146 <when value="no"> | 147 <when value="no"> |
147 <param name="window_size" type="integer" value="200" label="Window size in base pairs"/> | 148 <param name="window_size" type="integer" value="200" label="Window size in base pairs"/> |
157 </repeat> | 158 </repeat> |
158 </when> | 159 </when> |
159 </conditional> | 160 </conditional> |
160 </when> | 161 </when> |
161 <when value="yes"> | 162 <when value="yes"> |
162 <param name="bed_input" type="data" format="bed" label="Bed file specifying the genomic windows"/> | 163 <param name="chrom_bed_input" type="data" format="bed" label="Bed file specifying the window positions"/> |
163 </when> | 164 </when> |
164 </conditional> | 165 </conditional> |
165 <param argument="--bychr" type="boolean" truevalue="true" falsevalue="" checked="False" label="Output chromosomes in separate files"/> | 166 <param argument="--bychr" type="boolean" truevalue="true" falsevalue="" checked="False" label="Output chromosomes in separate files"/> |
166 <param name="reads_per_bp" type="select" display="radio" label="Calculate the signal in each genomic window using"> | 167 <param name="reads_per_bp" type="select" display="radio" label="Calculate the signal in each genomic window using"> |
167 <option value="6" selected="true">mean</option> | 168 <option value="6" selected="true">mean</option> |
169 </param> | 170 </param> |
170 <param name="exclude_input" type="data" format="bed" optional="True" multiple="True" label="Select file(s) containing regions to exclude"/> | 171 <param name="exclude_input" type="data" format="bed" optional="True" multiple="True" label="Select file(s) containing regions to exclude"/> |
171 <param argument="--standardize_datasets" type="boolean" truevalue="true" falsevalue="" checked="False" label="Standardize all datasets"/> | 172 <param argument="--standardize_datasets" type="boolean" truevalue="true" falsevalue="" checked="False" label="Standardize all datasets"/> |
172 </inputs> | 173 </inputs> |
173 <outputs> | 174 <outputs> |
174 <data name="output" format="html"/> | 175 <data name="output" format="ideaspre"/> |
175 </outputs> | 176 </outputs> |
176 <tests> | 177 <tests> |
177 <test> | 178 <test> |
178 </test> | 179 </test> |
179 </tests> | 180 </tests> |